Loading services/core/java/com/android/server/am/AppRestrictionController.java +11 −5 Original line number Diff line number Diff line Loading @@ -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. Loading @@ -1446,6 +1447,7 @@ public final class AppRestrictionController { mRestrictionSettings.schedulePersistToXml(userId); } } } private void initSystemModuleNames() { final PackageManager pm = mInjector.getPackageManager(); Loading Loading @@ -2995,6 +2997,10 @@ public final class AppRestrictionController { @CurrentTimeMillisLong long currentTimeMillis() { return System.currentTimeMillis(); } boolean isTest() { return false; } } private void registerForSystemBroadcasts() { Loading services/tests/mockingservicestests/src/com/android/server/am/BackgroundRestrictionTest.java +5 −0 Original line number Diff line number Diff line Loading @@ -3056,6 +3056,11 @@ public final class BackgroundRestrictionTest { long currentTimeMillis() { return mCurrentTimeMillis; } @Override boolean isTest() { return true; } } private class TestBaseTrackerInjector<T extends BaseAppStatePolicy> Loading Loading
services/core/java/com/android/server/am/AppRestrictionController.java +11 −5 Original line number Diff line number Diff line Loading @@ -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. Loading @@ -1446,6 +1447,7 @@ public final class AppRestrictionController { mRestrictionSettings.schedulePersistToXml(userId); } } } private void initSystemModuleNames() { final PackageManager pm = mInjector.getPackageManager(); Loading Loading @@ -2995,6 +2997,10 @@ public final class AppRestrictionController { @CurrentTimeMillisLong long currentTimeMillis() { return System.currentTimeMillis(); } boolean isTest() { return false; } } private void registerForSystemBroadcasts() { Loading
services/tests/mockingservicestests/src/com/android/server/am/BackgroundRestrictionTest.java +5 −0 Original line number Diff line number Diff line Loading @@ -3056,6 +3056,11 @@ public final class BackgroundRestrictionTest { long currentTimeMillis() { return mCurrentTimeMillis; } @Override boolean isTest() { return true; } } private class TestBaseTrackerInjector<T extends BaseAppStatePolicy> Loading