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

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

Merge "Reduce prefetch launch time threshold." into main

parents fdf40460 b08c7a6b
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -536,10 +536,13 @@ public class PrefetchController extends StateController {
        static final String KEY_LAUNCH_TIME_ALLOWANCE_MS =
                PC_CONSTANT_PREFIX + "launch_time_allowance_ms";

        private static final long DEFAULT_LAUNCH_TIME_THRESHOLD_MS = 7 * HOUR_IN_MILLIS;
        private static final long DEFAULT_LAUNCH_TIME_ALLOWANCE_MS = 20 * MINUTE_IN_MILLIS;
        private static final long DEFAULT_LAUNCH_TIME_THRESHOLD_MS = HOUR_IN_MILLIS;
        private static final long DEFAULT_LAUNCH_TIME_ALLOWANCE_MS = 30 * MINUTE_IN_MILLIS;

        /** How much time each app will have to run jobs within their standby bucket window. */
        /**
         * The earliest amount of time before the next estimated app launch time that we may choose
         * to run a prefetch job for the app.
         */
        public long LAUNCH_TIME_THRESHOLD_MS = DEFAULT_LAUNCH_TIME_THRESHOLD_MS;

        /**
+2 −0
Original line number Diff line number Diff line
@@ -160,6 +160,8 @@ public class PrefetchControllerTest {
        mPrefetchController = new PrefetchController(mJobSchedulerService);
        mPcConstants = mPrefetchController.getPcConstants();

        setDeviceConfigLong(PcConstants.KEY_LAUNCH_TIME_THRESHOLD_MS, 7 * HOUR_IN_MILLIS);

        setUidBias(Process.myUid(), JobInfo.BIAS_DEFAULT);

        verify(mUsageStatsManagerInternal)