History log of /frameworks/base/services/core/java/com/android/server/job/controllers/BackgroundJobsController.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
20afddd2ed37c2c9c0214b382cc3edd6d4ee81a8 01-Mar-2018 Christopher Tate <ctate@google.com> Jobs in 'active' apps are not subject to standby

Along the way we turn down the "app idle" tracking in the
jbo scheduler: it's now redundant with standby bookkeeping,
and was muddying the waters.

Bug: 74017233
Test: atest CtsJobSchedulerTestCases
Change-Id: I3220e6ef97f153b3f718e267a0dc4fbd3b926316
/frameworks/base/services/core/java/com/android/server/job/controllers/BackgroundJobsController.java
ac2e8efa4395d30ebeda5885dcb7cb679f793d4c 23-Feb-2018 Jeff Sharkey <jsharkey@android.com> Knobs for connectivity experiments.

We keep the sane default values of 50% through a job window for
delaying on congested networks and promoting prefetch jobs, but now
allow experiments to override these values.

There's only ever one of each controller, so just create it tied to
the JobSchedulerService that owns it. (People that need hooks for
testing can provide a mock JSS, instead of doing extra constructor
overloads.)

Use IndentingPrintWriter for dumping constants.

Test: bit FrameworksServicesTests:com.android.server.job.
Bug: 72353440, 73019091
Change-Id: Icdb40ee3b0bb22a20ed821888b42b87f33eb49ec
/frameworks/base/services/core/java/com/android/server/job/controllers/BackgroundJobsController.java
fee8c7b42aeebf3a11b978ee657803da0dfa8147 22-Feb-2018 Jeff Sharkey <jsharkey@android.com> Mechanical refactoring to improve job dumping.

First, JobStatusFunctor was really Consumer<JobStatus> before we
had the java.util.function APIs, so switch everyone over. Replace
most usages with lambdas; no additional runtime cost, since existing
code was already creating classes.

Move dump() to accept Predicate<JobStatus> for their filtering
behavior, enabling more future advanced filtering using any
attributes of JobStatus. Also move dump() to IndentingPrintWriter
to avoid passing around tedious prefix information. Makes it much
easier to print sane-looking output.

Add IndentingPrintWriter support for initial prefix values.

Test: manual dumpsys output looks sane
Bug: 73019091
Change-Id: I4c2398443b42dfb48135ab900d4331ff6d2bb5c4
/frameworks/base/services/core/java/com/android/server/job/controllers/BackgroundJobsController.java
01bb530242eea8ff32fa3e0db70cbb40951fce24 22-Feb-2018 Jeff Sharkey <jsharkey@android.com> More consistent controller logging.

Unify behind a single strategy that allows us to enable specific
controllers (or everything) via setprop for debugging.

Test: builds, boots
Bug: 73019091
Change-Id: I039a0b722c3da2c38d2ea64932b31281d85eab1a
/frameworks/base/services/core/java/com/android/server/job/controllers/BackgroundJobsController.java
e491821c5f28440a664bf880682953d8284ad4ee 06-Feb-2018 Makoto Onuki <omakoto@google.com> [3rd try] JobScheduler to use UID active state for job exemption

JobScheduler used to use procstate foreground state to decide whether
to exempt jobs, but it should use UID's active state instead, so that
if apps in the temp-whitelist schedule jobs, they run immediately.

Test: Boot
Test: atest CtsAlarmManagerTestCases
Test: atest CtsJobSchedulerTestCases
Test: atest CtsBatterySavingTestCases
Test: atest $ANDROID_BUILD_TOP/frameworks/base/services/tests/servicestests/src/com/android/server/AppStateTrackerTest.java

Bug: 72125364
Change-Id: I7a5628e76121199f3a5299e2a5576e1481574a6e
/frameworks/base/services/core/java/com/android/server/job/controllers/BackgroundJobsController.java
2f0b0310eef41c678bc8294585923e62a7fce508 08-Feb-2018 Makoto Onuki <omakoto@google.com> Revert "Retry: JobScheduler to use UID active state for job exemption"

This reverts commit 3f7be62d316cf366fabca64b718f17982c8f436d.

Reason for revert: I failed to unrevert it.

Change-Id: I086634236e140d3fe2f46dfff605fde548ab34f4
/frameworks/base/services/core/java/com/android/server/job/controllers/BackgroundJobsController.java
3f7be62d316cf366fabca64b718f17982c8f436d 07-Feb-2018 Makoto Onuki <omakoto@google.com> Retry: JobScheduler to use UID active state for job exemption

