Use the Android JobScheduler to start our NotificationService |
|||||
Issue descriptionRight now we start the service directly from the BroadcastReceiver here: https://cs.chromium.org/chromium/src/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationService.java?dr&q=NotificationService&sq=package:chromium&l=40 but in future we should instead schedule a job to start the background service. From https://developer.android.com/topic/performance/scheduling.html#js : "If your app targets Android 5.0 (API level 21), you should use JobScheduler to execute background tasks." And further down on that page: "Use started services only as a last resort. The Android platform may not support started [background] services in the future."
,
Jan 11 2017
,
Jan 13 2017
,
Jan 25 2017
,
Jan 25 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/d54134355647e110b2d6793d2b257dceb4b706ed commit d54134355647e110b2d6793d2b257dceb4b706ed Author: awdf <awdf@chromium.org> Date: Wed Jan 25 19:03:58 2017 Android web notifications: Schedule job instead of starting service (N+) - Previously we always started a service when a web notification was clicked or dismissed. - Now we instead schedule a job to handle the notification intent on N+, since this is encouraged by Android. - We use the Android JobScheduler, rather than GcmNetworkManager or FirebaseJobDispatcher, since the JobScheduler allows us to execute immediately (hopefully). BUG= 663427 ,680816 Review-Url: https://codereview.chromium.org/2611333002 Cr-Commit-Position: refs/heads/master@{#446072} [modify] https://crrev.com/d54134355647e110b2d6793d2b257dceb4b706ed/chrome/android/java/AndroidManifest.xml [modify] https://crrev.com/d54134355647e110b2d6793d2b257dceb4b706ed/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationConstants.java [add] https://crrev.com/d54134355647e110b2d6793d2b257dceb4b706ed/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationJobService.java [modify] https://crrev.com/d54134355647e110b2d6793d2b257dceb4b706ed/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java [modify] https://crrev.com/d54134355647e110b2d6793d2b257dceb4b706ed/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationService.java [modify] https://crrev.com/d54134355647e110b2d6793d2b257dceb4b706ed/chrome/android/java_sources.gni
,
Jan 30 2017
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by awdf@chromium.org
, Jan 11 2017