Chromium Code Reviews| 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) { |