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

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

Issue 2769713002: Android - UMA for notification click latency via NotificationJobService
Patch Set: Nits 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/NotificationJobService.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationJobService.java b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationJobService.java
index cf8de4f269637e4cff2201f44f66965b158a5344..61b0917f08624a6a89ac58d6eba8ee2f7aac9de1 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationJobService.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationJobService.java
@@ -11,6 +11,7 @@ import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.os.PersistableBundle;
+import android.os.SystemClock;
import org.chromium.base.ThreadUtils;
@@ -58,6 +59,7 @@ public class NotificationJobService extends JobService {
@Override
public boolean onStartJob(final JobParameters params) {
PersistableBundle extras = params.getExtras();
+ putJobStartedTimeInExtras(extras);
if (!extras.containsKey(NotificationConstants.EXTRA_NOTIFICATION_ID)
|| !extras.containsKey(NotificationConstants.EXTRA_NOTIFICATION_INFO_ORIGIN)
|| !extras.containsKey(NotificationConstants.EXTRA_NOTIFICATION_INFO_TAG)) {
@@ -76,6 +78,11 @@ public class NotificationJobService extends JobService {
return false;
}
+ private static void putJobStartedTimeInExtras(PersistableBundle extras) {
+ extras.putLong(
+ NotificationConstants.EXTRA_JOB_STARTED_TIME_MS, SystemClock.elapsedRealtime());
+ }
+
@Override
public boolean onStopJob(JobParameters params) {
// As it stands, all our job processing is done synchronously in onStartJob so there is

Powered by Google App Engine
This is Rietveld 408576698