diff options
| author | Jorim Jaggi <jjaggi@google.com> | 2015-08-19 01:04:54 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-08-19 01:04:54 +0000 |
| commit | 394686efbb51e7c05e230c4ad3695fadc3aa85a0 (patch) | |
| tree | e4155b162998db8625aba7e53d29a27fe5c711fc /packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java | |
| parent | 892768fb3efa6bde3f24ffa09a013fa76cab855e (diff) | |
| parent | 007f0e8f207d3d6d2f47d725b72459edf317cce9 (diff) | |
| download | frameworks_base-394686efbb51e7c05e230c4ad3695fadc3aa85a0.zip frameworks_base-394686efbb51e7c05e230c4ad3695fadc3aa85a0.tar.gz frameworks_base-394686efbb51e7c05e230c4ad3695fadc3aa85a0.tar.bz2 | |
Merge "Fix race condition for doze mode and wake-and-unlocking" into mnc-dr-dev
Diffstat (limited to 'packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java')
| -rw-r--r-- | packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java index f39acde..806f280 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java @@ -409,6 +409,10 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { } private void handleFingerprintAuthFailed() { + if (mFpWakeMode == FP_WAKE_DIRECT_UNLOCK) { + notifyOnFingerprintWakeAndUnlockingFinished(); + } + mFpWakeMode = FP_WAKE_NONE; releaseFingerprintWakeLock(); handleFingerprintHelp(-1, mContext.getString(R.string.fingerprint_not_recognized)); } @@ -428,6 +432,9 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { } mHandler.postDelayed(mReleaseFingerprintWakeLockRunnable, FINGERPRINT_WAKELOCK_TIMEOUT_MS); + if (mFpWakeMode == FP_WAKE_DIRECT_UNLOCK) { + notifyOnFingerprintWakeAndUnlockingStarted(); + } } else if (!mDeviceInteractive) { mFpWakeMode = FP_WAKE_TO_BOUNCER; } else { @@ -435,6 +442,24 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { } } + private void notifyOnFingerprintWakeAndUnlockingStarted() { + for (int i = 0; i < mCallbacks.size(); i++) { + KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get(); + if (cb != null) { + cb.onFingerprintWakeAndUnlockingStarted(); + } + } + } + + private void notifyOnFingerprintWakeAndUnlockingFinished() { + for (int i = 0; i < mCallbacks.size(); i++) { + KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get(); + if (cb != null) { + cb.onFingerprintWakeAndUnlockingFinished(); + } + } + } + private final Runnable mReleaseFingerprintWakeLockRunnable = new Runnable() { @Override public void run() { @@ -891,6 +916,10 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { cb.onScreenTurnedOn(); } } + if (mFpWakeMode == FP_WAKE_DIRECT_UNLOCK) { + notifyOnFingerprintWakeAndUnlockingFinished(); + } + mFpWakeMode = FP_WAKE_NONE; } private void handleScreenTurnedOff() { |
