[flutter_tools] android device stopApp handles null apk (#55990)
The resident runner does not check if the ApplicationPackage is null when trying to stop the app. Update AndroidDevice.stopApp to handle this case by returning false. The package will be null when flutter attach is used.
This commit is contained in:
@@ -647,6 +647,9 @@ class AndroidDevice extends Device {
|
||||
|
||||
@override
|
||||
Future<bool> stopApp(AndroidApk app) {
|
||||
if (app == null) {
|
||||
return Future<bool>.value(false);
|
||||
}
|
||||
final List<String> command = adbCommandForDevice(<String>['shell', 'am', 'force-stop', app.id]);
|
||||
return processUtils.stream(command).then<bool>(
|
||||
(int exitCode) => exitCode == 0 || allowHeapCorruptionOnWindows(exitCode));
|
||||
|
||||
Reference in New Issue
Block a user