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];
...
@@ -25,21 +25,20 @@ DeviceManager get deviceManager => context[DeviceManager];
/// A class to get all available devices.
/// A class to get all available devices.
class
DeviceManager
{
class
DeviceManager
{
/// Constructing DeviceManagers is cheap; they only do expensive work if some
/// Constructing DeviceManagers is cheap; they only do expensive work if some
/// of their methods are called.
/// of their methods are called.
DeviceManager
()
{
List
<
DeviceDiscovery
>
get
deviceDiscoverers
=>
_deviceDiscoverers
;
// Register the known discoverers.
final
List
<
DeviceDiscovery
>
_deviceDiscoverers
=
List
<
DeviceDiscovery
>.
unmodifiable
(<
DeviceDiscovery
>[
_deviceDiscoverers
.
add
(
AndroidDevices
());
AndroidDevices
(),
_deviceDiscoverers
.
add
(
IOSDevices
());
IOSDevices
(),
_deviceDiscoverers
.
add
(
IOSSimulators
());
IOSSimulators
(),
_deviceDiscoverers
.
add
(
FuchsiaDevices
());
FuchsiaDevices
(),
_deviceDiscoverers
.
add
(
FlutterTesterDevices
());
FlutterTesterDevices
(),
_deviceDiscoverers
.
add
(
MacOSDevices
());
MacOSDevices
(),
_deviceDiscoverers
.
add
(
LinuxDevices
());
LinuxDevices
(),
_deviceDiscoverers
.
add
(
WindowsDevices
());
WindowsDevices
(),
}
]);
final
List
<
DeviceDiscovery
>
_deviceDiscoverers
=
<
DeviceDiscovery
>[];
String
_specifiedDeviceId
;
String
_specifiedDeviceId
;
...
@@ -91,7 +90,7 @@ class DeviceManager {
...
@@ -91,7 +90,7 @@ class DeviceManager {
}
}
Iterable
<
DeviceDiscovery
>
get
_platformDiscoverers
{
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.
/// 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 {
...
@@ -179,6 +179,9 @@ class MockDeviceManager implements DeviceManager {
@override
@override
Future
<
List
<
String
>>
getDeviceDiagnostics
()
async
=>
<
String
>[];
Future
<
List
<
String
>>
getDeviceDiagnostics
()
async
=>
<
String
>[];
@override
List
<
DeviceDiscovery
>
get
deviceDiscoverers
=>
<
DeviceDiscovery
>[];
}
}
class
MockAndroidLicenseValidator
extends
AndroidLicenseValidator
{
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