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

Commit f130a204 authored by Jing Ji's avatar Jing Ji
Browse files

Check the config before moving to restricted bucket on bg restriction

Bug: 221886417
Test: atest FrameworksMockingServicesTests:BackgroundRestrictionTest
Change-Id: I20602e9d6b4745d08857c30dcdcb4a7224a3a0e2
parent dc59b878
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1841,6 +1841,9 @@ public final class AppRestrictionController {
    }

    void handleUidInactive(int uid, boolean disabled) {
        if (!mConstantsObserver.mBgAutoRestrictedBucket) {
            return;
        }
        final ArrayList<Runnable> pendingTasks = mTmpRunnables;
        synchronized (mSettingsLock) {
            final int index = mActiveUids.indexOfKey(uid);
@@ -1863,6 +1866,9 @@ public final class AppRestrictionController {
    }

    void handleUidActive(int uid) {
        if (!mConstantsObserver.mBgAutoRestrictedBucket) {
            return;
        }
        synchronized (mSettingsLock) {
            final AppStandbyInternal appStandbyInternal = mInjector.getAppStandbyInternal();
            final int userId = UserHandle.getUserId(uid);