Chromium Code Reviews| 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..53bb153842ecb7d0308508b194bb22a807a066d6 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); |
|
Peter Beverloo
2017/03/22 17:25:24
nit: why not inline this? It's just one extra call
awdf
2017/03/22 18:14:51
There's a school of thought that comments that exp
|
| 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.NOTIFICATION_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 |