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
4c1e4a24
Commit
4c1e4a24
authored
Sep 23, 2016
by
Devon Carew
Committed by
GitHub
Sep 23, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow daemon app launches to be more lenient about device ids (#6015)
parent
133a9c35
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletion
+20
-1
daemon.dart
packages/flutter_tools/lib/src/commands/daemon.dart
+20
-1
No files found.
packages/flutter_tools/lib/src/commands/daemon.dart
View file @
4c1e4a24
...
...
@@ -295,7 +295,7 @@ class AppDomain extends Domain {
String
target
=
_getStringArg
(
args
,
'target'
);
bool
hotMode
=
_getBoolArg
(
args
,
'hot'
)
??
false
;
Device
device
=
daemon
.
deviceDomain
.
_getDevice
(
deviceId
);
Device
device
=
daemon
.
deviceDomain
.
_get
OrLocate
Device
(
deviceId
);
if
(
device
==
null
)
throw
"device '
$deviceId
' not found"
;
...
...
@@ -536,6 +536,25 @@ class DeviceDomain extends Domain {
}).
toList
();
return
devices
.
firstWhere
((
Device
device
)
=>
device
.
id
==
deviceId
,
orElse:
()
=>
null
);
}
/// Return a known matching device, or scan for devices if no known match is found.
Device
_getOrLocateDevice
(
String
deviceId
)
{
// Look for an already known device.
Device
device
=
_getDevice
(
deviceId
);
if
(
device
!=
null
)
return
device
;
// Scan the different device providers for a match.
for
(
PollingDeviceDiscovery
discoverer
in
_discoverers
)
{
List
<
Device
>
devices
=
discoverer
.
pollingGetDevices
();
for
(
Device
device
in
devices
)
if
(
device
.
id
==
deviceId
)
return
device
;
}
// No match found.
return
null
;
}
}
Map
<
String
,
String
>
_deviceToMap
(
Device
device
)
{
...
...
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