History log of /frameworks/base/services/tests/servicestests/src/com/android/server/job/JobStoreTest.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
a06ec6a9435f9555142e700f54cf20278bc1982f 13-Feb-2017 Dianne Hackborn <hackbod@google.com> Add new job scheduler constraints for "battery not low".

Clean up the implementation of boolean constraints so that
they are in a single flags value that gets propagated all of
the way from JobInfo.Builder in to the JobStatus. Much simpler
and easier to add new constraints!

Also introduce some shell commands to make it easier to write
tests against the job scheduler (and other things tied to power).
One of the big things here is that there is a new sequence number
that propagates with battery updates, which we can look for in
the job scheduler to determine when a change the test has made
to battery state has actually gotten applied, to allow it to
safely and minimally wait until executing the condition being
tested.

Test: New BatteryConstraintTest suite added.

Change-Id: I11076d90b80ec25ee604c29b6a6dc2337fd867ce
/frameworks/base/services/tests/servicestests/src/com/android/server/job/JobStoreTest.java
fe60596ff1463f2440b0ca917ec5ad750272805d 24-Feb-2016 Dianne Hackborn <hackbod@google.com> Merge "Work towards issue #26390161: Throttle syncs/jobs when system is low on RAM" into nyc-dev am: 11007fa30c
am: f6461b288e

* commit 'f6461b288eec466bd82439f5b5bdfec28483bb68':
Work towards issue #26390161: Throttle syncs/jobs when system is low on RAM
1085ff6ee531931ef7f55cbadbc83616f619b292 24-Feb-2016 Dianne Hackborn <hackbod@google.com> Work towards issue #26390161: Throttle syncs/jobs when system is low on RAM

First, we need to make the job scheduler prioritize jobs for
foreground apps over background apps (so we will degrade well
when we are limiting the number of concurrent jobs).

So now the job scheduler keeps track of the process state of
each uid, and uses that to bump up the priority of jobs
associated with foreground uids. Added constants for priorities
since we have different places specifying priorities.

Also cleaned up a bit of the reporting of "wrapped" jobs from
the sync manager -- there is a new tag argument that can be supplied,
to have the name and tag used in various places be based on that
instead of the useless internal class name.

Change-Id: I8781750ddfac1472a98e1873fc38c014425db3d6
/frameworks/base/services/tests/servicestests/src/com/android/server/job/JobStoreTest.java
1d1beb4dcff5839f87c809be7d129c150fbbc94e 23-Feb-2016 Chris Tate <ctate@android.com> Merge "Limit scheduled jobs to 100 per app" into nyc-dev am: 3e30b118f7
am: 21a7ef469f

* commit '21a7ef469fe6cb4f6ed569f75f2ee36676bad9bb':
Limit scheduled jobs to 100 per app
2f36fd6fc94b62b8ccd03cdcea89826d05414f93 19-Feb-2016 Christopher Tate <ctate@google.com> Limit scheduled jobs to 100 per app

Packages that are entitled to schedule jobs on behalf of other uids
are not subject to the limit. Also break the JobStore's monolithic
set of jobs into per-uid slices for efficiency and orthogonality.

Bug 27150350

Change-Id: I8f5f718bf200d55f9977a6fc53b7f617e7652ad9
/frameworks/base/services/tests/servicestests/src/com/android/server/job/JobStoreTest.java
87c6da54b2710c7ea953aa8a743e7551ab9cbe43 20-Feb-2016 Ian Pedowitz <ijpedowitz@google.com> resolve merge conflicts of 2de058fcc9 to master

Change-Id: Ib6812ad2fc6402b2885ce81de8f7d892c07971e6
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/tests/servicestests/src/com/android/server/job/JobStoreTest.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/tests/servicestests/src/com/android/server/job/JobStoreTest.java
d506b2bad27835e701d4f6a9428124653efae72d 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: If026b7ef3a46a44f6802232474e629851a232a37
/frameworks/base/services/tests/servicestests/src/com/android/server/job/JobStoreTest.java
132c8298fa63d5d5ba7730fb8d11d967cec060a3 16-Feb-2016 Shreyas Basarge <snb@google.com> Merge "Fixes JobScheduler not persisting flex and sourcePackage" into nyc-dev am: b55fa08c74
am: a8a585e48c

