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

Commit 76cb4a21 authored by Kweku Adams's avatar Kweku Adams Committed by Android (Google) Code Review
Browse files

Merge "Increase max job limit to 150." into sc-dev

parents 04c28ba4 19f512ef
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -59,6 +59,9 @@ 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.
+3 −5
Original line number Diff line number Diff line
@@ -147,10 +147,8 @@ public class JobSchedulerService extends com.android.server.SystemService

    /** The maximum number of concurrent jobs we run at one time. */
    static final int MAX_JOB_CONTEXTS_COUNT = 16;
    /** Enforce a per-app limit on scheduled jobs? */
    private static final boolean ENFORCE_MAX_JOBS = true;
    /** The maximum number of jobs that we allow an unprivileged app to schedule */
    private static final int MAX_JOBS_PER_APP = 100;
    /** The maximum number of jobs that we allow an app to schedule */
    private static final int MAX_JOBS_PER_APP = 150;
    /** The number of the most recently completed jobs to keep track of for debugging purposes. */
    private static final int NUM_COMPLETED_JOB_HISTORY = 20;

@@ -1011,7 +1009,7 @@ public class JobSchedulerService extends com.android.server.SystemService

            if (DEBUG) Slog.d(TAG, "SCHEDULE: " + jobStatus.toShortString());
            // Jobs on behalf of others don't apply to the per-app job cap
            if (ENFORCE_MAX_JOBS && packageName == null) {
            if (packageName == null) {
                if (mJobs.countJobsForUid(uId) > MAX_JOBS_PER_APP) {
                    Slog.w(TAG, "Too many jobs for uid " + uId);
                    throw new IllegalStateException("Apps may not schedule more than "