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

Commit 0793e0de authored by Kweku Adams's avatar Kweku Adams
Browse files

Enable RESTRICTED bucket.

Also reduce the minimum time delay to enter the bucket to 4 hours. The
current default remains 30 days.

Bug: 183103253
Test: atest AppStandbyControllerTests
Test: atest CtsJobSchedulerTestCases
Test: atest CtsUsageStatsTestCases:UsageStatsTest
Change-Id: I2171ad0b6fcad6c79b480582437fe1c0fd3df3b5
parent aa3477c5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -190,7 +190,7 @@ public class AppStandbyController
                    ONE_HOUR,
                    ONE_HOUR,
                    2 * ONE_HOUR,
                    4 * ONE_DAY
                    4 * ONE_HOUR
            };

    private static final int[] THRESHOLD_BUCKETS = {
+1 −1
Original line number Diff line number Diff line
@@ -12209,7 +12209,7 @@ public final class Settings {
         * @see #ENABLE_RESTRICTED_BUCKET
         * @hide
         */
        public static final int DEFAULT_ENABLE_RESTRICTED_BUCKET = 0;
        public static final int DEFAULT_ENABLE_RESTRICTED_BUCKET = 1;
        /**
         * Whether or not app auto restriction is enabled. When it is enabled, settings app will
+16 −1
Original line number Diff line number Diff line
@@ -916,7 +916,22 @@ public class AppStandbyControllerTests {
                .setLong("elapsed_threshold_restricted", -1);
        mInjector.mPropertiesChangedListener
                .onPropertiesChanged(mInjector.getDeviceConfigProperties());
        testTimeout();

        reportEvent(mController, USER_INTERACTION, 0, PACKAGE_1);
        mController.checkIdleStates(USER_ID);
        assertBucket(STANDBY_BUCKET_ACTIVE);

        mInjector.mElapsedRealtime = HOUR_MS;
        mController.checkIdleStates(USER_ID);
        assertBucket(STANDBY_BUCKET_FREQUENT);

        mInjector.mElapsedRealtime = 2 * HOUR_MS;
        mController.checkIdleStates(USER_ID);
        assertBucket(STANDBY_BUCKET_RARE);

        mInjector.mElapsedRealtime = 4 * HOUR_MS;
        mController.checkIdleStates(USER_ID);
        assertBucket(STANDBY_BUCKET_RESTRICTED);
    }

    /**