* commit 'a8a585e48c6ab1aad543add047f6a5a1a822cc1b':
Fixes JobScheduler not persisting flex and sourcePackage
8e64e2e6a4d2964b6a4147f5cccd03de934c86cd 12-Feb-2016 Shreyas Basarge <snb@google.com> Fixes JobScheduler not persisting flex and sourcePackage

There was a bug with persisteing and restoring flex and
sourcePackage. Fixed it and added tests.

Change-Id: Ie8e4714b4727ecef4254773fd4339b28f4a47c01
/frameworks/base/services/tests/servicestests/src/com/android/server/job/JobStoreTest.java
ba60473a6539d16bef8720d79b5559512303bddf 11-Feb-2016 Dianne Hackborn <hackbod@google.com> Implement transient extras for jobs.

You can now associate an arbitrary Bundle of extras with a job,
as long as the job is not persisted.

Also implement deep-copy of Bundle.

Change-Id: I7890d627492b664d9b1f039e8cb82f8868de7be3
/frameworks/base/services/tests/servicestests/src/com/android/server/job/JobStoreTest.java
5db09084c8e4efc6311754243c39962fc8e7a766 07-Jan-2016 Shreyas Basarge <snb@google.com> Added priority to JobScheduler scheduling

Priority can be assigned to jobs. Higher priority
jobs can preempt lower priority ones. Reason for
calling onStopJob (timeout, preempt, etc.) is set
on the JobParameters object.

Reference:
https://docs.google.com/document/d/1fuVO5rBCkODx8wjk6uulFCP1Uzfx7IVsw2EyKKrGqVA

Change-Id: Ic36016514cec076984d44086316d8d00d896b3aa
/frameworks/base/services/tests/servicestests/src/com/android/server/job/JobStoreTest.java
7ef490fab68ee93f92eb5728cc4d3cb691315412 03-Dec-2015 Shreyas Basarge <snb@google.com> Fix for non persisted jobs being persisted

Bug: 25905179
Change-Id: I5e836f9894089aa8acc1bde382674e29402f0a60
/frameworks/base/services/tests/servicestests/src/com/android/server/job/JobStoreTest.java
fa8e5084eed63ab8d92c71fcff656690a30293c3 16-Oct-2015 Matthew Williams <mjwilliams@google.com> Sanity check loaded periodics and cap runtime.

BUG: 24900376
We've seen an issue where periodic run times can be massively
inflated after loading from disk.
As a safeguard, cap the period's loaded runtime to be [p, 2p]
from the time of loading.

Change-Id: Ie4464490c8d6702fee8efe9190c3da5dc5f013f6
/frameworks/base/services/tests/servicestests/src/com/android/server/job/JobStoreTest.java
48a30db75dd0eedf8e065c89825b2af86a381b62 23-Sep-2014 Matthew Williams <mjwilliams@google.com> Fix lock ordering in JobScheduler

BUG: 17625667
Two part clean-up.
1) Don't try to lock in onControllerStateChanged. Do it in the handleMessage
instead where the rest of the locking is. This is sufficient to fix this bug.
2) The other side of the deadlock came b/c we lock when cancelling and calling
stopTrackingJob. Controllers handle their own locking so this isn't
necessary. B/c of a potential race from the controller side, added an explicit
check for the JSS to only run an expired job if it still exists.

Change-Id: Iaeebbc19437eb5b73e3ced3168f1fc13e564a4be
/frameworks/base/services/tests/servicestests/src/com/android/server/job/JobStoreTest.java
d1c06753d045ad10e00e7aba53ee2adba0712ccc 22-Aug-2014 Matthew Williams <mjwilliams@google.com> Implement API review feedback for JobScheduler

BUG: 17005336

Took the opportunity to clean up some back-off logic

Change-Id: Ibc8ae34d1d44dd064ba071e4cbad17872f7e38cf
/frameworks/base/services/tests/servicestests/src/com/android/server/job/JobStoreTest.java
01ac45b6ff2334925c8d24b5278b44e5e30f5622 23-Jul-2014 Matthew Williams <mjwilliams@google.com> Fix JobScheduler race condition

The loading of jobs from disk is now done sychronously.

Bug: 16372824
Change-Id: Ica0592d6de51e89662c9e49ed1eb59209b64356c
/frameworks/base/services/tests/servicestests/src/com/android/server/job/JobStoreTest.java