Postpone updating idle states to after the boot.

Bug: 161712793
Test: atest ./hostsidetests/net/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Change-Id: Ic22e1e7bf3356d523a37ca41a234aefc5d738ec5
This commit is contained in:
Sudheer Shanka
2020-07-20 11:39:51 -07:00
parent 83d5c830f2
commit 88338ff080

View File

@@ -487,9 +487,6 @@ public class AppStandbyController implements AppStandbyInternal {
mSystemServicesReady = true;
// Offload to handler thread to avoid boot time impact.
mHandler.post(AppStandbyController.this::updatePowerWhitelistCache);
boolean userFileExists;
synchronized (mAppIdleLock) {
userFileExists = mAppIdleHistory.userFileExists(UserHandle.USER_SYSTEM);
@@ -506,7 +503,9 @@ public class AppStandbyController implements AppStandbyInternal {
setChargingState(mInjector.isCharging());
// Offload to handler thread after boot completed to avoid boot time impact. This means
// that headless system apps may be put in a lower bucket until boot has completed.
// that app standby buckets may be slightly out of date and headless system apps may be
// put in a lower bucket until boot has completed.
mHandler.post(AppStandbyController.this::updatePowerWhitelistCache);
mHandler.post(this::loadHeadlessSystemAppCache);
}
}