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

Commit 27cec559 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Migrate QuotaController to DeviceConfig."

parents 6b8918ab 12fce993
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -339,6 +339,11 @@ public class JobSchedulerService extends com.android.server.SystemService
        public void onPropertiesChanged(DeviceConfig.Properties properties) {
            boolean apiQuotaScheduleUpdated = false;
            boolean concurrencyUpdated = false;
            for (int controller = 0; controller < mControllers.size(); controller++) {
                final StateController sc = mControllers.get(controller);
                sc.prepareForUpdatedConstantsLocked();
            }

            synchronized (mLock) {
                for (String name : properties.getKeyset()) {
                    if (name == null) {
@@ -384,6 +389,11 @@ public class JobSchedulerService extends com.android.server.SystemService
                                    && !concurrencyUpdated) {
                                mConstants.updateConcurrencyConstantsLocked();
                                concurrencyUpdated = true;
                            } else {
                                for (int ctrlr = 0; ctrlr < mControllers.size(); ctrlr++) {
                                    final StateController sc = mControllers.get(ctrlr);
                                    sc.processConstantLocked(properties, name);
                                }
                            }
                            break;
                    }
+5 −0
Original line number Diff line number Diff line
@@ -1388,6 +1388,11 @@ public final class JobStatus {
        }
        if (isReady()) {
            sb.append(" READY");
        } else {
            sb.append(" satisfied:0x").append(Integer.toHexString(satisfiedConstraints));
            sb.append(" unsatisfied:0x").append(Integer.toHexString(
                    (satisfiedConstraints & mRequiredConstraintsOfInterest)
                            ^ mRequiredConstraintsOfInterest));
        }
        sb.append("}");
        return sb.toString();
+371 −269

File changed.

Preview size limit exceeded, changes collapsed.

+9 −0
Original line number Diff line number Diff line
@@ -18,7 +18,9 @@ package com.android.server.job.controllers;

import static com.android.server.job.JobSchedulerService.DEBUG;

import android.annotation.NonNull;
import android.content.Context;
import android.provider.DeviceConfig;
import android.util.IndentingPrintWriter;
import android.util.Slog;
import android.util.proto.ProtoOutputStream;
@@ -84,6 +86,13 @@ public abstract class StateController {
    public void rescheduleForFailureLocked(JobStatus newJob, JobStatus failureToReschedule) {
    }

    /** Notice that updated configuration constants are about to be read. */
    public void prepareForUpdatedConstantsLocked() {}

    /** Process the specified constant and update internal constants if relevant. */
    public void processConstantLocked(@NonNull DeviceConfig.Properties properties,
            @NonNull String key) {}

    /**
     * Called when the JobScheduler.Constants are updated.
     */
+0 −15
Original line number Diff line number Diff line
@@ -11887,21 +11887,6 @@ public final class Settings {
         */
        public static final String POWER_MANAGER_CONSTANTS = "power_manager_constants";
        /**
         * Job scheduler QuotaController specific settings.
         * This is encoded as a key=value list, separated by commas. Ex:
         *
         * "max_job_count_working=5,max_job_count_rare=2"
         *
         * <p>
         * Type: string
         *
         * @hide
         * @see com.android.server.job.JobSchedulerService.Constants
         */
        public static final String JOB_SCHEDULER_QUOTA_CONTROLLER_CONSTANTS =
                "job_scheduler_quota_controller_constants";
        /**
         * ShortcutManager specific settings.
         * This is encoded as a key=value list, separated by commas. Ex:
Loading