diff options
author | Jorim Jaggi <jjaggi@google.com> | 2015-08-20 02:18:20 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-08-20 02:18:20 +0000 |
commit | 1fa7384a101450c4619ed43e176d5a54aa0a54f3 (patch) | |
tree | 2206e7a55433f4d7e946859536faea316e45ebae /packages/Keyguard | |
parent | 2af6ec5198ed6edf7576c19a358afddcc4068ff7 (diff) | |
parent | 909788500bbe54b14017be3c1f2b4fee7945c63d (diff) | |
download | frameworks_base-1fa7384a101450c4619ed43e176d5a54aa0a54f3.zip frameworks_base-1fa7384a101450c4619ed43e176d5a54aa0a54f3.tar.gz frameworks_base-1fa7384a101450c4619ed43e176d5a54aa0a54f3.tar.bz2 |
Merge changes Ie8264c4d,Ic83ac0f1 into mnc-dr-dev
* changes:
Fix jank in wake-and-unlock while pulsing
Don't call authenticate immediately after getting valid fingerprint
Diffstat (limited to 'packages/Keyguard')
-rw-r--r-- | packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java index 4eb6f88..40dcd0d 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java @@ -147,6 +147,12 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { private int mRingMode; private int mPhoneState; private boolean mKeyguardIsVisible; + + /** + * If true, fingerprint was already authenticated and we don't need to start listening again + * until the Keyguard has been dismissed. + */ + private boolean mFingerprintAlreadyAuthenticated; private boolean mBouncer; private boolean mBootCompleted; private boolean mUserHasAuthenticatedSinceBoot; @@ -373,6 +379,11 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { private void onFingerprintAuthenticated(int userId) { mUserFingerprintAuthenticated.put(userId, true); + + // If fingerprint unlocking is allowed, this event will lead to a Keyguard dismiss or to a + // wake-up (if Keyguard is not showing), so we don't need to listen until Keyguard is + // fully gone. + mFingerprintAlreadyAuthenticated = isUnlockingWithFingerprintAllowed(); for (int i = 0; i < mCallbacks.size(); i++) { KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get(); if (cb != null) { @@ -818,6 +829,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { cb.onFinishedGoingToSleep(arg1); } } + mFingerprintAlreadyAuthenticated = false; updateFingerprintListeningState(); } @@ -951,13 +963,14 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { } private boolean shouldListenForFingerprint() { - return (mKeyguardIsVisible || !mDeviceInteractive) && !mSwitchingUser; + return (mKeyguardIsVisible || !mDeviceInteractive) && !mSwitchingUser + && !mFingerprintAlreadyAuthenticated; } private void startListeningForFingerprint() { if (DEBUG) Log.v(TAG, "startListeningForFingerprint()"); int userId = ActivityManager.getCurrentUser(); - if (!mFingerprintDetectionRunning && isUnlockWithFingerprintPossible(userId)) { + if (isUnlockWithFingerprintPossible(userId)) { mUserHasAuthenticatedSinceBoot = mTrustManager.hasUserAuthenticatedSinceBoot( ActivityManager.getCurrentUser()); if (mFingerprintCancelSignal != null) { @@ -1249,6 +1262,9 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { cb.onKeyguardVisibilityChangedRaw(isShowing); } } + if (!isShowing) { + mFingerprintAlreadyAuthenticated = false; + } updateFingerprintListeningState(); } |