This is a second try for I134ac3d84a26309dab56ab6cbb271de626acdf7d.

Apparently alarms are firing even before PHASE_SYSTEM_SERVICES_READY, so add
more null checks.

Test: Boot on taimen.
Test: atest CtsAlarmManagerTestCases
Test: atest CtsJobSchedulerTestCases
Test: atest CtsBatterySavingTestCases
Test: atest $ANDROID_BUILD_TOP/frameworks/base/services/tests/servicestests/src/com/android/server/AppStateTrackerTest.java
Change-Id: I4b2a5af04e4d78c996e73da0621047da7a7bff39
/frameworks/base/services/core/java/com/android/server/job/controllers/BackgroundJobsController.java
0b053fecb6ac9945172b3df5d9f1690b777cf42b 07-Feb-2018 Artem Iglikov <artikz@google.com> Revert "JobScheduler to use UID active state for job exemption"

This reverts commit 6132e7bb1b428212a3a9d250a3dfebefc7894ea3.

Reason for revert: crashes master

Bug: 73049495
Change-Id: Idfd9a284163d26970b7cb89dea475d7c6abe0193
/frameworks/base/services/core/java/com/android/server/job/controllers/BackgroundJobsController.java
6132e7bb1b428212a3a9d250a3dfebefc7894ea3 06-Feb-2018 Makoto Onuki <omakoto@google.com> JobScheduler to use UID active state for job exemption

JobScheduler used to use procstate foreground state to decide whether
to exempt jobs, but it should use UID's active state instead, so that
if apps in the temp-whitelist schedule jobs, they run immediately.

Test: Boot
Test: atest CtsAlarmManagerTestCases
Test: atest CtsJobSchedulerTestCases
Test: atest CtsBatterySavingTestCases
Test: atest $ANDROID_BUILD_TOP/frameworks/base/services/tests/servicestests/src/com/android/server/AppStateTrackerTest.java

Change-Id: I134ac3d84a26309dab56ab6cbb271de626acdf7d
/frameworks/base/services/core/java/com/android/server/job/controllers/BackgroundJobsController.java
adb50d8c50f2ed071bc7d166dfa73ba408f5ec41 30-Jan-2018 Makoto Onuki <omakoto@google.com> While-idle alarm timeout & EBS

Use the long whileidle timeout for apps in the background.

Test: Manual test with a test app (I9d0c0ed4b6a0)
Test: atest $ANDROID_BUILD_TOP/frameworks/base/services/tests/servicestests/src/com/android/server/ForceAppStandbyTrackerTest.java
Test: atest $ANDROID_BUILD_TOP/cts/tests/tests/batterysaving/src/android/os/cts/batterysaving/BatterySaverAlarmTest.java
Bug: 72124522
Change-Id: Ibd0a46e573604f7f2d1ec51a60ea87c163233003
/frameworks/base/services/core/java/com/android/server/job/controllers/BackgroundJobsController.java
15407846682b269e6b7fd0c24b84f709257fab5d 19-Jan-2018 Makoto Onuki <omakoto@google.com> EBS: Exempt jobs scheduled for foreground apps

Jobs that are scheduled when the service app is in the foreground
(as opposed to the calling app being in the foreground) will be exempted
from EBS job throttling, *unless* they have time constraints.

Bug: 72125364
Test: Manual test with sync
Test: atest CtsBatterySavingTestCases
Test: atest $ANDROID_BUILD_TOP/frameworks/base/services/tests/servicestests/src/com/android/server/job/JobStoreTest.java
Test: atest $ANDROID_BUILD_TOP/frameworks/base/services/tests/servicestests/src/com/android/server/ForceAppStandbyTrackerTest.java
Change-Id: Ied7e24b0dbb104d5d7f95f853ab939cd9a403456
/frameworks/base/services/core/java/com/android/server/job/controllers/BackgroundJobsController.java
998fb4e80e2edad9baf5c07432442b6418e2674c 17-Jan-2018 Christopher Tate <ctate@google.com> Make sure to mutex around job-set iteration

If something mucks with the job set while we're iterating through
it, we're going to have a bad day.

Change-Id: I2e5603f4dd025b2e1819c7e84d59882bad98ae7a
Fixes: 72105511
Test: atest CtsJobSchedulerTestCases
Test: atest FrameworksServicesTests:com.android.server.job.BackgroundRestrictionsTest
/frameworks/base/services/core/java/com/android/server/job/controllers/BackgroundJobsController.java
85f2fbcb1fc3277ea825ec3dc52f636b47302425 18-Dec-2017 Kweku Adams <kwekua@google.com> incidentd: dumping jobscheduler to proto

