Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
4112f663
Commit
4112f663
authored
Nov 08, 2015
by
Devon Carew
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #52 from devoncarew/older_android
support older android devices (>= 17)
parents
9bc6e686
3b9862a5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
12 deletions
+21
-12
mojo_client.dart
packages/flutter/lib/src/http/mojo_client.dart
+1
-1
device.dart
packages/flutter_tools/lib/src/device.dart
+20
-11
No files found.
packages/flutter/lib/src/http/mojo_client.dart
View file @
4112f663
...
@@ -58,7 +58,7 @@ class MojoClient {
...
@@ -58,7 +58,7 @@ class MojoClient {
}
}
Future
<
Uint8List
>
readBytes
(
url
,
{
Map
<
String
,
String
>
headers
})
{
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
);
_checkResponseSuccess
(
url
,
response
);
return
response
.
bodyBytes
;
return
response
.
bodyBytes
;
});
});
...
...
packages/flutter_tools/lib/src/device.dart
View file @
4112f663
...
@@ -533,16 +533,20 @@ class AndroidDevice extends Device {
...
@@ -533,16 +533,20 @@ class AndroidDevice extends Device {
/// we don't have to rely on the test setup having adb available to it.
/// we don't have to rely on the test setup having adb available to it.
static
List
<
AndroidDevice
>
getAttachedDevices
([
AndroidDevice
mockAndroid
])
{
static
List
<
AndroidDevice
>
getAttachedDevices
([
AndroidDevice
mockAndroid
])
{
List
<
AndroidDevice
>
devices
=
[];
List
<
AndroidDevice
>
devices
=
[];
String
adbPath
=
String
adbPath
=
(
mockAndroid
!=
null
)
?
mockAndroid
.
adbPath
:
_getAdbPath
();
(
mockAndroid
!=
null
)
?
mockAndroid
.
adbPath
:
_getAdbPath
(
);
List
<
String
>
output
=
runSync
([
adbPath
,
'devices'
,
'-l'
]).
trim
().
split
(
'
\n
'
);
List
<
String
>
output
=
runSync
([
adbPath
,
'devices'
,
'-l'
]).
trim
().
split
(
'
\n
'
);
// 015d172c98400a03 device usb:340787200X product:nakasi model:Nexus_7 device:grouper
RegExp
device
Info
=
new
RegExp
(
RegExp
device
Regex1
=
new
RegExp
(
r'^(\S+)\s+device\s+\S+\s+product:(\S+)\s+model:(\S+)\s+device:(\S+)$'
);
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'.
// Skip first line, which is always 'List of devices attached'.
for
(
String
line
in
output
.
skip
(
1
))
{
for
(
String
line
in
output
.
skip
(
1
))
{
Match
match
=
deviceInfo
.
firstMatch
(
line
);
if
(
deviceRegex1
.
hasMatch
(
line
))
{
if
(
match
!=
null
)
{
Match
match
=
deviceRegex1
.
firstMatch
(
line
);
String
deviceID
=
match
[
1
];
String
deviceID
=
match
[
1
];
String
productID
=
match
[
2
];
String
productID
=
match
[
2
];
String
modelID
=
match
[
3
];
String
modelID
=
match
[
3
];
...
@@ -552,7 +556,12 @@ class AndroidDevice extends Device {
...
@@ -552,7 +556,12 @@ class AndroidDevice extends Device {
id:
deviceID
,
id:
deviceID
,
productID:
productID
,
productID:
productID
,
modelID:
modelID
,
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
{
}
else
{
_logging
.
warning
(
'Unexpected failure parsing device information '
_logging
.
warning
(
'Unexpected failure parsing device information '
'from adb output:
\n
$line
\n
'
'from adb output:
\n
$line
\n
'
...
@@ -676,9 +685,9 @@ class AndroidDevice extends Device {
...
@@ -676,9 +685,9 @@ class AndroidDevice extends Device {
_logging
.
severe
(
'Unexpected response from getprop: "
$sdkVersion
"'
);
_logging
.
severe
(
'Unexpected response from getprop: "
$sdkVersion
"'
);
return
false
;
return
false
;
}
}
if
(
sdkVersionParsed
<
1
9
)
{
if
(
sdkVersionParsed
<
1
6
)
{
_logging
.
severe
(
'
Version "
$sdkVersion
" of the Android SDK is too old.
'
_logging
.
severe
(
'
The Android version (
$sdkVersion
) on the target device
'
'
Please install Jelly Bean (version 19)
or later.'
);
'
is too old. Please use a Jelly Bean (version 16 / 4.1.x) device
or later.'
);
return
false
;
return
false
;
}
}
return
true
;
return
true
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment