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

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

Merge "Migrate initial set of flags to DeviceConfig."

parents 96b7aafd 1c086b48
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -17,10 +17,13 @@
package com.android.server;

import android.os.Handler;
import android.os.HandlerExecutor;
import android.os.HandlerThread;
import android.os.Looper;
import android.os.Trace;

import java.util.concurrent.Executor;

/**
 * Shared singleton background thread.
 *
@@ -31,6 +34,7 @@ public final class JobSchedulerBackgroundThread extends HandlerThread {
    private static final long SLOW_DELIVERY_THRESHOLD_MS = 30_000;
    private static JobSchedulerBackgroundThread sInstance;
    private static Handler sHandler;
    private static Executor sHandlerExecutor;

    private JobSchedulerBackgroundThread() {
        super("jobscheduler.bg", android.os.Process.THREAD_PRIORITY_BACKGROUND);
@@ -45,6 +49,7 @@ public final class JobSchedulerBackgroundThread extends HandlerThread {
            looper.setSlowLogThresholdMs(
                    SLOW_DISPATCH_THRESHOLD_MS, SLOW_DELIVERY_THRESHOLD_MS);
            sHandler = new Handler(sInstance.getLooper());
            sHandlerExecutor = new HandlerExecutor(sHandler);
        }
    }

@@ -63,4 +68,12 @@ public final class JobSchedulerBackgroundThread extends HandlerThread {
            return sHandler;
        }
    }

    /** Returns the singleton handler executor for JobSchedulerBackgroundThread */
    public static Executor getExecutor() {
        synchronized (JobSchedulerBackgroundThread.class) {
            ensureThreadLocked();
            return sHandlerExecutor;
        }
    }
}
+2 −2
Original line number Diff line number Diff line
@@ -166,7 +166,7 @@ class JobConcurrencyManager {
                // Note: we can't directly do postDelayed(this::rampUpForScreenOn), because
                // we need the exact same instance for removeCallbacks().
                mHandler.postDelayed(mRampUpForScreenOff,
                        mConstants.SCREEN_OFF_JOB_CONCURRENCY_INCREASE_DELAY_MS.getValue());
                        mConstants.SCREEN_OFF_JOB_CONCURRENCY_INCREASE_DELAY_MS);
            }
        }
    }
@@ -189,7 +189,7 @@ class JobConcurrencyManager {
            }
            final long now = JobSchedulerService.sElapsedRealtimeClock.millis();
            if ((mLastScreenOffRealtime
                    + mConstants.SCREEN_OFF_JOB_CONCURRENCY_INCREASE_DELAY_MS.getValue())
                    + mConstants.SCREEN_OFF_JOB_CONCURRENCY_INCREASE_DELAY_MS)
                    > now) {
                return;
            }
+220 −184

File changed.

Preview size limit exceeded, changes collapsed.

+1 −0
Original line number Diff line number Diff line
@@ -3240,6 +3240,7 @@ package android.provider {
    field public static final String NAMESPACE_AUTOFILL = "autofill";
    field public static final String NAMESPACE_BIOMETRICS = "biometrics";
    field public static final String NAMESPACE_CONTENT_CAPTURE = "content_capture";
    field public static final String NAMESPACE_JOB_SCHEDULER = "jobscheduler";
    field public static final String NAMESPACE_PERMISSIONS = "permissions";
    field public static final String NAMESPACE_PRIVACY = "privacy";
    field public static final String NAMESPACE_ROLLBACK = "rollback";
+7 −0
Original line number Diff line number Diff line
@@ -196,6 +196,13 @@ public final class DeviceConfig {
    public static final String NAMESPACE_INTELLIGENCE_CONTENT_SUGGESTIONS =
            "intelligence_content_suggestions";

    /**
     * Namespace for JobScheduler configurations.
     * @hide
     */
    @TestApi
    public static final String NAMESPACE_JOB_SCHEDULER = "jobscheduler";

    /**
     * Namespace for all media native related features.
     *
Loading