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
cc5d1adc
Commit
cc5d1adc
authored
May 13, 2016
by
Devon Carew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle an exit code from android n (#3914)
* handle an exit code from android n * review comments
parent
15decfca
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
7 deletions
+23
-7
android_device.dart
packages/flutter_tools/lib/src/android/android_device.dart
+10
-4
context.dart
packages/flutter_tools/lib/src/base/context.dart
+8
-2
daemon.dart
packages/flutter_tools/lib/src/commands/daemon.dart
+5
-1
No files found.
packages/flutter_tools/lib/src/android/android_device.dart
View file @
cc5d1adc
...
...
@@ -54,13 +54,19 @@ class AndroidDevice extends Device {
String
_getProperty
(
String
name
)
{
if
(
_properties
==
null
)
{
String
getpropOutput
=
runCheckedSync
(
adbCommandForDevice
(<
String
>[
'shell'
,
'getprop'
]));
RegExp
propertyExp
=
new
RegExp
(
r'\[(.*?)\]: \[(.*?)\]'
);
_properties
=
<
String
,
String
>{};
for
(
Match
m
in
propertyExp
.
allMatches
(
getpropOutput
))
{
_properties
[
m
.
group
(
1
)]
=
m
.
group
(
2
);
try
{
String
getpropOutput
=
runCheckedSync
(
adbCommandForDevice
(<
String
>[
'shell'
,
'getprop'
]));
RegExp
propertyExp
=
new
RegExp
(
r'\[(.*?)\]: \[(.*?)\]'
);
for
(
Match
m
in
propertyExp
.
allMatches
(
getpropOutput
))
_properties
[
m
.
group
(
1
)]
=
m
.
group
(
2
);
}
catch
(
error
,
trace
)
{
printError
(
'Error retrieving device properties:
$error
'
);
printTrace
(
trace
.
toString
());
}
}
return
_properties
[
name
];
}
...
...
packages/flutter_tools/lib/src/base/context.dart
View file @
cc5d1adc
...
...
@@ -6,6 +6,8 @@ import 'dart:async';
final
AppContext
_defaultContext
=
new
AppContext
();
typedef
void
ErrorHandler
(
dynamic
error
);
/// A singleton for application functionality. This singleton can be different
/// on a per-Zone basis.
AppContext
get
context
{
...
...
@@ -56,7 +58,11 @@ class AppContext {
}
}
dynamic
runInZone
(
dynamic
method
())
{
return
runZoned
(
method
,
zoneValues:
<
String
,
dynamic
>{
'context'
:
this
});
dynamic
runInZone
(
dynamic
method
(),
{
ErrorHandler
onError
})
{
return
runZoned
(
method
,
zoneValues:
<
String
,
dynamic
>{
'context'
:
this
},
onError:
onError
);
}
}
packages/flutter_tools/lib/src/commands/daemon.dart
View file @
cc5d1adc
...
...
@@ -64,7 +64,7 @@ class DaemonCommand extends FlutterCommand {
},
daemonCommand:
this
,
notifyingLogger:
notifyingLogger
);
return
daemon
.
onExit
;
});
}
,
onError:
_handleError
);
}
dynamic
_jsonEncodeObject
(
dynamic
object
)
{
...
...
@@ -72,6 +72,10 @@ class DaemonCommand extends FlutterCommand {
return
_deviceToMap
(
object
);
return
object
;
}
void
_handleError
(
dynamic
error
)
{
printError
(
'Error from flutter daemon:
$error
'
);
}
}
typedef
void
DispatchComand
(
Map
<
String
,
dynamic
>
command
);
...
...
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