diff options
| author | 2024-09-09 17:27:55 +0000 | |
|---|---|---|
| committer | 2024-09-09 17:27:55 +0000 | |
| commit | e2b0e7f97811bf01a18af02c48d36f242ad3f94e (patch) | |
| tree | 83f6594b75afd608ee33b7cbddf2626cb8811a51 | |
| parent | db84555f90bcfa0ee77e6e785a05f08c8b924564 (diff) | |
| parent | 7394d4a545465d1aa9de01dfe5817b2cb094cab7 (diff) | |
Merge "Always call tieProfileLockIfNecessary() under mSpManager lock" into main am: daa8f946b7 am: 7394d4a545
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/3250397
Change-Id: Ib1c163ca8ae24065cfb4fabffe8b952424e6e42c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | core/java/android/app/admin/flags/flags.aconfig | 10 | ||||
| -rw-r--r-- | services/core/java/com/android/server/locksettings/LockSettingsService.java | 18 | 
2 files changed, 25 insertions, 3 deletions
diff --git a/core/java/android/app/admin/flags/flags.aconfig b/core/java/android/app/admin/flags/flags.aconfig index 8e08a95dad70..081dfe60d28c 100644 --- a/core/java/android/app/admin/flags/flags.aconfig +++ b/core/java/android/app/admin/flags/flags.aconfig @@ -152,6 +152,16 @@ flag {  }  flag { +  name: "fix_race_condition_in_tie_profile_lock" +  namespace: "enterprise" +  description: "Fix race condition in tieProfileLockIfNecessary()" +  bug: "355905501" +  metadata { +    purpose: PURPOSE_BUGFIX +  } +} + +flag {    name: "quiet_mode_credential_bug_fix"    namespace: "enterprise"    description: "Guards a bugfix that ends the credential input flow if the managed user has not stopped." diff --git a/services/core/java/com/android/server/locksettings/LockSettingsService.java b/services/core/java/com/android/server/locksettings/LockSettingsService.java index 38ef5b8cedb9..7d44ba199119 100644 --- a/services/core/java/com/android/server/locksettings/LockSettingsService.java +++ b/services/core/java/com/android/server/locksettings/LockSettingsService.java @@ -889,8 +889,14 @@ public class LockSettingsService extends ILockSettings.Stub {                  // Hide notification first, as tie profile lock takes time                  hideEncryptionNotification(new UserHandle(userId)); -                if (isCredentialSharableWithParent(userId)) { -                    tieProfileLockIfNecessary(userId, LockscreenCredential.createNone()); +                if (android.app.admin.flags.Flags.fixRaceConditionInTieProfileLock()) { +                    synchronized (mSpManager) { +                        tieProfileLockIfNecessary(userId, LockscreenCredential.createNone()); +                    } +                } else { +                    if (isCredentialSharableWithParent(userId)) { +                        tieProfileLockIfNecessary(userId, LockscreenCredential.createNone()); +                    }                  }              }          }); @@ -1287,7 +1293,13 @@ public class LockSettingsService extends ILockSettings.Stub {                  mStorage.removeChildProfileLock(userId);                  removeKeystoreProfileKey(userId);              } else { -                tieProfileLockIfNecessary(userId, profileUserPassword); +                if (android.app.admin.flags.Flags.fixRaceConditionInTieProfileLock()) { +                    synchronized (mSpManager) { +                        tieProfileLockIfNecessary(userId, profileUserPassword); +                    } +                } else { +                    tieProfileLockIfNecessary(userId, profileUserPassword); +                }              }          } catch (IllegalStateException e) {              setBoolean(SEPARATE_PROFILE_CHALLENGE_KEY, old, userId);  |