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

Commit 5092ea49 authored by Oli Thompson's avatar Oli Thompson Committed by Android (Google) Code Review
Browse files

Merge "Restrict quietModeCredentialBugFix to managed profiles" into main

parents 94d58152 38f5a27c
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -247,3 +247,13 @@ flag {
    description: "Allow MAIN user to access blocked number provider"
    bug: "338579331"
}

flag {
    name: "restrict_quiet_mode_credential_bug_fix_to_managed_profiles"
    namespace: "profile_experiences"
    description: "Use user states to check the state of quiet mode for managed profiles only"
    bug: "332812630"
    metadata {
      purpose: PURPOSE_BUGFIX
    }
}
+14 −10
Original line number Diff line number Diff line
@@ -1924,18 +1924,22 @@ public class UserManagerService extends IUserManager.Stub {
    private void showConfirmCredentialToDisableQuietMode(
            @UserIdInt int userId, @Nullable IntentSender target, @Nullable String callingPackage) {
        if (android.app.admin.flags.Flags.quietModeCredentialBugFix()) {
            // TODO (b/308121702) It may be brittle to rely on user states to check profile state
            if (!android.multiuser.Flags.restrictQuietModeCredentialBugFixToManagedProfiles()
                    || getUserInfo(userId).isManagedProfile()) {
                // TODO (b/308121702) It may be brittle to rely on user states to check managed
                //  profile state
                int state;
                synchronized (mUserStates) {
                    state = mUserStates.get(userId, UserState.STATE_NONE);
                }
                if (state != UserState.STATE_NONE) {
                    Slog.i(LOG_TAG,
                        "showConfirmCredentialToDisableQuietMode() called too early, user " + userId
                                + " is still alive.");
                            "showConfirmCredentialToDisableQuietMode() called too early, managed "
                                    + "user " + userId + " is still alive.");
                    return;
                }
            }
        }
        // otherwise, we show a profile challenge to trigger decryption of the user
        final KeyguardManager km = (KeyguardManager) mContext.getSystemService(
                Context.KEYGUARD_SERVICE);