Merge pull request #52 from devoncarew/older_android

support older android devices (>= 17)
diff --git a/packages/flutter/lib/src/http/mojo_client.dart b/packages/flutter/lib/src/http/mojo_client.dart
index 5edbc06..881cde9 100644
--- a/packages/flutter/lib/src/http/mojo_client.dart
+++ b/packages/flutter/lib/src/http/mojo_client.dart
@@ -58,7 +58,7 @@
   }
 
   Future<Uint8List> readBytes(url, {Map<String, String> headers}) {
-    return get(url, headers: headers).then((response) {
+    return get(url, headers: headers).then((Response response) {
       _checkResponseSuccess(url, response);
       return response.bodyBytes;
     });
diff --git a/packages/flutter_tools/lib/src/device.dart b/packages/flutter_tools/lib/src/device.dart
index 5637d96..d92cf96 100644
--- a/packages/flutter_tools/lib/src/device.dart
+++ b/packages/flutter_tools/lib/src/device.dart
@@ -533,16 +533,20 @@
   /// we don't have to rely on the test setup having adb available to it.
   static List<AndroidDevice> getAttachedDevices([AndroidDevice mockAndroid]) {
     List<AndroidDevice> devices = [];
-    String adbPath =
-        (mockAndroid != null) ? mockAndroid.adbPath : _getAdbPath();
-    List<String> output =
-        runSync([adbPath, 'devices', '-l']).trim().split('\n');
-    RegExp deviceInfo = new RegExp(
+    String adbPath = (mockAndroid != null) ? mockAndroid.adbPath : _getAdbPath();
+    List<String> output = runSync([adbPath, 'devices', '-l']).trim().split('\n');
+
+    // 015d172c98400a03       device usb:340787200X product:nakasi model:Nexus_7 device:grouper
+    RegExp deviceRegex1 = new RegExp(
         r'^(\S+)\s+device\s+\S+\s+product:(\S+)\s+model:(\S+)\s+device:(\S+)$');
+
+    // 0149947A0D01500C       device usb:340787200X
+    RegExp deviceRegex2 = new RegExp(r'^(\S+)\s+device\s+\S+$');
+
     // Skip first line, which is always 'List of devices attached'.
     for (String line in output.skip(1)) {
-      Match match = deviceInfo.firstMatch(line);
-      if (match != null) {
+      if (deviceRegex1.hasMatch(line)) {
+        Match match = deviceRegex1.firstMatch(line);
         String deviceID = match[1];
         String productID = match[2];
         String modelID = match[3];
@@ -552,7 +556,12 @@
             id: deviceID,
             productID: productID,
             modelID: modelID,
-            deviceCodeName: deviceCodeName));
+            deviceCodeName: deviceCodeName
+        ));
+      } else if (deviceRegex2.hasMatch(line)) {
+        Match match = deviceRegex2.firstMatch(line);
+        String deviceID = match[1];
+        devices.add(new AndroidDevice(id: deviceID));
       } else {
         _logging.warning('Unexpected failure parsing device information '
             'from adb output:\n$line\n'
@@ -676,9 +685,9 @@
         _logging.severe('Unexpected response from getprop: "$sdkVersion"');
         return false;
       }
-      if (sdkVersionParsed < 19) {
-        _logging.severe('Version "$sdkVersion" of the Android SDK is too old. '
-            'Please install Jelly Bean (version 19) or later.');
+      if (sdkVersionParsed < 16) {
+        _logging.severe('The Android version ($sdkVersion) on the target device '
+            'is too old. Please use a Jelly Bean (version 16 / 4.1.x) device or later.');
         return false;
       }
       return true;