diff --git a/apex/jobscheduler/framework/java/android/app/job/JobInfo.java b/apex/jobscheduler/framework/java/android/app/job/JobInfo.java index f49cdbf403f09..ab0ac5aa88564 100644 --- a/apex/jobscheduler/framework/java/android/app/job/JobInfo.java +++ b/apex/jobscheduler/framework/java/android/app/job/JobInfo.java @@ -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. + *

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. *

* When your job executes in * {@link JobService#onStartJob(JobParameters)}, be sure to use the @@ -1742,6 +1745,7 @@ public class JobInfo implements Parcelable { *

  • Bypass Doze, app standby, and battery saver network restrictions
  • *
  • Be less likely to be killed than regular jobs
  • *
  • Be subject to background location throttling
  • + *
  • Be exempt from delay to optimize job execution
  • * * *

    diff --git a/apex/jobscheduler/framework/java/android/app/job/JobScheduler.java b/apex/jobscheduler/framework/java/android/app/job/JobScheduler.java index 632ecb2c03813..dfdb29091ad95 100644 --- a/apex/jobscheduler/framework/java/android/app/job/JobScheduler.java +++ b/apex/jobscheduler/framework/java/android/app/job/JobScheduler.java @@ -45,8 +45,23 @@ import java.util.List; *

    *

    * 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. + *

    + *

    + * 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. + *

    + * + * {@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)} + * *

    * 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