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

Commit 4d757625 authored by Brian Colonna's avatar Brian Colonna Committed by Android Git Automerger
Browse files

am 6b17799b: Merge "Suppressing FUL after user switch (fix b/7316467)" into jb-mr1-dev

* commit '6b17799b':
  Suppressing FUL after user switch (fix b/7316467)
parents 89be4267 6b17799b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -258,6 +258,9 @@ public class KeyguardHostView extends KeyguardViewBase {
        }

        public void dismiss(boolean authenticated) {
            // If the biometric unlock was suppressed due to a user switch, it can now be safely
            // unsuppressed because the user has left the unlock screen.
            KeyguardUpdateMonitor.getInstance(mContext).clearBiometricUnlockUserSwitched();
            showNextSecurityScreenOrFinish(authenticated);
        }

+2 −1
Original line number Diff line number Diff line
@@ -65,7 +65,8 @@ public class KeyguardSecurityModel {
        KeyguardUpdateMonitor monitor = KeyguardUpdateMonitor.getInstance(mContext);
        final boolean backupIsTimedOut = monitor.getFailedUnlockAttempts() >=
                LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT;
        return monitor.getMaxBiometricUnlockAttemptsReached() || backupIsTimedOut;
        return monitor.getMaxBiometricUnlockAttemptsReached() || backupIsTimedOut
                || monitor.didBiometricUnlockUserSwitch();
    }

    SecurityMode getSecurityMode() {
+11 −0
Original line number Diff line number Diff line
@@ -102,6 +102,8 @@ public class KeyguardUpdateMonitor {
    private int mFailedAttempts = 0;
    private int mFailedBiometricUnlockAttempts = 0;

    private boolean mBiometricUnlockUserSwitched;

    private boolean mClockVisible;

    private final ArrayList<WeakReference<KeyguardUpdateMonitorCallback>>
@@ -404,6 +406,7 @@ public class KeyguardUpdateMonitor {
                cb.onUserSwitched(userId);
            }
        }
        mBiometricUnlockUserSwitched = true;
        try {
            reply.sendResult(null);
        } catch (RemoteException e) {
@@ -721,6 +724,14 @@ public class KeyguardUpdateMonitor {
        return mFailedBiometricUnlockAttempts >= FAILED_BIOMETRIC_UNLOCK_ATTEMPTS_BEFORE_BACKUP;
    }

    public boolean didBiometricUnlockUserSwitch() {
        return mBiometricUnlockUserSwitched;
    }

    public void clearBiometricUnlockUserSwitched() {
        mBiometricUnlockUserSwitched = false;
    }

    public boolean isSimLocked() {
        return isSimLocked(mSimState);
    }