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

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

Merge "Enable RESTRICTED bucket." into sc-dev

parents 3bcbf195 0793e0de
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
@@ -13112,7 +13112,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
@@ -940,7 +940,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);
    }

    /**