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

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

Merge "Update batching logic." into main

parents ca0884b9 76c3b4f0
Loading
Loading
Loading
Loading
+14 −7
Original line number Diff line number Diff line
package: "com.android.server.job"

flag {
    name: "batch_active_bucket_jobs"
    namespace: "backstage_power"
    description: "Include jobs in the ACTIVE bucket in the job batching effort. Don't let them run as freely as they're ready."
    bug: "299329948"
}

flag {
    name: "batch_connectivity_jobs_per_network"
    namespace: "backstage_power"
    description: "Have JobScheduler attempt to delay the start of some connectivity jobs until there are several ready or the network is active"
    bug: "28382445"
}

flag {
    name: "do_not_force_rush_execution_at_boot"
    namespace: "backstage_power"
@@ -20,10 +34,3 @@ flag {
    description: "Throw an exception if an unsupported app uses JobInfo.setBias"
    bug: "300477393"
}

flag {
    name: "batch_jobs_on_network_activation"
    namespace: "backstage_power"
    description: "Have JobScheduler attempt to delay the start of some connectivity jobs until the network is actually active"
    bug: "318394184"
}
+0 −1
Original line number Diff line number Diff line
@@ -96,7 +96,6 @@ class JobConcurrencyManager {

    static final String CONFIG_KEY_PREFIX_CONCURRENCY = "concurrency_";
    private static final String KEY_CONCURRENCY_LIMIT = CONFIG_KEY_PREFIX_CONCURRENCY + "limit";
    @VisibleForTesting
    static final int DEFAULT_CONCURRENCY_LIMIT;

    static {
+336 −45

File changed.

Preview size limit exceeded, changes collapsed.

+6 −0
Original line number Diff line number Diff line
@@ -350,6 +350,12 @@ public final class JobSchedulerShellCommand extends BasicShellCommandHandler {
            case android.app.job.Flags.FLAG_JOB_DEBUG_INFO_APIS:
                pw.println(android.app.job.Flags.jobDebugInfoApis());
                break;
            case com.android.server.job.Flags.FLAG_BATCH_ACTIVE_BUCKET_JOBS:
                pw.println(com.android.server.job.Flags.batchActiveBucketJobs());
                break;
            case com.android.server.job.Flags.FLAG_BATCH_CONNECTIVITY_JOBS_PER_NETWORK:
                pw.println(com.android.server.job.Flags.batchConnectivityJobsPerNetwork());
                break;
            case com.android.server.job.Flags.FLAG_DO_NOT_FORCE_RUSH_EXECUTION_AT_BOOT:
                pw.println(com.android.server.job.Flags.doNotForceRushExecutionAtBoot());
                break;
+3 −2
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.server.job;

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.util.ArraySet;
import android.util.Pools;
import android.util.SparseArray;

@@ -96,10 +97,10 @@ class PendingJobQueue {
        }
    }

    void addAll(@NonNull List<JobStatus> jobs) {
    void addAll(@NonNull ArraySet<JobStatus> jobs) {
        final SparseArray<List<JobStatus>> jobsByUid = new SparseArray<>();
        for (int i = jobs.size() - 1; i >= 0; --i) {
            final JobStatus job = jobs.get(i);
            final JobStatus job = jobs.valueAt(i);
            List<JobStatus> appJobs = jobsByUid.get(job.getSourceUid());
            if (appJobs == null) {
                appJobs = new ArrayList<>();
Loading