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

Issue 2714463002: [android] Add JobScheduler-based BackgroundTaskScheduler. (Closed)

Created:
3 years, 10 months ago by nyquist
Modified:
3 years, 9 months ago
CC:
chromium-reviews, agrieve+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[android] Add JobScheduler-based BackgroundTaskScheduler. In Android M+ it is encouraged to use JobScheduler for all background jobs, instead of using things like IntentService or polling using alarms. Using the system API is beneficial as it has a full view of what goes on in the system and can schedule jobs accordingly. However, this functionality was introduced in Android L, and the API has been very stable since Android M. This means that we also need a similar framework for older versions of Android, which is provided by Google Play services. We prefer system APIs, since they do not require including external libraries which bloats the APK size of Chrome and adds unnecessary complexity. The GcmNetworkManager isonly used when the system API is not available. The background_task_scheduler component provides a new framework for use within chromium to schedule and execute background jobs using the frameworks available on a given version of Android. The public API of the framework is similar to that of the Android JobScheduler, but it is backed by either the system JobScheduler API or by GcmNetworkManager. What service is used to back the framework remains unknown to callers of the API. This first CL only adds support for the JobScheduler based backend. BUG=680757 Review-Url: https://codereview.chromium.org/2714463002 Cr-Commit-Position: refs/heads/master@{#453049} Committed: https://chromium.googlesource.com/chromium/src/+/8a9fdb7818cf338102a0c1c889d19da5f704399a

Patch Set 1 #

Patch Set 2 : Clean up background section of documentation #

Total comments: 49

Patch Set 3 : Addressed all comments. Added support for null-values for TaskInfo extras. Updated //chrome AndroidManifest.xml #

Patch Set 4 : Allow anyone to edit TaskIds.java and clean up OWNERS file #

Patch Set 5 : Make correct class public #

Patch Set 6 : FindBugs wants the real Pi, but I won't give it. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1684 lines, -0 lines) Patch
M chrome/android/BUILD.gn View 1 2 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/android/java/AndroidManifest.xml View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
A components/background_task_scheduler/BUILD.gn View 1 2 1 chunk +59 lines, -0 lines 0 comments Download
A components/background_task_scheduler/OWNERS View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
A components/background_task_scheduler/README.md View 1 2 1 chunk +163 lines, -0 lines 0 comments Download
A components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTask.java View 1 2 1 chunk +72 lines, -0 lines 0 comments Download
A components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskJobService.java View 1 2 3 4 1 chunk +104 lines, -0 lines 0 comments Download
A components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskScheduler.java View 1 2 1 chunk +91 lines, -0 lines 0 comments Download
A components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerDelegate.java View 1 2 1 chunk +33 lines, -0 lines 0 comments Download
A components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerFactory.java View 1 2 1 chunk +39 lines, -0 lines 0 comments Download
A components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerJobService.java View 1 2 3 4 1 chunk +159 lines, -0 lines 0 comments Download
A components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BundleToPersistableBundleConverter.java View 1 2 1 chunk +112 lines, -0 lines 0 comments Download
A components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/OWNERS View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
A components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/TaskIds.java View 1 2 1 chunk +15 lines, -0 lines 0 comments Download
A components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/TaskInfo.java View 1 2 1 chunk +529 lines, -0 lines 0 comments Download
A components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/TaskParameters.java View 1 chunk +61 lines, -0 lines 0 comments Download
A components/background_task_scheduler/android/javatests/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerJobServiceTest.java View 1 2 1 chunk +137 lines, -0 lines 0 comments Download
A components/background_task_scheduler/android/javatests/src/org/chromium/components/background_task_scheduler/BundleToPersistableBundleConverterTest.java View 1 2 3 4 5 1 chunk +95 lines, -0 lines 0 comments Download

Messages

