Commit e6da16bb authored by Devon Carew's avatar Devon Carew Committed by GitHub

Handle release stop (#6493)

* implement app.stop() for release runs

* update comment
parent 0206a915
...@@ -11,14 +11,13 @@ import 'package:stack_trace/stack_trace.dart'; ...@@ -11,14 +11,13 @@ import 'package:stack_trace/stack_trace.dart';
import 'application_package.dart'; import 'application_package.dart';
import 'base/logger.dart'; import 'base/logger.dart';
import 'base/utils.dart'; import 'base/utils.dart';
import 'build_info.dart';
import 'commands/build_apk.dart'; import 'commands/build_apk.dart';
import 'commands/install.dart'; import 'commands/install.dart';
import 'commands/trace.dart'; import 'commands/trace.dart';
import 'device.dart'; import 'device.dart';
import 'globals.dart'; import 'globals.dart';
import 'vmservice.dart';
import 'resident_runner.dart'; import 'resident_runner.dart';
import 'vmservice.dart';
class RunAndStayResident extends ResidentRunner { class RunAndStayResident extends ResidentRunner {
RunAndStayResident( RunAndStayResident(
...@@ -199,8 +198,6 @@ class RunAndStayResident extends ResidentRunner { ...@@ -199,8 +198,6 @@ class RunAndStayResident extends ResidentRunner {
} }
printTrace('Application running.'); printTrace('Application running.');
if (debuggingOptions.buildMode == BuildMode.release)
return 0;
if (vmService != null) { if (vmService != null) {
await vmService.vm.refreshViews(); await vmService.vm.refreshViews();
...@@ -281,6 +278,13 @@ class RunAndStayResident extends ResidentRunner { ...@@ -281,6 +278,13 @@ class RunAndStayResident extends ResidentRunner {
printStatus('For a more detailed help message, press "h" or F1. To quit, press "q", F10, or Ctrl-C.'); printStatus('For a more detailed help message, press "h" or F1. To quit, press "q", F10, or Ctrl-C.');
} }
} }
@override
Future<Null> preStop() async {
// If we're running in release mode, stop the app using the device logic.
if (vmService == null)
await device.stopApp(_package);
}
} }
void writeRunBenchmarkFile(Stopwatch startTime, [Stopwatch restartTime]) { void writeRunBenchmarkFile(Stopwatch startTime, [Stopwatch restartTime]) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment