diff options
| -rw-r--r-- | services/core/java/com/android/server/locksettings/LockSettingsService.java | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/services/core/java/com/android/server/locksettings/LockSettingsService.java b/services/core/java/com/android/server/locksettings/LockSettingsService.java index 09d0bc76466c..a550a15580aa 100644 --- a/services/core/java/com/android/server/locksettings/LockSettingsService.java +++ b/services/core/java/com/android/server/locksettings/LockSettingsService.java @@ -237,6 +237,10 @@ public class LockSettingsService extends ILockSettings.Stub { private static final String LSKF_LAST_CHANGED_TIME_KEY = "sp-handle-ts"; private static final String USER_SERIAL_NUMBER_KEY = "serial-number"; + private static final String MIGRATED_FRP2 = "migrated_frp2"; + private static final String MIGRATED_KEYSTORE_NS = "migrated_keystore_namespace"; + private static final String MIGRATED_SP_CE_ONLY = "migrated_all_users_to_sp_and_bound_ce"; + // Duration that LockSettingsService will store the gatekeeper password for. This allows // multiple biometric enrollments without prompting the user to enter their password via // ConfirmLockPassword/ConfirmLockPattern multiple times. This needs to be at least the duration @@ -903,14 +907,14 @@ public class LockSettingsService extends ILockSettings.Stub { } private void migrateOldData() { - if (getString("migrated_keystore_namespace", null, 0) == null) { + if (getString(MIGRATED_KEYSTORE_NS, null, 0) == null) { boolean success = true; synchronized (mSpManager) { success &= mSpManager.migrateKeyNamespace(); } success &= migrateProfileLockKeys(); if (success) { - setString("migrated_keystore_namespace", "true", 0); + setString(MIGRATED_KEYSTORE_NS, "true", 0); Slog.i(TAG, "Migrated keys to LSS namespace"); } else { Slog.w(TAG, "Failed to migrate keys to LSS namespace"); @@ -930,9 +934,9 @@ public class LockSettingsService extends ILockSettings.Stub { // "migrated_frp" to "migrated_frp2" to cause migrateFrpCredential() to run again on devices // where it had run before. if (LockPatternUtils.frpCredentialEnabled(mContext) - && !getBoolean("migrated_frp2", false, 0)) { + && !getBoolean(MIGRATED_FRP2, false, 0)) { migrateFrpCredential(); - setBoolean("migrated_frp2", true, 0); + setBoolean(MIGRATED_FRP2, true, 0); } } @@ -1012,14 +1016,14 @@ public class LockSettingsService extends ILockSettings.Stub { // If this gets interrupted (e.g. by the device powering off), there shouldn't be a // problem since this will run again on the next boot, and setUserKeyProtection() is // okay with the key being already protected by the given secret. - if (getString("migrated_all_users_to_sp_and_bound_ce", null, 0) == null) { + if (getString(MIGRATED_SP_CE_ONLY, null, 0) == null) { for (UserInfo user : mUserManager.getAliveUsers()) { removeStateForReusedUserIdIfNecessary(user.id, user.serialNumber); synchronized (mSpManager) { migrateUserToSpWithBoundCeKeyLocked(user.id); } } - setString("migrated_all_users_to_sp_and_bound_ce", "true", 0); + setString(MIGRATED_SP_CE_ONLY, "true", 0); } mThirdPartyAppsStarted = true; |