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

Commit a027d414 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Postpone headless app caching to after boot." into rvc-dev am: fd910278

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

Change-Id: I1155239b691c0fae8b4c52be7f272bdb1c620ae8
parents fddaab1e fd910278
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -463,9 +463,6 @@ public class AppStandbyController implements AppStandbyInternal {
                userFileExists = mAppIdleHistory.userFileExists(UserHandle.USER_SYSTEM);
                userFileExists = mAppIdleHistory.userFileExists(UserHandle.USER_SYSTEM);
            }
            }


            // Offload to handler thread to avoid boottime impact.
            mHandler.post(this::loadHeadlessSystemAppCache);

            if (mPendingInitializeDefaults || !userFileExists) {
            if (mPendingInitializeDefaults || !userFileExists) {
                initializeDefaultsForSystemApps(UserHandle.USER_SYSTEM);
                initializeDefaultsForSystemApps(UserHandle.USER_SYSTEM);
            }
            }
@@ -475,6 +472,10 @@ public class AppStandbyController implements AppStandbyInternal {
            }
            }
        } else if (phase == PHASE_BOOT_COMPLETED) {
        } else if (phase == PHASE_BOOT_COMPLETED) {
            setChargingState(mInjector.isCharging());
            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.
            mHandler.post(this::loadHeadlessSystemAppCache);
        }
        }
    }
    }