[flutter_tools] prevent creation of android devices if adb is not located (#65184)

More work to prevent current #2 crash issue on stable. If adb is not located do not list/create android devices.
This commit is contained in:
Jonah Williams
2020-09-03 11:01:43 -07:00
committed by GitHub
parent 33c619c9ac
commit 08e3ed9e2d
3 changed files with 23 additions and 3 deletions

View File

@@ -58,13 +58,18 @@ class AndroidWorkflow implements Workflow {
bool get appliesToHostPlatform => _featureFlags.isAndroidEnabled;
@override
bool get canListDevices => _androidSdk != null && _androidSdk.adbPath != null;
bool get canListDevices => _androidSdk != null
&& _androidSdk.adbPath != null;
@override
bool get canLaunchDevices => _androidSdk != null && _androidSdk.validateSdkWellFormed().isEmpty;
bool get canLaunchDevices => _androidSdk != null
&& _androidSdk.adbPath != null
&& _androidSdk.validateSdkWellFormed().isEmpty;
@override
bool get canListEmulators => _androidSdk != null && _androidSdk.emulatorPath != null;
bool get canListEmulators => _androidSdk != null
&& _androidSdk.adbPath != null
&& _androidSdk.emulatorPath != null;
}
class AndroidValidator extends DoctorValidator {