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

Commit 81036dbf authored by Eric Biggers's avatar Eric Biggers Committed by Gerrit Code Review
Browse files

Merge "Make fixRaceConditionInTieProfileLock unconditional" into main

parents b45d2c4d 31080507
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -159,16 +159,6 @@ flag {
    bug: "323001115"
}

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"
+4 −13
Original line number Diff line number Diff line
@@ -451,6 +451,7 @@ public class LockSettingsService extends ILockSettings.Stub {
     * @param profileUserId  profile user Id
     * @param profileUserPassword  profile original password (when it has separated lock).
     */
    @GuardedBy("mSpManager")
    private void tieProfileLockIfNecessary(int profileUserId,
            LockscreenCredential profileUserPassword) {
        // Only for profiles that shares credential with parent
@@ -909,15 +910,9 @@ public class LockSettingsService extends ILockSettings.Stub {
                // Hide notification first, as tie profile lock takes time
                hideEncryptionNotification(new UserHandle(userId));

                if (android.app.admin.flags.Flags.fixRaceConditionInTieProfileLock()) {
                synchronized (mSpManager) {
                    tieProfileLockIfNecessary(userId, LockscreenCredential.createNone());
                }
                } else {
                    if (isCredentialSharableWithParent(userId)) {
                        tieProfileLockIfNecessary(userId, LockscreenCredential.createNone());
                    }
                }
            }
        });
    }
@@ -1380,13 +1375,9 @@ public class LockSettingsService extends ILockSettings.Stub {
                mStorage.removeChildProfileLock(userId);
                removeKeystoreProfileKey(userId);
            } else {
                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);