summaryrefslogtreecommitdiffstats
path: root/packages/Keyguard/src/com/android/keyguard
diff options
context:
space:
mode:
authorJorim Jaggi <jjaggi@google.com>2015-09-22 15:55:33 -0700
committerJorim Jaggi <jjaggi@google.com>2015-09-23 18:44:20 +0000
commit6a15d528c0a4501389008ef945dec38b5ca6919a (patch)
treeecd2da97a204b1f7f1b165fe81bbe2859416c3c8 /packages/Keyguard/src/com/android/keyguard
parent739bb7c694aee521995100c456cf1c8341820bec (diff)
downloadframeworks_base-6a15d528c0a4501389008ef945dec38b5ca6919a.zip
frameworks_base-6a15d528c0a4501389008ef945dec38b5ca6919a.tar.gz
frameworks_base-6a15d528c0a4501389008ef945dec38b5ca6919a.tar.bz2
Do not go over handler to dispatch keyguard visibility
When going over the handler, it could happen with a bad interleaving we thought that Keyguard was not showing when getting the onFinishedGoingToSleep message, so we stopped fingerprint authentication. For some reason our state machine for canceling /restarting authentication didn't work correctly so the fingerprint listening state was not correct. Bug: 24178814 Change-Id: I2a4731f195982395244c12e4d33b2b7d561c5671
Diffstat (limited to 'packages/Keyguard/src/com/android/keyguard')
-rw-r--r--packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java26
1 files changed, 8 insertions, 18 deletions
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
index e342865..57ee319 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
@@ -121,7 +121,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
private static final int MSG_DEVICE_PROVISIONED = 308;
private static final int MSG_DPM_STATE_CHANGED = 309;
private static final int MSG_USER_SWITCHING = 310;
- private static final int MSG_KEYGUARD_VISIBILITY_CHANGED = 311;
private static final int MSG_KEYGUARD_RESET = 312;
private static final int MSG_BOOT_COMPLETED = 313;
private static final int MSG_USER_SWITCH_COMPLETE = 314;
@@ -233,9 +232,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
case MSG_USER_SWITCH_COMPLETE:
handleUserSwitchComplete(msg.arg1);
break;
- case MSG_KEYGUARD_VISIBILITY_CHANGED:
- handleKeyguardVisibilityChanged(msg.arg1);
- break;
case MSG_KEYGUARD_RESET:
handleKeyguardReset();
break;
@@ -1344,19 +1340,20 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
}
/**
- * Handle {@link #MSG_KEYGUARD_VISIBILITY_CHANGED}
+ * Notifies that the visibility state of Keyguard has changed.
+ *
+ * <p>Needs to be called from the main thread.
*/
- private void handleKeyguardVisibilityChanged(int showing) {
- if (DEBUG) Log.d(TAG, "handleKeyguardVisibilityChanged(" + showing + ")");
- boolean isShowing = (showing == 1);
- mKeyguardIsVisible = isShowing;
+ public void onKeyguardVisibilityChanged(boolean showing) {
+ if (DEBUG) Log.d(TAG, "onKeyguardVisibilityChanged(" + showing + ")");
+ mKeyguardIsVisible = showing;
for (int i = 0; i < mCallbacks.size(); i++) {
KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get();
if (cb != null) {
- cb.onKeyguardVisibilityChangedRaw(isShowing);
+ cb.onKeyguardVisibilityChangedRaw(showing);
}
}
- if (!isShowing) {
+ if (!showing) {
mFingerprintAlreadyAuthenticated = false;
}
updateFingerprintListeningState();
@@ -1477,13 +1474,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
}
}
- public void sendKeyguardVisibilityChanged(boolean showing) {
- if (DEBUG) Log.d(TAG, "sendKeyguardVisibilityChanged(" + showing + ")");
- Message message = mHandler.obtainMessage(MSG_KEYGUARD_VISIBILITY_CHANGED);
- message.arg1 = showing ? 1 : 0;
- message.sendToTarget();
- }
-
public void sendKeyguardReset() {
mHandler.obtainMessage(MSG_KEYGUARD_RESET).sendToTarget();
}