Bug: 65750819
Test: flash device and check incident.proto output
Also test: $ cts-tradefed run cts-dev --module CtsIncidentHostTestCases --test com.android.server.cts.JobSchedulerIncidentTest
Change-Id: I4abc01ca893edcbaf4d2254e4f807e06f5cb91f8
/frameworks/base/services/core/java/com/android/server/job/controllers/BackgroundJobsController.java
2206af39a28e8ef9d242015f791dc8abb6c3b3cc 22-Nov-2017 Makoto Onuki <omakoto@google.com> Extreme battery saver: AlarmManager

- AlarmManagerService now uses ForceAppStandbyTracker.

- Now AlarmManagerService uses the system + user power-save whitelist,
rather than just the user whitelist.

Test: Manual test
Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/ForceAppStandbyTrackerTest.java
Bug 68769804

Change-Id: Ie2bd17fe0c3cb8b09ec4c4a78f9254277be16926
/frameworks/base/services/core/java/com/android/server/job/controllers/BackgroundJobsController.java
9be0140c1474dfd23d46121c51e636040a8080df 10-Nov-2017 Makoto Onuki <omakoto@google.com> Implement force-all-apps-standly in job scheduler.

Bug: 68769804
Test: Manual test

Change-Id: I70c28b7841165414cc8d27bf3466401c541d0569
/frameworks/base/services/core/java/com/android/server/job/controllers/BackgroundJobsController.java
a78acfddb063d1a023809fbad4d029abf67db2c3 14-Oct-2017 Suprabh Shukla <suprabh@google.com> Exempting tempwhitelist apps from doze

Adding doze exemptions for apps on the tempwhitelist. Any app on the
temporary whitelist can schedule jobs that will be exempt from doze
restrictions as long as the app is in the whitelist.

Test: cts-tradefed run cts-dev -m JobScheduler -t \
android.jobscheduler.cts.TempWhitelistTest

Bug: 64071030

Change-Id: I3846565d927014e73fd1badd34a57226cc788ef3
/frameworks/base/services/core/java/com/android/server/job/controllers/BackgroundJobsController.java
33ad04fec507efb546e2f94a783f88cedb787b5e 09-Sep-2017 Suprabh Shukla <suprabh@google.com> Unhiding Forced App Standby

Removing the runtime flag to enable the feature. Also fixed jobscheduler
to exempt apps in user power whitelist instead of full whitelist while
applying restrictions

Test: For Alarms:
cts-tradefed run cts-dev -m AlarmManagerTestCases
For Jobs:
adb install -r \
out/target/product/marlin/data/app/JobTestApp/JobTestApp.apk
adb install -r \
out/target/product/marlin/data/app/FrameworksServicesTests/FrameworksServicesTests.apk
adb shell am instrument -e class
'com.android.server.job.BackgroundRestrictionsTest' -w
'com.android.frameworks.servicestests'

Bug: 64387584
Change-Id: Ie1f12e6d5c07b7fa9eb2cc1b7c9a298d2074d3de
/frameworks/base/services/core/java/com/android/server/job/controllers/BackgroundJobsController.java
3ac1daac4044c70ad4ee673214074306de499a18 14-Jul-2017 Suprabh Shukla <suprabh@google.com> Restricting background apps from running jobs

Introducing a new app op which controls whether apps are allowed to run
jobs in the background. When the app op mode is set to ignored, jobs
will be delayed until the app is in the foreground. The same semantics
as background check for O apps will apply, which means power whitelisted
apps can still run jobs freely and apps will have some settle time after
going to background after which their jobs will be stopped.

Test:
Added AppOpsUpgradeTest for upgrading appops to inherit existing value of
OP_RUN_ANY_IN_BACKGROUND from OP_RUN_IN_BACKGROUND
Added backgroundRestrictionsTest for background jobs. To run the test:
mmm -j32 services/tests/servicestests/
adb install -r \
out/target/product/marlin/data/app/JobTestApp/JobTestApp.apk
adb install -r \
out/target/product/marlin/data/app/FrameworksServicesTests/FrameworksServicesTests.apk
adb shell am instrument -e class
'com.android.server.job.BackgroundRestrictionsTest' -w
'com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner'

Bug: 63001625
Change-Id: I6eb01adb6cd2c1d0e7be4f7eca960f57ad9581bf
/frameworks/base/services/core/java/com/android/server/job/controllers/BackgroundJobsController.java