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
6ff84d08
Commit
6ff84d08
authored
Apr 18, 2018
by
Danny Tuppeny
Committed by
Danny Tuppeny
May 09, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve formatting
parent
c0b2e783
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
android_emulator.dart
packages/flutter_tools/lib/src/android/android_emulator.dart
+14
-10
No files found.
packages/flutter_tools/lib/src/android/android_emulator.dart
View file @
6ff84d08
...
@@ -28,7 +28,7 @@ class AndroidEmulators extends EmulatorDiscovery {
...
@@ -28,7 +28,7 @@ class AndroidEmulators extends EmulatorDiscovery {
class
AndroidEmulator
extends
Emulator
{
class
AndroidEmulator
extends
Emulator
{
AndroidEmulator
(
String
id
,
[
this
.
_properties
])
AndroidEmulator
(
String
id
,
[
this
.
_properties
])
:
super
(
id
,
_properties
!=
null
&&
_properties
.
isNotEmpty
);
:
super
(
id
,
_properties
!=
null
&&
_properties
.
isNotEmpty
);
Map
<
String
,
String
>
_properties
;
Map
<
String
,
String
>
_properties
;
...
@@ -44,10 +44,12 @@ class AndroidEmulator extends Emulator {
...
@@ -44,10 +44,12 @@ class AndroidEmulator extends Emulator {
@override
@override
Future
<
bool
>
launch
()
async
{
Future
<
bool
>
launch
()
async
{
final
Status
status
=
logger
.
startProgress
(
'Launching
$id
...'
);
final
Status
status
=
logger
.
startProgress
(
'Launching
$id
...'
);
final
RunResult
launchResult
=
await
runAsync
(<
String
>[
getEmulatorPath
(),
'-avd'
,
id
]);
final
RunResult
launchResult
=
await
runAsync
(<
String
>[
getEmulatorPath
(),
'-avd'
,
id
]);
status
.
stop
();
status
.
stop
();
if
(
launchResult
.
exitCode
!=
0
)
{
if
(
launchResult
.
exitCode
!=
0
)
{
printError
(
'Error: emulator exited with exit code
${launchResult.exitCode}
'
);
printError
(
'Error: emulator exited with exit code
${launchResult.exitCode}
'
);
printError
(
'
$launchResult
'
);
printError
(
'
$launchResult
'
);
return
false
;
return
false
;
}
}
...
@@ -62,7 +64,7 @@ List<AndroidEmulator> getEmulatorAvds() {
...
@@ -62,7 +64,7 @@ List<AndroidEmulator> getEmulatorAvds() {
if
(
emulatorPath
==
null
)
{
if
(
emulatorPath
==
null
)
{
return
<
AndroidEmulator
>[];
return
<
AndroidEmulator
>[];
}
}
final
String
listAvdsOutput
=
runSync
(<
String
>[
emulatorPath
,
'-list-avds'
]);
final
String
listAvdsOutput
=
runSync
(<
String
>[
emulatorPath
,
'-list-avds'
]);
final
List
<
AndroidEmulator
>
emulators
=
<
AndroidEmulator
>[];
final
List
<
AndroidEmulator
>
emulators
=
<
AndroidEmulator
>[];
...
@@ -86,7 +88,8 @@ AndroidEmulator _createEmulator(String id) {
...
@@ -86,7 +88,8 @@ AndroidEmulator _createEmulator(String id) {
if
(
ini
[
'path'
]
!=
null
)
{
if
(
ini
[
'path'
]
!=
null
)
{
final
File
configFile
=
fs
.
file
(
fs
.
path
.
join
(
ini
[
'path'
],
'config.ini'
));
final
File
configFile
=
fs
.
file
(
fs
.
path
.
join
(
ini
[
'path'
],
'config.ini'
));
if
(
configFile
.
existsSync
())
{
if
(
configFile
.
existsSync
())
{
final
Map
<
String
,
String
>
properties
=
parseIniLines
(
configFile
.
readAsLinesSync
());
final
Map
<
String
,
String
>
properties
=
parseIniLines
(
configFile
.
readAsLinesSync
());
return
new
AndroidEmulator
(
id
,
properties
);
return
new
AndroidEmulator
(
id
,
properties
);
}
}
}
}
...
@@ -100,11 +103,12 @@ Map<String, String> parseIniLines(List<String> contents) {
...
@@ -100,11 +103,12 @@ Map<String, String> parseIniLines(List<String> contents) {
final
Iterable
<
List
<
String
>>
properties
=
contents
final
Iterable
<
List
<
String
>>
properties
=
contents
.
map
((
String
l
)
=>
l
.
trim
())
.
map
((
String
l
)
=>
l
.
trim
())
.
where
((
String
l
)
=>
// Strip blank lines/comments
l
!=
''
&&
!
l
.
startsWith
(
'#'
))
// Strip blank lines/comments
.
where
((
String
l
)
=>
l
!=
''
&&
!
l
.
startsWith
(
'#'
))
.
where
((
String
l
)
=>
// Discard anything that isn't simple name=value
l
.
contains
(
'='
))
// Discard anything that isn't simple name=value
.
where
((
String
l
)
=>
l
.
contains
(
'='
))
.
map
((
String
l
)
=>
l
.
split
(
'='
));
// Split into name/value
// Split into name/value
.
map
((
String
l
)
=>
l
.
split
(
'='
));
for
(
List
<
String
>
property
in
properties
)
{
for
(
List
<
String
>
property
in
properties
)
{
results
[
property
[
0
].
trim
()]
=
property
[
1
].
trim
();
results
[
property
[
0
].
trim
()]
=
property
[
1
].
trim
();
...
...
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