Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a90ae4b6 authored by alexbianchi's avatar alexbianchi Committed by Alex Bianchi
Browse files

Update JS and JobInfo docs about Flexible Job Constraints

Update developer documentation related to shifted job execution caused by FlexibityController.

Bug: 241788885
Test: Run `m offline-sdk-docs` and check page at out/target/common/docs/offline-sdk/reference/android/app/job/<X>.html
Change-Id: I51586916187f2b08be7e613eb4648db94dde4423
parent 1562909b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1312,6 +1312,9 @@ public class JobInfo implements Parcelable {
         * Calling this method will override any requirements previously defined
         * by {@link #setRequiredNetwork(NetworkRequest)}; you typically only
         * want to call one of these methods.
         * <p> Starting in Android version {@link android.os.Build.VERSION_CODES#UPSIDE_DOWN_CAKE},
         * {@link JobScheduler} may try to shift the execution of jobs requiring
         * {@link #NETWORK_TYPE_ANY} to when there is access to an un-metered network.
         * <p class="note">
         * When your job executes in
         * {@link JobService#onStartJob(JobParameters)}, be sure to use the
@@ -1742,6 +1745,7 @@ public class JobInfo implements Parcelable {
         *     <li>Bypass Doze, app standby, and battery saver network restrictions</li>
         *     <li>Be less likely to be killed than regular jobs</li>
         *     <li>Be subject to background location throttling</li>
         *     <li>Be exempt from delay to optimize job execution</li>
         * </ol>
         *
         * <p>
+16 −1
Original line number Diff line number Diff line
@@ -45,8 +45,23 @@ import java.util.List;
 * </p>
 * <p>
 * The framework will be intelligent about when it executes jobs, and attempt to batch
 * and defer them as much as possible. Typically if you don't specify a deadline on a job, it
 * and defer them as much as possible. Typically, if you don't specify a deadline on a job, it
 * can be run at any moment depending on the current state of the JobScheduler's internal queue.
 * </p>
 * <p>
 * Starting in Android version {@link android.os.Build.VERSION_CODES#UPSIDE_DOWN_CAKE},
 * JobScheduler may try to optimize job execution by shifting execution to times with more available
 * system resources in order to lower user impact. Factors in system health include sufficient
 * battery, idle, charging, and access to an un-metered network. Jobs will initially be treated as
 * if they have all these requirements, but as their deadlines approach, restrictions will become
 * less strict. Requested requirements will not be affected by this change.
 * </p>
 *
 * {@see android.app.job.JobInfo.Builder#setRequiresBatteryNotLow(boolean)}
 * {@see android.app.job.JobInfo.Builder#setRequiresDeviceIdle(boolean)}
 * {@see android.app.job.JobInfo.Builder#setRequiresCharging(boolean)}
 * {@see android.app.job.JobInfo.Builder#setRequiredNetworkType(int)}
 *
 * <p>
 * While a job is running, the system holds a wakelock on behalf of your app.  For this reason,
 * you do not need to take any action to guarantee that the device stays awake for the