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

Commit e2b0e7f9 authored by Eric Biggers's avatar Eric Biggers Committed by Automerger Merge Worker
Browse files

Merge "Always call tieProfileLockIfNecessary() under mSpManager lock" into...

Merge "Always call tieProfileLockIfNecessary() under mSpManager lock" into main am: daa8f946 am: 7394d4a5

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/3250397



Change-Id: Ib1c163ca8ae24065cfb4fabffe8b952424e6e42c
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents db84555f 7394d4a5
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -151,6 +151,16 @@ 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"
+15 −3
Original line number Diff line number Diff line
@@ -889,10 +889,16 @@ 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());
                    }
                }
            }
        });
    }

@@ -1287,8 +1293,14 @@ 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);
            throw e;