Switch many `Device` methods to be async (#9587)
`adb` can sometimes hang, which will in turn hang the Dart isolate if
we're using `Process.runSync()`. This changes many of the `Device` methods
to return `Future<T>` in order to allow them to use the async process
methods. A future change will add timeouts to the associated calls so
that we can properly alert the user to the hung `adb` process.
This is work towards #7102, #9567
diff --git a/packages/flutter_tools/test/src/mocks.dart b/packages/flutter_tools/test/src/mocks.dart
index 3fbc21d..6bd31ef 100644
--- a/packages/flutter_tools/test/src/mocks.dart
+++ b/packages/flutter_tools/test/src/mocks.dart
@@ -31,7 +31,7 @@
class MockAndroidDevice extends Mock implements AndroidDevice {
@override
- TargetPlatform get targetPlatform => TargetPlatform.android_arm;
+ Future<TargetPlatform> get targetPlatform async => TargetPlatform.android_arm;
@override
bool isSupported() => true;
@@ -39,7 +39,7 @@
class MockIOSDevice extends Mock implements IOSDevice {
@override
- TargetPlatform get targetPlatform => TargetPlatform.ios;
+ Future<TargetPlatform> get targetPlatform async => TargetPlatform.ios;
@override
bool isSupported() => true;
@@ -47,7 +47,7 @@
class MockIOSSimulator extends Mock implements IOSSimulator {
@override
- TargetPlatform get targetPlatform => TargetPlatform.ios;
+ Future<TargetPlatform> get targetPlatform async => TargetPlatform.ios;
@override
bool isSupported() => true;