Commit 12419d6b authored by Jason Simmons's avatar Jason Simmons

Merge pull request #1446 from jason-simmons/app_process_restart

Add a --full-restart flag to the start command that controls whether …
parents b70a5380 0eb970f7
...@@ -251,7 +251,6 @@ class AndroidDevice extends Device { ...@@ -251,7 +251,6 @@ class AndroidDevice extends Device {
} }
bool startBundle(AndroidApk apk, String bundlePath, { bool startBundle(AndroidApk apk, String bundlePath, {
bool poke: false,
bool checked: true, bool checked: true,
bool traceStartup: false, bool traceStartup: false,
String route, String route,
...@@ -264,8 +263,7 @@ class AndroidDevice extends Device { ...@@ -264,8 +263,7 @@ class AndroidDevice extends Device {
return false; return false;
} }
if (!poke) _forwardObservatoryPort();
_forwardObservatoryPort();
if (clearLogs) if (clearLogs)
this.clearLogs(); this.clearLogs();
...@@ -276,6 +274,7 @@ class AndroidDevice extends Device { ...@@ -276,6 +274,7 @@ class AndroidDevice extends Device {
'shell', 'am', 'start', 'shell', 'am', 'start',
'-a', 'android.intent.action.RUN', '-a', 'android.intent.action.RUN',
'-d', deviceTmpPath, '-d', deviceTmpPath,
'-f', '0x20000000', // FLAG_ACTIVITY_SINGLE_TOP
]); ]);
if (checked) if (checked)
cmd.addAll(['--ez', 'enable-checked-mode', 'true']); cmd.addAll(['--ez', 'enable-checked-mode', 'true']);
...@@ -307,7 +306,6 @@ class AndroidDevice extends Device { ...@@ -307,7 +306,6 @@ class AndroidDevice extends Device {
if (startBundle( if (startBundle(
package, package,
buildResult.localBundlePath, buildResult.localBundlePath,
poke: platformArgs['poke'],
checked: checked, checked: checked,
traceStartup: platformArgs['trace-startup'], traceStartup: platformArgs['trace-startup'],
route: route, route: route,
......
...@@ -54,9 +54,9 @@ class StartCommand extends StartCommandBase { ...@@ -54,9 +54,9 @@ class StartCommand extends StartCommandBase {
'(defaults to checked/debug mode) (Android only).'; '(defaults to checked/debug mode) (Android only).';
StartCommand() { StartCommand() {
argParser.addFlag('poke', argParser.addFlag('full-restart',
negatable: false, defaultsTo: true,
help: 'Restart the connection to the server.'); help: 'Stop any currently running application process before starting the app.');
argParser.addFlag('clear-logs', argParser.addFlag('clear-logs',
defaultsTo: true, defaultsTo: true,
help: 'Clear log history before starting the app.'); help: 'Clear log history before starting the app.');
...@@ -71,21 +71,18 @@ class StartCommand extends StartCommandBase { ...@@ -71,21 +71,18 @@ class StartCommand extends StartCommandBase {
downloadApplicationPackagesAndConnectToDevices(), downloadApplicationPackagesAndConnectToDevices(),
], eagerError: true); ], eagerError: true);
bool poke = argResults['poke'];
bool clearLogs = argResults['clear-logs']; bool clearLogs = argResults['clear-logs'];
// Only stop and reinstall if the user did not specify a poke.
int result = await startApp( int result = await startApp(
devices, devices,
applicationPackages, applicationPackages,
toolchain, toolchain,
target: argResults['target'], target: argResults['target'],
install: !poke, install: true,
stop: !poke, stop: argResults['full-restart'],
checked: argResults['checked'], checked: argResults['checked'],
traceStartup: argResults['trace-startup'], traceStartup: argResults['trace-startup'],
route: argResults['route'], route: argResults['route'],
poke: poke,
clearLogs: clearLogs clearLogs: clearLogs
); );
...@@ -104,7 +101,6 @@ Future<int> startApp( ...@@ -104,7 +101,6 @@ Future<int> startApp(
bool checked: true, bool checked: true,
bool traceStartup: false, bool traceStartup: false,
String route, String route,
bool poke: false,
bool clearLogs: false bool clearLogs: false
}) async { }) async {
...@@ -138,8 +134,6 @@ Future<int> startApp( ...@@ -138,8 +134,6 @@ Future<int> startApp(
Map<String, dynamic> platformArgs = <String, dynamic>{}; Map<String, dynamic> platformArgs = <String, dynamic>{};
if (poke != null)
platformArgs['poke'] = poke;
if (traceStartup != null) if (traceStartup != null)
platformArgs['trace-startup'] = traceStartup; platformArgs['trace-startup'] = traceStartup;
if (clearLogs != null) if (clearLogs != null)
......
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