Revert change that would detectFp when FP is locked out

This reverts commit ff09044d12 in
addition to partially reverting ag/20141372.

Bug: b/269574598

Change-Id: Iea66d7782b3365dea827b854783aeddaa5c6699c
This commit is contained in:
Beverly
2023-02-16 18:19:05 +00:00
committed by Beverly Tai
parent 37ea5f6833
commit 648fed5956
3 changed files with 14 additions and 4 deletions

View File

@@ -2781,7 +2781,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
boolean shouldListen = shouldListenKeyguardState && shouldListenUserState boolean shouldListen = shouldListenKeyguardState && shouldListenUserState
&& shouldListenBouncerState && shouldListenUdfpsState && shouldListenBouncerState && shouldListenUdfpsState
&& shouldListenSideFpsState; && shouldListenSideFpsState
&& !isFingerprintLockedOut();
logListenerModelData( logListenerModelData(
new KeyguardFingerprintListenModel( new KeyguardFingerprintListenModel(
System.currentTimeMillis(), System.currentTimeMillis(),

View File

@@ -29,6 +29,7 @@ import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STR
import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN; import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN;
import static com.android.keyguard.FaceAuthApiRequestReason.NOTIFICATION_PANEL_CLICKED; import static com.android.keyguard.FaceAuthApiRequestReason.NOTIFICATION_PANEL_CLICKED;
import static com.android.keyguard.KeyguardUpdateMonitor.BIOMETRIC_HELP_FACE_NOT_AVAILABLE; import static com.android.keyguard.KeyguardUpdateMonitor.BIOMETRIC_HELP_FACE_NOT_AVAILABLE;
import static com.android.keyguard.KeyguardUpdateMonitor.BIOMETRIC_STATE_CANCELLING;
import static com.android.keyguard.KeyguardUpdateMonitor.BIOMETRIC_STATE_CANCELLING_RESTARTING; import static com.android.keyguard.KeyguardUpdateMonitor.BIOMETRIC_STATE_CANCELLING_RESTARTING;
import static com.android.keyguard.KeyguardUpdateMonitor.DEFAULT_CANCEL_SIGNAL_TIMEOUT; import static com.android.keyguard.KeyguardUpdateMonitor.DEFAULT_CANCEL_SIGNAL_TIMEOUT;
import static com.android.keyguard.KeyguardUpdateMonitor.HAL_POWER_PRESS_TIMEOUT; import static com.android.keyguard.KeyguardUpdateMonitor.HAL_POWER_PRESS_TIMEOUT;
@@ -1175,10 +1176,11 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
assertThat(mKeyguardUpdateMonitor.isFingerprintLockedOut()).isEqualTo(fpLocked); assertThat(mKeyguardUpdateMonitor.isFingerprintLockedOut()).isEqualTo(fpLocked);
assertThat(mKeyguardUpdateMonitor.isFaceLockedOut()).isEqualTo(faceLocked); assertThat(mKeyguardUpdateMonitor.isFaceLockedOut()).isEqualTo(faceLocked);
// Fingerprint should be restarted once its cancelled bc on lockout, the device // Fingerprint should be cancelled on lockout if going to lockout state, else
// can still detectFingerprint (and if it's not locked out, fingerprint can listen) // restarted if it's not
assertThat(mKeyguardUpdateMonitor.mFingerprintRunningState) assertThat(mKeyguardUpdateMonitor.mFingerprintRunningState)
.isEqualTo(BIOMETRIC_STATE_CANCELLING_RESTARTING); .isEqualTo(fpLocked
? BIOMETRIC_STATE_CANCELLING : BIOMETRIC_STATE_CANCELLING_RESTARTING);
} }
@Test @Test

View File

@@ -421,6 +421,13 @@ public class FingerprintService extends SystemService {
return -1; return -1;
} }
if (!Utils.isUserEncryptedOrLockdown(mLockPatternUtils, userId)) {
// If this happens, something in KeyguardUpdateMonitor is wrong. This should only
// ever be invoked when the user is encrypted or lockdown.
Slog.e(TAG, "detectFingerprint invoked when user is not encrypted or lockdown");
return -1;
}
final Pair<Integer, ServiceProvider> provider = mRegistry.getSingleProvider(); final Pair<Integer, ServiceProvider> provider = mRegistry.getSingleProvider();
if (provider == null) { if (provider == null) {
Slog.w(TAG, "Null provider for detectFingerprint"); Slog.w(TAG, "Null provider for detectFingerprint");