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

Commit a4f04297 authored by Jing Ji's avatar Jing Ji Committed by Automerger Merge Worker
Browse files

Merge "Don't load app restriction from saved files in test" into tm-dev am:...

Merge "Don't load app restriction from saved files in test" into tm-dev am: a496007d am: ceff460f

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17547136



Change-Id: I71dd6e30ba40947d28e008e572cf252a34ef54ad
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents c0f4d32a ceff460f
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -1439,6 +1439,7 @@ public final class AppRestrictionController {
            refreshAppRestrictionLevelForUser(userId, REASON_MAIN_FORCED_BY_USER,
                    REASON_SUB_FORCED_USER_FLAG_INTERACTION);
        }
        if (!mInjector.isTest()) {
            // Load the previously saved levels and update the current levels if needed.
            mRestrictionSettings.scheduleLoadFromXml();
            // Also save the current levels right away.
@@ -1446,6 +1447,7 @@ public final class AppRestrictionController {
                mRestrictionSettings.schedulePersistToXml(userId);
            }
        }
    }

    private void initSystemModuleNames() {
        final PackageManager pm = mInjector.getPackageManager();
@@ -2995,6 +2997,10 @@ public final class AppRestrictionController {
        @CurrentTimeMillisLong long currentTimeMillis() {
            return System.currentTimeMillis();
        }

        boolean isTest() {
            return false;
        }
    }

    private void registerForSystemBroadcasts() {
+5 −0
Original line number Diff line number Diff line
@@ -3056,6 +3056,11 @@ public final class BackgroundRestrictionTest {
        long currentTimeMillis() {
            return mCurrentTimeMillis;
        }

        @Override
        boolean isTest() {
            return true;
        }
    }

    private class TestBaseTrackerInjector<T extends BaseAppStatePolicy>