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

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

Merge "Prevent launching credential input if managed user is alive" into main

parents 65db1030 bf46bc8f
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -48,3 +48,10 @@ flag {
  description: "Update DumpSys to include information about migrated APIs in DPE"
  bug: "304999634"
}

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."
  bug: "293441361"
}
+13 −0
Original line number Diff line number Diff line
@@ -1592,6 +1592,19 @@ public class UserManagerService extends IUserManager.Stub {
     */
    private void showConfirmCredentialToDisableQuietMode(
            @UserIdInt int userId, @Nullable IntentSender target) {
        if (android.app.admin.flags.Flags.quietModeCredentialBugFix()) {
            // TODO (b/308121702) It may be brittle to rely on user states to check 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.");
                return;
            }
        }
        // otherwise, we show a profile challenge to trigger decryption of the user
        final KeyguardManager km = (KeyguardManager) mContext.getSystemService(
                Context.KEYGUARD_SERVICE);