summaryrefslogtreecommitdiffstats
path: root/packages
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
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')
-rw-r--r--packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java33
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java7
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java1
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockMethodCache.java3
6 files changed, 46 insertions, 8 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)
*/
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
index c01a485..f595847 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
@@ -461,7 +461,9 @@ public class KeyguardViewMediator extends SystemUI {
@Override
public void onFingerprintAuthenticated(int userId, boolean wakeAndUnlocking) {
if (mStatusBarKeyguardViewManager.isBouncerShowing()) {
- mStatusBarKeyguardViewManager.notifyKeyguardAuthenticated();
+ if (mUpdateMonitor.isUnlockingWithFingerprintAllowed()) {
+ mStatusBarKeyguardViewManager.notifyKeyguardAuthenticated();
+ }
} else {
if (wakeAndUnlocking) {
mWakeAndUnlocking = true;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
index a5310a5..9d81e6e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
@@ -651,6 +651,9 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
@Override
public void onFingerprintHelp(int msgId, String helpString) {
+ if (!KeyguardUpdateMonitor.getInstance(mContext).isUnlockingWithFingerprintAllowed()) {
+ return;
+ }
mLockIcon.setTransientFpError(true);
mIndicationController.showTransientIndication(helpString,
getResources().getColor(R.color.system_warning_color, null));
@@ -660,6 +663,9 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
@Override
public void onFingerprintError(int msgId, String errString) {
+ if (!KeyguardUpdateMonitor.getInstance(mContext).isUnlockingWithFingerprintAllowed()) {
+ return;
+ }
// TODO: Go to bouncer if this is "too many attempts" (lockout) error.
mIndicationController.showTransientIndication(errString,
getResources().getColor(R.color.system_warning_color, null));
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java
index 9e2ce15..d93f7c2 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java
@@ -224,13 +224,14 @@ public class LockIcon extends KeyguardAffordanceView {
}
private int getState() {
- boolean fingerprintRunning =
- KeyguardUpdateMonitor.getInstance(mContext).isFingerprintDetectionRunning();
+ KeyguardUpdateMonitor updateMonitor = KeyguardUpdateMonitor.getInstance(mContext);
+ boolean fingerprintRunning = updateMonitor.isFingerprintDetectionRunning();
+ boolean unlockingAllowed = updateMonitor.isUnlockingWithFingerprintAllowed();
if (mUnlockMethodCache.canSkipBouncer()) {
return STATE_LOCK_OPEN;
} else if (mTransientFpError) {
return STATE_FINGERPRINT_ERROR;
- } else if (fingerprintRunning) {
+ } else if (fingerprintRunning && unlockingAllowed) {
return STATE_FINGERPRINT;
} else if (mUnlockMethodCache.isFaceUnlockRunning()) {
return STATE_FACE_UNLOCK;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
index e622144..6b3a59d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
@@ -150,6 +150,7 @@ public class StatusBarKeyguardViewManager {
} else {
showBouncerOrKeyguard();
}
+ KeyguardUpdateMonitor.getInstance(mContext).sendKeyguardReset();
updateStates();
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockMethodCache.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockMethodCache.java
index f31311d..c8c45e3 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockMethodCache.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockMethodCache.java
@@ -133,6 +133,9 @@ public class UnlockMethodCache {
@Override
public void onFingerprintAuthenticated(int userId, boolean wakeAndUnlocking) {
+ if (!mKeyguardUpdateMonitor.isUnlockingWithFingerprintAllowed()) {
+ return;
+ }
update(false /* updateAlways */);
}