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

Commit bbc4726a authored by Kweku Adams's avatar Kweku Adams
Browse files

Update JS documentation.

1. Clarify that EJs have the same network access as FGS
2. Clarify that jobFinished does not need to be called if onStopJob is called

Bug: 19536175
Bug: 171305774
Test: N/A
Change-Id: I72732c860c95ce6f4b8b8343b5b51dc49a917fee
parent 9b182c69
Loading
Loading
Loading
Loading
+1 −10
Original line number Diff line number Diff line
@@ -59,15 +59,6 @@ import java.util.Objects;
 * constraint on the JobInfo object that you are creating. Otherwise, the builder would throw an
 * exception when building. From Android version {@link Build.VERSION_CODES#Q} and onwards, it is
 * valid to schedule jobs with no constraints.
 * <p> Prior to Android version {@link Build.VERSION_CODES#S}, jobs could only have a maximum of 100
 * jobs scheduled at a time. Starting with Android version {@link Build.VERSION_CODES#S}, that limit
 * has been increased to 150. Expedited jobs also count towards the limit.
 * <p> In Android version {@link Build.VERSION_CODES#LOLLIPOP}, jobs had a maximum execution time
 * of one minute. Starting with Android version {@link Build.VERSION_CODES#M} and ending with
 * Android version {@link Build.VERSION_CODES#R}, jobs had a maximum execution time of 10 minutes.
 * Starting from Android version {@link Build.VERSION_CODES#S}, jobs will still be stopped after
 * 10 minutes if the system is busy or needs the resources, but if not, jobs may continue running
 * longer than 10 minutes.
 */
public class JobInfo implements Parcelable {
    private static String TAG = "JobInfo";
@@ -1471,7 +1462,7 @@ public class JobInfo implements Parcelable {
         * <ol>
         *     <li>Run as soon as possible</li>
         *     <li>Be less restricted during Doze and battery saver</li>
         *     <li>Have network access</li>
         *     <li>Have the same network access as foreground services</li>
         *     <li>Be less likely to be killed than regular jobs</li>
         *     <li>Be subject to background location throttling</li>
         * </ol>
+13 −0
Original line number Diff line number Diff line
@@ -57,6 +57,19 @@ import java.util.List;
 * {@link android.content.Context#getSystemService
 * Context.getSystemService(Context.JOB_SCHEDULER_SERVICE)}.
 *
 * <p> Prior to Android version {@link android.os.Build.VERSION_CODES#S}, jobs could only have
 * a maximum of 100 jobs scheduled at a time. Starting with Android version
 * {@link android.os.Build.VERSION_CODES#S}, that limit has been increased to 150.
 * Expedited jobs also count towards the limit.
 *
 * <p> In Android version {@link android.os.Build.VERSION_CODES#LOLLIPOP}, jobs had a maximum
 * execution time of one minute. Starting with Android version
 * {@link android.os.Build.VERSION_CODES#M} and ending with Android version
 * {@link android.os.Build.VERSION_CODES#R}, jobs had a maximum execution time of 10 minutes.
 * Starting from Android version {@link android.os.Build.VERSION_CODES#S}, jobs will still be
 * stopped after 10 minutes if the system is busy or needs the resources, but if not, jobs
 * may continue running longer than 10 minutes.
 *
 * <p class="caution"><strong>Note:</strong> Beginning with API 30
 * ({@link android.os.Build.VERSION_CODES#R}), JobScheduler will throttle runaway applications.
 * Calling {@link #schedule(JobInfo)} and other such methods with very high frequency can have a
+5 −2
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@ public abstract class JobService extends Service {
    /**
     * Call this to inform the JobScheduler that the job has finished its work.  When the
     * system receives this message, it releases the wakelock being held for the job.
     * This does not need to be called if {@link #onStopJob(JobParameters)} has been called.
     * <p>
     * You can request that the job be scheduled again by passing {@code true} as
     * the <code>wantsReschedule</code> parameter. This will apply back-off policy
@@ -135,6 +136,8 @@ public abstract class JobService extends Service {
    /**
     * This method is called if the system has determined that you must stop execution of your job
     * even before you've had a chance to call {@link #jobFinished(JobParameters, boolean)}.
     * Once this method is called, you no longer need to call
     * {@link #jobFinished(JobParameters, boolean)}.
     *
     * <p>This will happen if the requirements specified at schedule time are no longer met. For
     * example you may have requested WiFi with
@@ -144,8 +147,8 @@ public abstract class JobService extends Service {
     * idle maintenance window. You are solely responsible for the behavior of your application
     * upon receipt of this message; your app will likely start to misbehave if you ignore it.
     * <p>
     * Once this method returns, the system releases the wakelock that it is holding on
     * behalf of the job.</p>
     * Once this method returns (or times out), the system releases the wakelock that it is holding
     * on behalf of the job.</p>
     *
     * @param params The parameters identifying this job, as supplied to
     *               the job in the {@link #onStartJob(JobParameters)} callback.