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
e9b935b0
Unverified
Commit
e9b935b0
authored
Feb 26, 2019
by
Jonah Williams
Committed by
GitHub
Feb 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use deviceManager discovery in daemon protocol (#28341)
parent
c9400889
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
27 deletions
+19
-27
daemon.dart
packages/flutter_tools/lib/src/commands/daemon.dart
+8
-23
device.dart
packages/flutter_tools/lib/src/device.dart
+11
-4
No files found.
packages/flutter_tools/lib/src/commands/daemon.dart
View file @
e9b935b0
...
...
@@ -6,7 +6,6 @@ import 'dart:async';
import
'package:meta/meta.dart'
;
import
'../android/android_device.dart'
;
import
'../base/common.dart'
;
import
'../base/context.dart'
;
import
'../base/file_system.dart'
;
...
...
@@ -17,22 +16,14 @@ import '../base/utils.dart';
import
'../build_info.dart'
;
import
'../cache.dart'
;
import
'../convert.dart'
;
import
'../desktop.dart'
;
import
'../device.dart'
;
import
'../emulator.dart'
;
import
'../fuchsia/fuchsia_device.dart'
;
import
'../globals.dart'
;
import
'../ios/devices.dart'
;
import
'../ios/simulators.dart'
;
import
'../linux/linux_device.dart'
;
import
'../macos/macos_device.dart'
;
import
'../resident_runner.dart'
;
import
'../run_cold.dart'
;
import
'../run_hot.dart'
;
import
'../runner/flutter_command.dart'
;
import
'../tester/flutter_tester.dart'
;
import
'../vmservice.dart'
;
import
'../windows/windows_device.dart'
;
const
String
protocolVersion
=
'0.4.2'
;
...
...
@@ -589,27 +580,21 @@ class DeviceDomain extends Domain {
registerHandler
(
'forward'
,
forward
);
registerHandler
(
'unforward'
,
unforward
);
addDeviceDiscoverer
(
FuchsiaDevices
());
addDeviceDiscoverer
(
AndroidDevices
());
addDeviceDiscoverer
(
IOSDevices
());
addDeviceDiscoverer
(
IOSSimulators
());
addDeviceDiscoverer
(
FlutterTesterDevices
());
if
(
flutterDesktopEnabled
)
{
addDeviceDiscoverer
(
MacOSDevices
());
addDeviceDiscoverer
(
LinuxDevices
());
addDeviceDiscoverer
(
WindowsDevices
());
}
// Use the device manager discovery so that client provided device types
// are usable via the daemon protocol.
deviceManager
.
deviceDiscoverers
.
forEach
(
addDeviceDiscoverer
);
}
void
addDeviceDiscoverer
(
Polling
DeviceDiscovery
discoverer
)
{
void
addDeviceDiscoverer
(
DeviceDiscovery
discoverer
)
{
if
(!
discoverer
.
supportsPlatform
)
return
;
_discoverers
.
add
(
discoverer
);
if
(
discoverer
is
PollingDeviceDiscovery
)
{
discoverer
.
onAdded
.
listen
(
_onDeviceEvent
(
'device.added'
));
discoverer
.
onRemoved
.
listen
(
_onDeviceEvent
(
'device.removed'
));
}
}
Future
<
void
>
_serializeDeviceEvents
=
Future
<
void
>.
value
();
...
...
packages/flutter_tools/lib/src/device.dart
View file @
e9b935b0
...
...
@@ -11,6 +11,7 @@ import 'base/context.dart';
import
'base/file_system.dart'
;
import
'base/utils.dart'
;
import
'build_info.dart'
;
import
'desktop.dart'
;
import
'fuchsia/fuchsia_device.dart'
;
import
'globals.dart'
;
...
...
@@ -35,10 +36,16 @@ class DeviceManager {
IOSSimulators
(),
FuchsiaDevices
(),
FlutterTesterDevices
(),
]
+
_conditionalDesktopDevices
);
/// Only add desktop devices if the flag is enabled.
static
List
<
DeviceDiscovery
>
get
_conditionalDesktopDevices
{
return
flutterDesktopEnabled
?
<
DeviceDiscovery
>[
MacOSDevices
(),
LinuxDevices
(),
WindowsDevices
(),
]);
]
:
<
DeviceDiscovery
>[];
}
String
_specifiedDeviceId
;
...
...
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