Merge "Don't load app restriction from saved files in test" into tm-dev
This commit is contained in:
@@ -1439,11 +1439,13 @@ public final class AppRestrictionController {
|
|||||||
refreshAppRestrictionLevelForUser(userId, REASON_MAIN_FORCED_BY_USER,
|
refreshAppRestrictionLevelForUser(userId, REASON_MAIN_FORCED_BY_USER,
|
||||||
REASON_SUB_FORCED_USER_FLAG_INTERACTION);
|
REASON_SUB_FORCED_USER_FLAG_INTERACTION);
|
||||||
}
|
}
|
||||||
// Load the previously saved levels and update the current levels if needed.
|
if (!mInjector.isTest()) {
|
||||||
mRestrictionSettings.scheduleLoadFromXml();
|
// Load the previously saved levels and update the current levels if needed.
|
||||||
// Also save the current levels right away.
|
mRestrictionSettings.scheduleLoadFromXml();
|
||||||
for (int userId : allUsers) {
|
// Also save the current levels right away.
|
||||||
mRestrictionSettings.schedulePersistToXml(userId);
|
for (int userId : allUsers) {
|
||||||
|
mRestrictionSettings.schedulePersistToXml(userId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2995,6 +2997,10 @@ public final class AppRestrictionController {
|
|||||||
@CurrentTimeMillisLong long currentTimeMillis() {
|
@CurrentTimeMillisLong long currentTimeMillis() {
|
||||||
return System.currentTimeMillis();
|
return System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean isTest() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerForSystemBroadcasts() {
|
private void registerForSystemBroadcasts() {
|
||||||
|
|||||||
@@ -3056,6 +3056,11 @@ public final class BackgroundRestrictionTest {
|
|||||||
long currentTimeMillis() {
|
long currentTimeMillis() {
|
||||||
return mCurrentTimeMillis;
|
return mCurrentTimeMillis;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
boolean isTest() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class TestBaseTrackerInjector<T extends BaseAppStatePolicy>
|
private class TestBaseTrackerInjector<T extends BaseAppStatePolicy>
|
||||||
|
|||||||
Reference in New Issue
Block a user