Shift EconomicPolicy setup to the handler thread.

Get the DeviceConfig values and set up the EconomicPolicies on the
handler thread to minimize boot time impact.

Bug: 242545579
Test: Android builds and boots up
Change-Id: If5da7ae6e321989e14a01532423e74808330e4e1
This commit is contained in:
Kweku Adams
2022-08-30 00:36:17 +00:00
parent b6fc109390
commit 0aaa579adf

View File

@@ -765,6 +765,7 @@ public class InternalResourceService extends SystemService {
return;
}
synchronized (mLock) {
mCompleteEconomicPolicy.setup(mConfigObserver.getAllDeviceConfigProperties());
loadInstalledPackageListLocked();
final boolean isFirstSetup = !mScribe.recordExists();
if (isFirstSetup) {
@@ -803,10 +804,7 @@ public class InternalResourceService extends SystemService {
if (mBootPhase < PHASE_THIRD_PARTY_APPS_CAN_START || !mIsEnabled) {
return;
}
synchronized (mLock) {
mHandler.post(this::setupHeavyWork);
mCompleteEconomicPolicy.setup(mConfigObserver.getAllDeviceConfigProperties());
}
mHandler.post(this::setupHeavyWork);
}
private void onBootPhaseBootCompleted() {