History log of /frameworks/base/services/core/java/com/android/server/job/controllers/AppIdleController.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
7ab4025474d3ce80b00fbc96962a585f918a0be1 16-Jun-2016 Dianne Hackborn <hackbod@google.com> Fix issue #29371078: Foreground jobs should not count...

...as active for idle maintenance

Nor jobs of whitelisted apps.

Now they don't.

Also remove the no longer used "active download" tracking code.

Change-Id: I553197801f6eabaf15716f3201dd65257a0d4e94
/frameworks/base/services/core/java/com/android/server/job/controllers/AppIdleController.java
e9a988caca733d2f292991a52a0047685a69812f 28-May-2016 Dianne Hackborn <hackbod@google.com> Work on issue #28942589: Tune job scheduler

We now have a new settings key that provides all of the existing
tuning parameters, plus some newly redone ones for dealing with
different memory levels.

Changed the minimum batching for overall jobs from 2 to 1, so
we will never get in the way of immediately scheduling jobs
when the developer asks for this. We should now be able to rely
on the doze modes to do better batching of jobs for us when it
is really important.

Also work on issue #28981330: Excessive JobScheduler wakeup alarms.
Use a work source with scheduled alarms to blame them on the app
whose job they are being scheduled for, and add a check for whether
a job's timing constraint has been satisfied before considering it
a possible candidate for the next alarm. (If it is satisified,
the time is in the past, so we should not schedule an alarm for it.)

Finally clean up a bunch of the dumpsys output to make it easier
to understand.

Change-Id: I06cf2c1310448f47cf386f393e9b267335fabaeb
/frameworks/base/services/core/java/com/android/server/job/controllers/AppIdleController.java
ef3aa6ee53c5e4f1c50dd5a9b5821c54e449d4b3 30-Apr-2016 Dianne Hackborn <hackbod@google.com> Fix issue #28477006: Add small event log to job scheduler

Added. Also fixed dumpsys output when filtering, to apply the
filter to (almost) all of the output.

Change-Id: Iafb446599ad8fddbe8a766784deff618a6cfdbb7
/frameworks/base/services/core/java/com/android/server/job/controllers/AppIdleController.java
8db0fc15b85c6501a0418b17edee2d9c447b408a 12-Apr-2016 Dianne Hackborn <hackbod@google.com> More work on issue #26390151: Add new JobScheduler API...

...for monitoring content providers

We now have some delays before reporting URI changes, to allow
them to batch together.

Also clean up debug output, and fix some issues with how we
were managing the content observer state.

And while I am here, fix the device idle and app idle controllers
to no longer maintain their own list of jobs, but just directly
iterate over the JobStore.

Change-Id: If3fdff23c00c2f1b99901a9be096d851562d3439
/frameworks/base/services/core/java/com/android/server/job/controllers/AppIdleController.java
141f11c82a2dbf042833f75aeae6f028e8ae2084 06-Apr-2016 Dianne Hackborn <hackbod@google.com> More work on issue #26390151: Add new JobScheduler API...

...for monitoring content providers

- Improve media provider change reporting so that observers can
avoid spurious reports of the top-level content directory changing.
- Fix a bug where collected content changes while a job was running
were not being properly propagated to the next job.

Change-Id: I29e3c2960e6fec75b16ee3ee6588d47342bf8c75
/frameworks/base/services/core/java/com/android/server/job/controllers/AppIdleController.java
cb926fcec46b111d69059874d63c4cbebb5903c4 15-Mar-2016 Amith Yamasani <yamasani@google.com> Move device idle logic into a job StateController

Move most of device idle (doze) logic from JobSchedulerService
to DeviceIdleJobsController.

Allow whitelisted apps to run during device idle by adding
a new constraint DEVICE_NOT_DOZING. Using the word DOZE to
disambiguate from IDLE because the latter is used to mean
that the job wants to run in idle-maintenance period.

Bug: 26851107

Change-Id: I97f5286bd4d5ca18fbc46c2037c310fd369e18bf
/frameworks/base/services/core/java/com/android/server/job/controllers/AppIdleController.java
b0001f6fb1383d9824c2733896b0b348e7f77240 16-Feb-2016 Dianne Hackborn <hackbod@google.com> Remove internal locking from JobStatus.

Now all state of JobStatus is implicitly protected by the lock
of whoever is using it -- in this case the global lock for the
JobSchedulerService. This allows us to remove all of the atomic
variables and just replace those with a simple bit field.

The required constraints for a job are now statically defined
once a JobStatus is created, and don't change. (They wouldn't
change before, but now this is absolutely specified to be the
case.) This required tweaking the constructors a bit so that
the earliest and latest run times are computed as part of the
core class initialization.

Also clarified methods on StateController that are called with
the lock held, and took advantage of that in the various
controllers to not now redundantly re-acquire the lock.

Change-Id: I595c5e7d1bff1bd2ff906d612581af82878a25ee
/frameworks/base/services/core/java/com/android/server/job/controllers/AppIdleController.java
33d31c5b70c7d056e799e34bb6eccbe6939714ea 16-Feb-2016 Dianne Hackborn <hackbod@google.com> Simplify job scheduler service locking.

Unify all locks to just one lock protecting the entire service.
There is really no need for more complicated locking -- there is
nothing in the code that can take a long time to complete. And
having a single lock will allow various parts of the code to be
much simpler and easier to maintain.

