diff options
| author | 2012-10-09 17:50:46 -0400 | |
|---|---|---|
| committer | 2012-10-09 17:50:46 -0400 | |
| commit | cc4104fd71225ed092f16b11882d9a10084e34ac (patch) | |
| tree | 05fd2401c4d70a9eb2a986bc969a693bb73dd660 | |
| parent | eb7f1571ae60db17ead3a8879b4b49df306f009d (diff) | |
Suppressing FUL after user switch (fix b/7316467)
When switching users, Face Unlock starts in onResume(). However,
there is no signal to indicate when the user actually sees their
unlock screen. This means Face Unlock could be running unseen, timing
out soon after it becomes visible, or letting the user in before they
see the preview.
This fix simply suppresses Face Unlock immediately after switching
users. This is not the ideal behavior, but there is no easy way to
make Face Unlock start only after the unlock screen becomes visible.
When the user changes screens it becomes unsuppressed, so if they go
back to the multi-select widget screen or login, Face Unlock works as
expected and is only suppressed again when the user is switched.
Change-Id: I80a302b0aefc1dee3c2dc77557978cbe062de435
3 files changed, 16 insertions, 1 deletions
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java index 6ea35138446e..21ccfeddfde9 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java @@ -248,6 +248,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); } diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityModel.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityModel.java index 30cd67b0ea4b..e57307230488 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityModel.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityModel.java @@ -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() { diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardUpdateMonitor.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardUpdateMonitor.java index 15a6f9f2b479..63a074a4b180 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardUpdateMonitor.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardUpdateMonitor.java @@ -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); } |