History log of /frameworks/base/core/java/android/app/job/JobInfo.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
785f494e8752ca3bcffe1d648ecf05b0734df31c 14-Jul-2016 Jeff Sharkey <jsharkey@android.com> Require permission for FLAG_WILL_BE_FOREGROUND.

We caught scheduleAsPackage(), but not schedule(), oops.

Bug: 28998999
Change-Id: I0642c2265ff61eead8747cc6b4d0f852f1ca3ef2
/frameworks/base/core/java/android/app/job/JobInfo.java
121e1645d1396b47f0fefa978f8c77d2c4c6c968 22-Jun-2016 Dianne Hackborn <hackbod@google.com> Fix issue #29545190: JobScheduler ContentUri NOTIFY_FOR_DESCENDANTS flag...

...isn't respected if previous job was scheduled with same URI

Change-Id: Ib04f6d7cf72e7efc8e84c1a759e91ba520eda139
/frameworks/base/core/java/android/app/job/JobInfo.java
c43a7f89f7733bbaa440545eb472f1f8aa3b5d18 01-Jun-2016 Dianne Hackborn <hackbod@google.com> Fix issue #29058724: Improve JobScheduler API demo

We can now include it in the java docs!

Change-Id: I46b4f58e6220347e4f3f12139c9484d1b964c6a2
/frameworks/base/core/java/android/app/job/JobInfo.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/core/java/android/app/job/JobInfo.java
a9b4f3f628959eac8f853f1c87a93c5ed6530dec 18-May-2016 Christopher Tate <ctate@google.com> API feedback: rename JobInfo methods for clarity

Bug 28773330

Change-Id: I081fa225380a1966010d41020200fb3b9549a195
/frameworks/base/core/java/android/app/job/JobInfo.java
1b6519bd87a59a10e9928e5772a17976692611da 28-Apr-2016 Jeff Sharkey <jsharkey@android.com> Flag to mark foreground jobs, fix data saver.

When a job will eventually run in the foreground, the internal
scheduling needs to ignore any background network restrictions when
satisfying constraints. This also means the job should ignore the
current device doze state, since the requesting app could get the
same behavior by starting their own foreground service.

Always dispatch network policy changes to ConnectivityService first
to ensure that it has up-to-date information. Fix bugs around data
saver that were causing networks to not be marked as BLOCKED for
background apps; before this fix apps would have been spinning in
internal connectivity loops, thinking that the network was actually
connected when the kernel was actually blocking their traffic.

Offer new ConnectivityService method overloads to ignore the blocked
state for a specific UID.

Print unsatisfied job constraints to aid debugging.

Bug: 26571724
Change-Id: Iaaa17933e6dc1bf6d3dff26d0bfc12222e51e241
/frameworks/base/core/java/android/app/job/JobInfo.java
f07c7b9fd0a640bff4bf7690373613da217fe69b 22-Apr-2016 Jeff Sharkey <jsharkey@android.com> API changes for DownloadManager and JobScheduler.

To support moving DownloadManager, add new JobScheduler network type
constraint that matches "any network except roaming." Also add an
API to get a specific JobInfo by ID.

Since the default network can be different on a per-app basis, and
individual apps may be blocked due to app standby, evaluate job
connectivity constraints on a per-UID basis. To implement this
cleanly, add NetworkInfo.isMetered() to match the isRoaming() API.

Add new DownloadManager APIs to support charging and device idle
constraints, which are plumbed through to JobScheduler under the
hood when scheduled.

Add filtering to JobScheduler dumpsys to omit noisy details for
packages the caller isn't interested in.

Bug: 28098882, 26571724, 19821935
Change-Id: I09ca7184ef7ce6adba399f579d415a5fb2ea6110
/frameworks/base/core/java/android/app/job/JobInfo.java
bb9dd3c9fdef30ed4bf776fbf8cb74c7eed2e87e 21-Apr-2016 Dianne Hackborn <hackbod@google.com> Merge "Fix logspam by JobInfo" into nyc-dev
b0c83ec062016ae1b0abc05dc96576701cc6bfd3 21-Apr-2016 Shreyas Basarge <snb@google.com> Fix logspam by JobInfo