This is just the first step of the change, switching all of the
locking to use one lock. With this done, we can now start
simplifying the code. For example, JobStatus no longer needs
to do any locking (or have atomic variables and such), it can
just rely on its callers holding the global service lock.

Change-Id: I502916ed7f2994b601750c67a59a96b1a4e95c6d
/frameworks/base/services/core/java/com/android/server/job/controllers/AppIdleController.java
1a30bd9b13fd127d9bbfdc5fd4cb2f80ab7ece21 11-Jan-2016 Dianne Hackborn <hackbod@google.com> Add and implement JobScheduler content observer APIs.

Allows one to schedule jobs to run when content URIs
change, and find out what changed when the job executes.

This required adding a new API to StateController to
tell it when we are about to start executing a job, so
we can transfer the currently collected changes out of
its internal state to fill it in to the JobParameters.

Also some additional dumpsys debug output to help
understand what is going on in the job scheduler.

Change-Id: I91f51b226ff4add7a271a8333beffa5e86c7bf18
/frameworks/base/services/core/java/com/android/server/job/controllers/AppIdleController.java
968ac75c2048214a28e9eac3d0e2e0d23776f887 12-Jan-2016 Shreyas Basarge <snb@google.com> Adds sourcePackageName field to JobStatus

Platform apps can schedule a job on behalf of
some other package. Battery stats and appIdleState
will be computed using sourcePackageName.

Change-Id: If52f6e1db3a563ef0854d1f59fbc6088a0c29ad1
/frameworks/base/services/core/java/com/android/server/job/controllers/AppIdleController.java
fcc95a6d2c749d6b77eca14bf301d665d858a840 02-Nov-2015 Dianne Hackborn <hackbod@google.com> Fix issue #25357209: Could not send SMS or MMS messages, had to reboot

I think what probably happened is that since we only report an app
going in to the "interaction" state as an interaction event to usage
stats, apps that sit around in that state forever will only see one
interaction at the start and never again. So usage stats could start
thinking they are idle.

Fix this by having the activity manager report an interaction event
for such long running applications at least once a day.

Also, because it is correct and for paranoia by protected us another
way, system uids should never go in to standby.

Change-Id: I8a3805bfca86cbe78560488a649ecd07427da99a
/frameworks/base/services/core/java/com/android/server/job/controllers/AppIdleController.java
8dca36dc8a5d17315775ce216689addc5bd9be00 19-Jun-2015 Xiaohui Chen <xiaohuic@google.com> system_server: optimize app idle parole state change

Currently when app idle parole state changes, all idle apps' states
are updated one by one including firewall modifications which are
very expensive. This optimization gets rid of individual firewall
rule changes and makes sure we only modify the firewall once at child
chain level.

BUG: 21446713
Change-Id: Iafc415fe0bc127826fe17894d4fedcf1755cb17d
/frameworks/base/services/core/java/com/android/server/job/controllers/AppIdleController.java
0dbb64d62737cef447b5d76f4c749df0b9dc7934 16-Apr-2015 Amith Yamasani <yamasani@google.com> Merge "Dump something for AppIdleController"
6bfe557743396e7f88d4047798e31604dacd1e1e 15-Apr-2015 Amith Yamasani <yamasani@google.com> Dump something for AppIdleController

Change-Id: I1b17b23b6e0e7c10933b154209f680e4723955eb
/frameworks/base/services/core/java/com/android/server/job/controllers/AppIdleController.java
1e38382b542f5cef9957a89692b02c55a3dd351c 10-Apr-2015 Dianne Hackborn <hackbod@google.com> Fixes to idle alarm scheduling, package importance.

- Add new API to ask the activity manager what the current
importance of a particular package name is (along with a few
new useful importance levels).

- Fix my last alarm manager change to actually execute the
alarms we have now decided should run even while we are idle.

Change-Id: I1f14712b4e390770d53b185c96a1b36f6aadd687
/frameworks/base/services/core/java/com/android/server/job/controllers/AppIdleController.java
55717a613c23fc6b05cab86c3b0de283a027e9f6 04-Apr-2015 Amith Yamasani <yamasani@google.com> Mark apps as not-idle at least once

On a fresh boot or update to M, mark existing apps
as being used if there is no existing entry in the
usage stats. On subsequent OTAs, make sure that at
least the new system apps are marked as used.

Reduce idle threshold to 1 day.

Bug: 20066058
Change-Id: I9a273c051d04432877bacd381c85bf6e721c1a85
/frameworks/base/services/core/java/com/android/server/job/controllers/AppIdleController.java
b0ff32245cb6b51e43dd3ee40b86d683c62de2b9 04-Mar-2015 Amith Yamasani <yamasani@google.com> Throttle jobs for idle apps

First pass at delaying jobs from apps that are idle.

TODO: Throttle syncs
TODO: Provide a periodic point at which apps are checked for idleness.

Apps that switch to foreground process state are tracked by UsageStats
as an INTERACTION event that affects the last-used timestamp.

JobScheduler's logic for when an app is ready is trumped by the idleness
of the app, and only if the battery is not charging. When charging state
changes, we update the idle state of all the tracked jobs.

android package is whitelisted.

Bug: 20066058
Change-Id: I0a0acb517b100a5c7b11e3f435f4141375f3451f
/frameworks/base/services/core/java/com/android/server/job/controllers/AppIdleController.java