summaryrefslogtreecommitdiffstats
path: root/packages/Keyguard
diff options
context:
space:
mode:
authorSelim Cinek <cinek@google.com>2015-07-20 14:39:25 -0700
committerSelim Cinek <cinek@google.com>2015-07-23 15:27:32 -0700
commit1fcafc49ad34cb8f778862653d452ac0fe61461c (patch)
tree5f2a9e3029c0c18f89b70366a43fbb419637da4a /packages/Keyguard
parenta2bf7616044051769df86cf5f0bb4b21dedd5269 (diff)
downloadframeworks_base-1fcafc49ad34cb8f778862653d452ac0fe61461c.zip
frameworks_base-1fcafc49ad34cb8f778862653d452ac0fe61461c.tar.gz
frameworks_base-1fcafc49ad34cb8f778862653d452ac0fe61461c.tar.bz2
Adapted the behavior when unlocking with fingerprint is not allowed
We now keep the fingerprint running and switch to the bouncer when the user successfully authenticated. Bug: 21618072 Change-Id: If00061cb3914afd4d7a7d75964594484c792a890
Diffstat (limited to 'packages/Keyguard')
-rw-r--r--packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java33
1 files changed, 29 insertions, 4 deletions
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
index b098258..ec185eb 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
@@ -111,7 +111,8 @@ 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 = 312;
+ 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;
private static final int MSG_USER_INFO_CHANGED = 317;
@@ -135,6 +136,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
private boolean mKeyguardIsVisible;
private boolean mBouncer;
private boolean mBootCompleted;
+ private boolean mUserHasAuthenticatedSinceBoot;
// Device provisioning state
private boolean mDeviceProvisioned;
@@ -194,6 +196,9 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
case MSG_KEYGUARD_VISIBILITY_CHANGED:
handleKeyguardVisibilityChanged(msg.arg1);
break;
+ case MSG_KEYGUARD_RESET:
+ handleKeyguardReset();
+ break;
case MSG_KEYGUARD_BOUNCER_CHANGED:
handleKeyguardBouncerChanged(msg.arg1);
break;
@@ -497,7 +502,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
}
public boolean getUserCanSkipBouncer(int userId) {
- return getUserHasTrust(userId) || mUserFingerprintAuthenticated.get(userId);
+ return getUserHasTrust(userId) || (mUserFingerprintAuthenticated.get(userId)
+ && isUnlockingWithFingerprintAllowed());
}
public boolean getUserHasTrust(int userId) {
@@ -508,6 +514,10 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
return mUserTrustIsManaged.get(userId) && !isTrustDisabled(userId);
}
+ public boolean isUnlockingWithFingerprintAllowed() {
+ return mUserHasAuthenticatedSinceBoot;
+ }
+
static class DisplayClientState {
public int clientGeneration;
public boolean clearing;
@@ -867,14 +877,15 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
}
private boolean shouldListenForFingerprint() {
- return mKeyguardIsVisible && !mSwitchingUser
- && mTrustManager.hasUserAuthenticatedSinceBoot(ActivityManager.getCurrentUser());
+ return mKeyguardIsVisible && !mSwitchingUser;
}
private void startListeningForFingerprint() {
if (DEBUG) Log.v(TAG, "startListeningForFingerprint()");
int userId = ActivityManager.getCurrentUser();
if (isUnlockWithFingerPrintPossible(userId)) {
+ mUserHasAuthenticatedSinceBoot = mTrustManager.hasUserAuthenticatedSinceBoot(
+ ActivityManager.getCurrentUser());
if (mFingerprintCancelSignal != null) {
mFingerprintCancelSignal.cancel();
}
@@ -1168,6 +1179,16 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
}
/**
+ * Handle {@link #MSG_KEYGUARD_RESET}
+ */
+ private void handleKeyguardReset() {
+ if (DEBUG) Log.d(TAG, "handleKeyguardReset");
+ if (!isUnlockingWithFingerprintAllowed()) {
+ updateFingerprintListeningState();
+ }
+ }
+
+ /**
* Handle {@link #MSG_KEYGUARD_BOUNCER_CHANGED}
* @see #sendKeyguardBouncerChanged(boolean)
*/
@@ -1274,6 +1295,10 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
message.sendToTarget();
}
+ public void sendKeyguardReset() {
+ mHandler.obtainMessage(MSG_KEYGUARD_RESET).sendToTarget();
+ }
+
/**
* @see #handleKeyguardBouncerChanged(int)
*/