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

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

Issue 2930553002: Add UMA metric to track the time elapsed since a WebAPK was last launched (Closed)
Patch Set: Merge branch 'master' into last_launched0 Created 3 years, 6 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 5ca863096b36d819eac0d67cdd363465992cb0c1..b236f45330f9fc9871f3a07d0ed9a1fbb82e9a8d 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
@@ -405,10 +405,23 @@ public class WebappActivity extends FullScreenActivity {
// app is not directly launched from the home screen, as this interferes
// with the heuristic.
if (mWebappInfo.isLaunchedFromHomescreen()) {
+ boolean previouslyLaunched = storage.hasBeenLaunched();
+ long previousUsageTimestamp = storage.getLastUsedTime();
+ storage.setHasBeenLaunched();
storage.updateLastUsedTime();
+ onUpdatedLastUsedTime(storage, previouslyLaunched, previousUsageTimestamp);
}
}
+ /**
+ * Called after updating the last used time in {@link WebappDataStorage}.
+ * @param previouslyLaunched Whether the webapp has been previously launched from the home
+ * screen.
+ * @param previousUsageTimestamp The previous time that the webapp was used.
+ */
+ protected void onUpdatedLastUsedTime(
+ WebappDataStorage storage, boolean previouslyLaunched, long previousUsageTimestamp) {}
+
protected void initializeSplashScreenWidgets(int backgroundColor, Bitmap splashImage) {
Bitmap displayIcon = splashImage == null ? mWebappInfo.icon() : splashImage;
int minimiumSizeThreshold = getResources().getDimensionPixelSize(

Powered by Google App Engine
This is Rietveld 408576698