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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java

Issue 2769713002: Android - UMA for notification click latency via NotificationJobService
Patch Set: Remove TODO Created 3 years, 9 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/notifications/NotificationPlatformBridge.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java
index 5bc1221c9ca81374c76449e1818badff75a434e6..d7c2c44cc90fcc940669aa96a250e15cfce5c7ad 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java
@@ -43,6 +43,7 @@ import org.chromium.webapk.lib.client.WebApkValidator;
import java.net.URI;
import java.net.URISyntaxException;
+import java.util.concurrent.TimeUnit;
import javax.annotation.Nullable;
@@ -175,6 +176,7 @@ public class NotificationPlatformBridge {
return false;
}
}
+ recordJobStartDelayUMA(intent);
String notificationId = intent.getStringExtra(NotificationConstants.EXTRA_NOTIFICATION_ID);
@@ -214,6 +216,16 @@ public class NotificationPlatformBridge {
return false;
}
+ private static void recordJobStartDelayUMA(Intent intent) {
+ long begin =
+ intent.getLongExtra(NotificationConstants.NOTIFICATION_JOB_SCHEDULED_TIME_MS, -1);
+ long end = intent.getLongExtra(NotificationConstants.NOTIFICATION_JOB_STARTED_TIME_MS, -1);
+ if (begin > 0 && end > 0) {
Peter Beverloo 2017/03/22 17:25:24 nit: I'd have a mild preference for checking w/ ha
awdf 2017/03/22 18:14:52 Done.
+ RecordHistogram.recordMediumTimesHistogram(
+ "Notifications.Android.JobStartDelay", end - begin, TimeUnit.MILLISECONDS);
+ }
+ }
+
@Nullable
static String getNotificationReply(Intent intent) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT_WATCH) {

Powered by Google App Engine
This is Rietveld 408576698