Skip to content

Commit 6b17799

Browse files
Brian ColonnaAndroid (Google) Code Review
authored andcommitted
Merge "Suppressing FUL after user switch (fix b/7316467)" into jb-mr1-dev
2 parents 03bd101 + cc4104f commit 6b17799

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,9 @@ public void userActivity(long timeout) {
258258
}
259259

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

policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityModel.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ private boolean isBiometricUnlockSuppressed() {
6565
KeyguardUpdateMonitor monitor = KeyguardUpdateMonitor.getInstance(mContext);
6666
final boolean backupIsTimedOut = monitor.getFailedUnlockAttempts() >=
6767
LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT;
68-
return monitor.getMaxBiometricUnlockAttemptsReached() || backupIsTimedOut;
68+
return monitor.getMaxBiometricUnlockAttemptsReached() || backupIsTimedOut
69+
|| monitor.didBiometricUnlockUserSwitch();
6970
}
7071

7172
SecurityMode getSecurityMode() {

policy/src/com/android/internal/policy/impl/keyguard/KeyguardUpdateMonitor.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ public class KeyguardUpdateMonitor {
102102
private int mFailedAttempts = 0;
103103
private int mFailedBiometricUnlockAttempts = 0;
104104

105+
private boolean mBiometricUnlockUserSwitched;
106+
105107
private boolean mClockVisible;
106108

107109
private final ArrayList<WeakReference<KeyguardUpdateMonitorCallback>>
@@ -404,6 +406,7 @@ protected void handleUserSwitched(int userId, IRemoteCallback reply) {
404406
cb.onUserSwitched(userId);
405407
}
406408
}
409+
mBiometricUnlockUserSwitched = true;
407410
try {
408411
reply.sendResult(null);
409412
} catch (RemoteException e) {
@@ -721,6 +724,14 @@ public boolean getMaxBiometricUnlockAttemptsReached() {
721724
return mFailedBiometricUnlockAttempts >= FAILED_BIOMETRIC_UNLOCK_ATTEMPTS_BEFORE_BACKUP;
722725
}
723726

727+
public boolean didBiometricUnlockUserSwitch() {
728+
return mBiometricUnlockUserSwitched;
729+
}
730+
731+
public void clearBiometricUnlockUserSwitched() {
732+
mBiometricUnlockUserSwitched = false;
733+
}
734+
724735
public boolean isSimLocked() {
725736
return isSimLocked(mSimState);
726737
}

0 commit comments

Comments
 (0)