Print interval clamp message
only for periodic jobs having
period/flex less than the minimum value.

Bug: 28296128
Change-Id: Id0d7c3b56048582a490bb8214eca491ec2bbdc93
/frameworks/base/core/java/android/app/job/JobInfo.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/core/java/android/app/job/JobInfo.java
e3f617b23f202e11d4ee67d322609ee7b07b11bb 13-Apr-2016 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #28035090: Disallow abuse of JobScheduler" into nyc-dev
807de78c072c5a40be7b12c656d641d9e73741d2 08-Apr-2016 Dianne Hackborn <hackbod@google.com> Fix issue #28035090: Disallow abuse of JobScheduler

We now keep track of how long each app has been running a job
for, in 30 minute batches. If it is running jobs frequently,
we will bump down the priority its jobs run at to allow other
jobs to run before it.

Currently we count both pending and active as the job running,
which means that an app that has jobs waiting in the pending
queue will count against its abuse prevention. This could
allow starvation -- if we bump down the priority of an app's
jobs and the system is so busy continually that they sit
in the pending queue a lot -- it could never recover. But I
think that is okay... if we are really in a state where we
are continually running as many jobs as possible, we probably
have other larger issues.

Change-Id: I838aa4b5840e91df49a1e17b53188d6e4a66a6d1
/frameworks/base/core/java/android/app/job/JobInfo.java
9e6d588c934a71ef5937cec0a5e7b7490ac5ab3d 12-Apr-2016 Shreyas Basarge <snb@google.com> Documentation for flex field

Add documentation for getFlexMillis in JobInfo.

Bug: 27530396
Change-Id: I98319cd8ceb0ecd56ab3000bdd31d8bca1bacc3f
/frameworks/base/core/java/android/app/job/JobInfo.java
10be4e90341630883eb9af25ddf82702e2b3fb56 16-Mar-2016 Christopher Tate <ctate@google.com> Lower the minimum period for periodic jobs to 15 minutes

Also make the minimum flex & period available via method call
rather than as hardcoded API constants.

Bug 27619643

Change-Id: Ib4afa427e9b21e13085d245e45b05d70d99724d4
/frameworks/base/core/java/android/app/job/JobInfo.java
46499a50bf7e26c4009420aa0510432fcdc8e56e 10-Mar-2016 Dianne Hackborn <hackbod@google.com> Fix issue #27530395: API Review: JobInfo.Builder

Change-Id: I06ff55367ccf0cd3e522b7a3583c51a7345df4aa
/frameworks/base/core/java/android/app/job/JobInfo.java
970510b9c5299d480b3ec7f8403afd8265456f87 25-Feb-2016 Dianne Hackborn <hackbod@google.com> Work on issue #26390161: Throttle syncs/jobs when system is low on RAM

We now have a fixed array of job service contexts, which doesn't
vary by build configuration. Instead, we keep track of the maximum
number of concurrent jobs we want to allow to run, and don't
make use of a context if it would put us over that limit.

The available contexts is now 8 (the largest used to be 6), although
the maximum we will normally schedule is still 6. We have the other
two around only for use by the current foreground app, to allow it
to schedule work while the user is in it, even if we have reached
our normal limit on the number of concurrent jobs.

The maximum number of concurrent jobs varies based on the memory
state of the device, from 6 (if memory is normal) down to 1
(if memory is critical). We aren't yet trying to stop all jobs
if memory gets lower than critical.

Instead of just keeping track of whether a uid is in the foreground,
we now track whether it is the top as well. Only the top uid
can schedule additional jobs above the current limit.

Also improved some of the dumpsys output.

Change-Id: Icc95e42231a806f0bfa3e2f99ccc2b85cefac320
/frameworks/base/core/java/android/app/job/JobInfo.java
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/core/java/android/app/job/JobInfo.java
d8bf6b9feded2ad0fc1040254ccc9040dceb01a4 03-Feb-2016 Shreyas Basarge <snb@google.com> Add more logging to JobScheduler