Total messages: 32 (18 generated)
nyquist
dtrainor: Could you take an initial stab at this? It's quite a lot of JavaDoc ...
3 years, 10 months ago (2017-02-22 10:59:11 UTC) #4
nyquist
Apparently the background section of the documentation missed my last edits. Please use the following ...
3 years, 10 months ago (2017-02-22 11:08:06 UTC) #6
nyquist
https://codereview.chromium.org/2714463002/diff/20001/components/background_task_scheduler/BUILD.gn File components/background_task_scheduler/BUILD.gn (right): https://codereview.chromium.org/2714463002/diff/20001/components/background_task_scheduler/BUILD.gn#newcode38 components/background_task_scheduler/BUILD.gn:38: "//base:base_java", Self-review: Also add a new DEPS-file. https://codereview.chromium.org/2714463002/diff/20001/components/background_task_scheduler/README.md File ...
3 years, 10 months ago (2017-02-22 18:24:12 UTC) #11
David Trainor- moved to gerrit
lgtm! awesome :) https://codereview.chromium.org/2714463002/diff/20001/components/background_task_scheduler/BUILD.gn File components/background_task_scheduler/BUILD.gn (right): https://codereview.chromium.org/2714463002/diff/20001/components/background_task_scheduler/BUILD.gn#newcode44 components/background_task_scheduler/BUILD.gn:44: testonly = true blank line after ...
3 years, 10 months ago (2017-02-24 07:19:50 UTC) #12
Peter Beverloo
lgtm from the peanut gallery, thanks for doing this! https://codereview.chromium.org/2714463002/diff/20001/components/background_task_scheduler/README.md File components/background_task_scheduler/README.md (right): https://codereview.chromium.org/2714463002/diff/20001/components/background_task_scheduler/README.md#newcode117 components/background_task_scheduler/README.md:117: ...
3 years, 10 months ago (2017-02-24 18:07:14 UTC) #14
Peter Beverloo
https://codereview.chromium.org/2714463002/diff/20001/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskJobService.java File components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskJobService.java (right): https://codereview.chromium.org/2714463002/diff/20001/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskJobService.java#newcode20 components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskJobService.java:20: class BackgroundTaskJobService extends JobService { This must be a ...
3 years, 10 months ago (2017-02-24 19:43:49 UTC) #15
Peter Beverloo
https://codereview.chromium.org/2714463002/diff/20001/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BundleToPersistableBundleConverter.java File components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BundleToPersistableBundleConverter.java (right): https://codereview.chromium.org/2714463002/diff/20001/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BundleToPersistableBundleConverter.java#newcode102 components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BundleToPersistableBundleConverter.java:102: } else { This needs to be able to ...
3 years, 10 months ago (2017-02-24 20:29:44 UTC) #16
nyquist
jam: PTAL. This is the CL we talked about offline. https://codereview.chromium.org/2714463002/diff/20001/components/background_task_scheduler/BUILD.gn File components/background_task_scheduler/BUILD.gn (right): https://codereview.chromium.org/2714463002/diff/20001/components/background_task_scheduler/BUILD.gn#newcode38 ...
3 years, 10 months ago (2017-02-24 23:41:12 UTC) #18
jam
lgtm for new directory
3 years, 10 months ago (2017-02-24 23:46:10 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2714463002/80001
3 years, 10 months ago (2017-02-25 00:14:34 UTC) #22
commit-bot: I haz the power
Try jobs failed on following builders: android_clang_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_clang_dbg_recipe/builds/218523)
3 years, 10 months ago (2017-02-25 01:07:44 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2714463002/80001
3 years, 10 months ago (2017-02-25 01:20:03 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2714463002/100001
3 years, 10 months ago (2017-02-25 01:32:11 UTC) #29
commit-bot: I haz the power
3 years, 10 months ago (2017-02-25 02:36:03 UTC) #32
Message was sent while issue was closed.
Committed patchset #6 (id:100001) as
https://chromium.googlesource.com/chromium/src/+/8a9fdb7818cf338102a0c1c889d1...

Powered by Google App Engine
This is Rietveld 408576698