Merge "Block face auth when lock icon is pressed" into qt-dev
am: d8941d0451
Change-Id: I37c211c8fe6bee5beee43b5a90c2db7076e81895
This commit is contained in:
@@ -238,6 +238,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
|
|||||||
private boolean mIsDreaming;
|
private boolean mIsDreaming;
|
||||||
private final DevicePolicyManager mDevicePolicyManager;
|
private final DevicePolicyManager mDevicePolicyManager;
|
||||||
private boolean mLogoutEnabled;
|
private boolean mLogoutEnabled;
|
||||||
|
// If the user long pressed the lock icon, disabling face auth for the current session.
|
||||||
|
private boolean mLockIconPressed;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Short delay before restarting biometric authentication after a successful try
|
* Short delay before restarting biometric authentication after a successful try
|
||||||
@@ -1384,6 +1386,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void handleScreenTurnedOff() {
|
private void handleScreenTurnedOff() {
|
||||||
|
mLockIconPressed = false;
|
||||||
mHardwareFingerprintUnavailableRetryCount = 0;
|
mHardwareFingerprintUnavailableRetryCount = 0;
|
||||||
mHardwareFaceUnavailableRetryCount = 0;
|
mHardwareFaceUnavailableRetryCount = 0;
|
||||||
final int count = mCallbacks.size();
|
final int count = mCallbacks.size();
|
||||||
@@ -1625,10 +1628,19 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
|
|||||||
// instance of KeyguardUpdateMonitor for each user but KeyguardUpdateMonitor is user-aware.
|
// instance of KeyguardUpdateMonitor for each user but KeyguardUpdateMonitor is user-aware.
|
||||||
return (mBouncer || mAuthInterruptActive || awakeKeyguard || shouldListenForFaceAssistant())
|
return (mBouncer || mAuthInterruptActive || awakeKeyguard || shouldListenForFaceAssistant())
|
||||||
&& !mSwitchingUser && !getUserCanSkipBouncer(user) && !isFaceDisabled(user)
|
&& !mSwitchingUser && !getUserCanSkipBouncer(user) && !isFaceDisabled(user)
|
||||||
&& !mKeyguardGoingAway && mFaceSettingEnabledForUser
|
&& !mKeyguardGoingAway && mFaceSettingEnabledForUser && !mLockIconPressed
|
||||||
&& mUserManager.isUserUnlocked(user) && mIsPrimaryUser;
|
&& mUserManager.isUserUnlocked(user) && mIsPrimaryUser;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whenever the lock icon is long pressed, disabling trust agents.
|
||||||
|
* This means that we cannot auth passively (face) until the user presses power.
|
||||||
|
*/
|
||||||
|
public void onLockIconPressed() {
|
||||||
|
mLockIconPressed = true;
|
||||||
|
mUserFaceAuthenticated.put(getCurrentUser(), false);
|
||||||
|
updateFaceListeningState();
|
||||||
|
}
|
||||||
|
|
||||||
private void startListeningForFingerprint() {
|
private void startListeningForFingerprint() {
|
||||||
if (mFingerprintRunningState == BIOMETRIC_STATE_CANCELLING) {
|
if (mFingerprintRunningState == BIOMETRIC_STATE_CANCELLING) {
|
||||||
|
|||||||
@@ -189,6 +189,7 @@ public class KeyguardIndicationController implements StateListener,
|
|||||||
mLockscreenGestureLogger.write(MetricsProto.MetricsEvent.ACTION_LS_LOCK,
|
mLockscreenGestureLogger.write(MetricsProto.MetricsEvent.ACTION_LS_LOCK,
|
||||||
0 /* lengthDp - N/A */, 0 /* velocityDp - N/A */);
|
0 /* lengthDp - N/A */, 0 /* velocityDp - N/A */);
|
||||||
showTransientIndication(R.string.keyguard_indication_trust_disabled);
|
showTransientIndication(R.string.keyguard_indication_trust_disabled);
|
||||||
|
mKeyguardUpdateMonitor.onLockIconPressed();
|
||||||
mLockPatternUtils.requireCredentialEntry(KeyguardUpdateMonitor.getCurrentUser());
|
mLockPatternUtils.requireCredentialEntry(KeyguardUpdateMonitor.getCurrentUser());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -261,6 +261,7 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase {
|
|||||||
|
|
||||||
longClickCaptor.getValue().onLongClick(mLockIcon);
|
longClickCaptor.getValue().onLongClick(mLockIcon);
|
||||||
verify(mLockPatternUtils).requireCredentialEntry(anyInt());
|
verify(mLockPatternUtils).requireCredentialEntry(anyInt());
|
||||||
|
verify(mKeyguardUpdateMonitor).onLockIconPressed();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user