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

Commit 31080507 authored by Eric Biggers's avatar Eric Biggers
Browse files

Make fixRaceConditionInTieProfileLock unconditional

Bug: 355905501
Flag: EXEMPT removing fix_race_condition_in_tie_profile_lock
Test: presubmit
Change-Id: Id2790369bb5919d6834e1950661b8bcd10acae8f
parent b4966de2
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);