Improves logging in perioidc job period clamping.
Added sourcePackage to dumpsys in JobScheduler.

Bug: 26874152
Change-Id: Iaccd6df3e70dfcae16e983893a708342fda637b3
/frameworks/base/core/java/android/app/job/JobInfo.java
e96c3b7eff5290f2a6c5e572babbfa8a3897be96 29-Jan-2016 Shreyas Basarge <snb@google.com> Updated Javadoc to reflect min period

Javadoc updated and logging added for
min period and min flex enforcements
in JobScheduler and SyncManager.

Bug: 26874152
Change-Id: Ifdd248b776a1bd04df21b7b9f0ac96bdef0f8bb6
/frameworks/base/core/java/android/app/job/JobInfo.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/core/java/android/app/job/JobInfo.java
17971e383f97db0d398b86ae537448605f70894e 15-Jan-2016 Shreyas Basarge <snb@google.com> Merge "Added priority to JobScheduler scheduling"
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/core/java/android/app/job/JobInfo.java
89ee618280ea05e193afab38f9d2bf99b8274a92 17-Dec-2015 Shreyas Basarge <snb@google.com> Flex time for periodic jobs in JobScheduler

A periodic job will start only within time
satisfying period - flex < time % period < period.

Bug: 26254850
Change-Id: I97a840446e5592e5151d784800855d909f1790b8
/frameworks/base/core/java/android/app/job/JobInfo.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/core/java/android/app/job/JobInfo.java
9ae3dbeefcd6bc139c74bfe3d51de823e3be4b4b 21-Aug-2014 Matthew Williams <mjwilliams@google.com> JobScheduler only run jobs for started users.

BUG: 12876556
Minor changes to test app to make persisting an option.
Change-Id: I1b40347878ec5ca44cd717ebfeb544f6c58473b5
/frameworks/base/core/java/android/app/job/JobInfo.java
bafeeb98135a7580cbcdd657818cd78f7bda35d8 08-Aug-2014 Matthew Williams <mjwilliams@google.com> JobScheduler needs to flush queue on charging

Also make it illegal to schedule a job with no constraints.
BUG: 16877705
Change-Id: Iae57286bc4f73163a7e3c9d2d531623fd50f1f72
/frameworks/base/core/java/android/app/job/JobInfo.java
ee410da42b6b8352213f03f7725fd041f703b035 25-Jul-2014 Matthew Williams <mjwilliams@google.com> remove possible JobScheduler race in cancel()

Client can jobFinished() before getting a cancel msg.
1) Do better clean up of JobServiceContext after client jobFinished()
to remove superfluous MSG_CANCELs
2) When processing MSG_CANCEL check whether the context is still active
3) Do JobServiceContext cleanup before calling back to JobSchedulerService
Client can get a cancel msg even after calling jobFinished() (opposite to above)
1) explicitly check whether there are any MSG_CALLBACKs in the queue before
processing a MSG_CANCEL. If there are we can throw away the cancel.

Bug: 16547638
Change-Id: I90644586c7895a9ce97de752a5d657faf7f74b78
/frameworks/base/core/java/android/app/job/JobInfo.java
900c67fc51fc2672458dd1c9641250f2ecc01a31 09-Jul-2014 Matthew Williams <mjwilliams@google.com> Add job persistance as a setter in the API

Bug: 15936795
Change-Id: I11e5a722bab5838dc151670256ed09dfaa7fdaa7
/frameworks/base/core/java/android/app/job/JobInfo.java
7060b04f6d92351b67222e636ab378a0273bf3e7 10-Jun-2014 Christopher Tate <ctate@google.com> Out with the old; in with the new

Switch to the official "JobScheduler" etc naming.

Bug 14997851

Change-Id: I73a61aaa9af0740c114d08188bd97c52f3ac86b7
/frameworks/base/core/java/android/app/job/JobInfo.java