Load reboot escrow data at PHASE_BOOT_COMPLETED

Users can't be unlocked before PHASE_BOOT_COMPLETED, as is documented
and enforced in UserController.java.  Therefore, fix
LockSettingsService#loadEscrowData() to run at PHASE_BOOT_COMPLETED
instead of at PHASE_ACTIVITY_MANAGER_READY.  This prevents
LockSettingsService from needing to use Gatekeeper earlier than is
normally the case, which made it more fragile to delays in Gatekeeper
coming up.  It might prevent other problems too.

Bug: 283055837
Test: atest ResumeOnRebootHostTest
Change-Id: I6707b6f33b37f940aecbbd9ec82455fa2a205e99
This commit is contained in:
Eric Biggers
2023-07-07 20:50:39 +00:00
parent cdd03b770a
commit 042cd5d928

View File

@@ -311,8 +311,9 @@ public class LockSettingsService extends ILockSettings.Stub {
super.onBootPhase(phase);
if (phase == PHASE_ACTIVITY_MANAGER_READY) {
mLockSettingsService.migrateOldDataAfterSystemReady();
mLockSettingsService.loadEscrowData();
mLockSettingsService.deleteRepairModePersistentDataIfNeeded();
} else if (phase == PHASE_BOOT_COMPLETED) {
mLockSettingsService.loadEscrowData();
}
}