Move target devices logic to its own classes and file (#121903)
Move target devices logic to its own classes and file
This commit is contained in:
committed by
GitHub
parent
2d1a5cdc95
commit
ee42a302ec
@@ -222,7 +222,9 @@ class FakeDeviceManager implements DeviceManager {
|
||||
String deviceId, {
|
||||
DeviceDiscoveryFilter? filter,
|
||||
}) async {
|
||||
return devices.where((Device device) => device.id == deviceId).toList();
|
||||
return devices.where((Device device) {
|
||||
return device.id == deviceId || device.id.startsWith(deviceId);
|
||||
}).toList();
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -245,15 +247,6 @@ class FakeDeviceManager implements DeviceManager {
|
||||
@override
|
||||
List<DeviceDiscovery> get deviceDiscoverers => <DeviceDiscovery>[];
|
||||
|
||||
@override
|
||||
Future<List<Device>> findTargetDevices({
|
||||
bool includeDevicesUnsupportedByProject = false,
|
||||
Duration? timeout,
|
||||
bool promptUserToChooseDevice = true,
|
||||
}) async {
|
||||
return devices;
|
||||
}
|
||||
|
||||
@override
|
||||
DeviceDiscoverySupportFilter deviceSupportFilter({
|
||||
bool includeDevicesUnsupportedByProject = false,
|
||||
@@ -261,6 +254,9 @@ class FakeDeviceManager implements DeviceManager {
|
||||
}) {
|
||||
return TestDeviceDiscoverySupportFilter();
|
||||
}
|
||||
|
||||
@override
|
||||
Device? getSingleEphemeralDevice(List<Device> devices) => null;
|
||||
}
|
||||
|
||||
class TestDeviceDiscoverySupportFilter extends Fake implements DeviceDiscoverySupportFilter {
|
||||
|
||||
Reference in New Issue
Block a user