Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(354)

Unified Diff: shell/android/apk/src/org/chromium/mojo/shell/ShellService.java

Issue 1515543002: Close the shell when all activities are destroyed. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | shell/android/main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: shell/android/apk/src/org/chromium/mojo/shell/ShellService.java
diff --git a/shell/android/apk/src/org/chromium/mojo/shell/ShellService.java b/shell/android/apk/src/org/chromium/mojo/shell/ShellService.java
index 2f489fc1e5ba2cbe12bb6fb98c422d25b26847f2..c66906896ff5d3e7a7207404cf35da02ce42d1c3 100644
--- a/shell/android/apk/src/org/chromium/mojo/shell/ShellService.java
+++ b/shell/android/apk/src/org/chromium/mojo/shell/ShellService.java
@@ -154,6 +154,13 @@ public class ShellService extends Service {
}
String viewportId = rootIntent.getStringExtra("ViewportId");
NativeViewportSupportApplicationDelegate.viewportClosed(viewportId);
+
+ if (ApplicationStatus.getRunningActivities().size() == 0) {
+ // There are only background apps in the shell, so we close ourselves so we can cleanly
+ // restart. We may want to investigate how to keep backround apps and restart UI
+ // activities cleanly.
+ nativeQuitShell();
+ }
}
/**
@@ -321,4 +328,6 @@ public class ShellService extends Service {
private static native void nativeStartApplicationURL(String url);
private static native void nativeBindShell(int shellHandle);
+
+ private static native void nativeQuitShell();
}
« no previous file with comments | « no previous file | shell/android/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698