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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java

Issue 2339623002: Fix WebAPK crashes on launch on Jellybean. (Closed)
Patch Set: Rebase Created 4 years, 3 months 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
Index: chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java
index 8c05554b17ddb2efcff02e144113a064821db857..dccd3ef7f67c2c394340100c6a9a48e195ff684f 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java
@@ -152,7 +152,7 @@ public class WebappActivity extends FullScreenActivity {
@Override
public void onStartWithNative() {
super.onStartWithNative();
- mDirectoryManager.cleanUpDirectories(this, getId());
+ mDirectoryManager.cleanUpDirectories(this, getActivityId());
}
@Override
@@ -500,8 +500,13 @@ public class WebappActivity extends FullScreenActivity {
// Intentionally do nothing as WebappActivity explicitly sets status bar color.
}
- /** Returns a unique identifier for this WebappActivity. */
- protected String getId() {
+ /**
+ * Returns a unique identifier for this WebappActivity.
+ * Note: do not call this function when you need {@link WebappInfo#id()}. Subclasses like
+ * WebappManagedActivity and WebApkManagedActivity overwrite this function and return the
+ * index of the activity.
+ */
+ protected String getActivityId() {
return mWebappInfo.id();
}
@@ -512,7 +517,7 @@ public class WebappActivity extends FullScreenActivity {
*/
@Override
protected final File getActivityDirectory() {
- return mDirectoryManager.getWebappDirectory(this, getId());
+ return mDirectoryManager.getWebappDirectory(this, getActivityId());
}
private void hideSplashScreen(final int reason) {

Powered by Google App Engine
This is Rietveld 408576698