diff options
| author | 2025-01-02 10:28:29 -0800 | |
|---|---|---|
| committer | 2025-01-02 10:28:29 -0800 | |
| commit | c40e9a3dfdc0cdb9476eedd1986fca9b5df67164 (patch) | |
| tree | e320ce07ad206cd83ef5df23e91ef5028a4e7b7a | |
| parent | b14e715bc444eeb8001ace0f719a515843168e89 (diff) | |
| parent | 04f3cc7f778832171e8c8d12d4564b3a45132d4f (diff) | |
Merge "Handle PHASE_BOOT_COMPLETED asynchronously in LockSettingsService" into main
| -rw-r--r-- | services/core/java/com/android/server/locksettings/LockSettingsService.java | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/services/core/java/com/android/server/locksettings/LockSettingsService.java b/services/core/java/com/android/server/locksettings/LockSettingsService.java index c314ab06fbad..3f915757f137 100644 --- a/services/core/java/com/android/server/locksettings/LockSettingsService.java +++ b/services/core/java/com/android/server/locksettings/LockSettingsService.java @@ -369,16 +369,7 @@ public class LockSettingsService extends ILockSettings.Stub { @Override public void onBootPhase(int phase) { super.onBootPhase(phase); - if (phase == PHASE_ACTIVITY_MANAGER_READY) { - mLockSettingsService.migrateOldDataAfterSystemReady(); - mLockSettingsService.deleteRepairModePersistentDataIfNeeded(); - } else if (phase == PHASE_BOOT_COMPLETED) { - // In the case of an upgrade, PHASE_BOOT_COMPLETED means that a rollback to the old - // build can no longer occur. This is the time to destroy any migrated protectors. - mLockSettingsService.destroyMigratedProtectors(); - - mLockSettingsService.loadEscrowData(); - } + mLockSettingsService.onBootPhase(phase); } @Override @@ -397,6 +388,21 @@ public class LockSettingsService extends ILockSettings.Stub { } } + private void onBootPhase(int phase) { + if (phase == SystemService.PHASE_ACTIVITY_MANAGER_READY) { + migrateOldDataAfterSystemReady(); + deleteRepairModePersistentDataIfNeeded(); + } else if (phase == SystemService.PHASE_BOOT_COMPLETED) { + mHandler.post(() -> { + // In the case of an upgrade, PHASE_BOOT_COMPLETED means that a rollback to the old + // build can no longer occur. This is the time to destroy any migrated protectors. + destroyMigratedProtectors(); + + loadEscrowData(); + }); + } + } + @VisibleForTesting protected static class SynchronizedStrongAuthTracker extends LockPatternUtils.StrongAuthTracker { |