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
8e2ea263
Unverified
Commit
8e2ea263
authored
Feb 01, 2019
by
Jonah Williams
Committed by
GitHub
Feb 01, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the deviceDiscovery API overridable (#27378)
parent
030dc3fa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
14 deletions
+16
-14
device.dart
packages/flutter_tools/lib/src/device.dart
+13
-14
context.dart
packages/flutter_tools/test/src/context.dart
+3
-0
No files found.
packages/flutter_tools/lib/src/device.dart
View file @
8e2ea263
...
...
@@ -25,21 +25,20 @@ DeviceManager get deviceManager => context[DeviceManager];
/// A class to get all available devices.
class
DeviceManager
{
/// Constructing DeviceManagers is cheap; they only do expensive work if some
/// of their methods are called.
DeviceManager
()
{
// Register the known discoverers.
_deviceDiscoverers
.
add
(
AndroidDevices
());
_deviceDiscoverers
.
add
(
IOSDevices
());
_deviceDiscoverers
.
add
(
IOSSimulators
());
_deviceDiscoverers
.
add
(
FuchsiaDevices
());
_deviceDiscoverers
.
add
(
FlutterTesterDevices
());
_deviceDiscoverers
.
add
(
MacOSDevices
());
_deviceDiscoverers
.
add
(
LinuxDevices
());
_deviceDiscoverers
.
add
(
WindowsDevices
());
}
final
List
<
DeviceDiscovery
>
_deviceDiscoverers
=
<
DeviceDiscovery
>[];
List
<
DeviceDiscovery
>
get
deviceDiscoverers
=>
_deviceDiscoverers
;
final
List
<
DeviceDiscovery
>
_deviceDiscoverers
=
List
<
DeviceDiscovery
>.
unmodifiable
(<
DeviceDiscovery
>[
AndroidDevices
(),
IOSDevices
(),
IOSSimulators
(),
FuchsiaDevices
(),
FlutterTesterDevices
(),
MacOSDevices
(),
LinuxDevices
(),
WindowsDevices
(),
]);
String
_specifiedDeviceId
;
...
...
@@ -91,7 +90,7 @@ class DeviceManager {
}
Iterable
<
DeviceDiscovery
>
get
_platformDiscoverers
{
return
_
deviceDiscoverers
.
where
((
DeviceDiscovery
discoverer
)
=>
discoverer
.
supportsPlatform
);
return
deviceDiscoverers
.
where
((
DeviceDiscovery
discoverer
)
=>
discoverer
.
supportsPlatform
);
}
/// Return the list of all connected devices.
...
...
packages/flutter_tools/test/src/context.dart
View file @
8e2ea263
...
...
@@ -179,6 +179,9 @@ class MockDeviceManager implements DeviceManager {
@override
Future
<
List
<
String
>>
getDeviceDiagnostics
()
async
=>
<
String
>[];
@override
List
<
DeviceDiscovery
>
get
deviceDiscoverers
=>
<
DeviceDiscovery
>[];
}
class
MockAndroidLicenseValidator
extends
AndroidLicenseValidator
{
...
...
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