Skip to content

Commit f25f3d9

Browse files
author
Android Build Coastguard Worker
committed
Merge cherrypicks of ['googleplex-android-review.googlesource.com/21465508'] into sparse-9608475-L41300000958690509.
SPARSE_CHANGE: Iea66d7782b3365dea827b854783aeddaa5c6699c Change-Id: I1db552e1b2fc400a0c6e25cb308d947688e1e4e9
2 parents d69be73 + d2cc529 commit f25f3d9

3 files changed

Lines changed: 14 additions & 4 deletions

File tree

packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2735,7 +2735,8 @@ protected boolean shouldListenForFingerprint(boolean isUdfps) {
27352735

27362736
boolean shouldListen = shouldListenKeyguardState && shouldListenUserState
27372737
&& shouldListenBouncerState && shouldListenUdfpsState
2738-
&& shouldListenSideFpsState;
2738+
&& shouldListenSideFpsState
2739+
&& !isFingerprintLockedOut();
27392740
logListenerModelData(
27402741
new KeyguardFingerprintListenModel(
27412742
System.currentTimeMillis(),

packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_BOOT;
2929
import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN;
3030
import static com.android.keyguard.FaceAuthApiRequestReason.NOTIFICATION_PANEL_CLICKED;
31+
import static com.android.keyguard.KeyguardUpdateMonitor.BIOMETRIC_STATE_CANCELLING;
3132
import static com.android.keyguard.KeyguardUpdateMonitor.BIOMETRIC_STATE_CANCELLING_RESTARTING;
3233
import static com.android.keyguard.KeyguardUpdateMonitor.DEFAULT_CANCEL_SIGNAL_TIMEOUT;
3334
import static com.android.keyguard.KeyguardUpdateMonitor.HAL_POWER_PRESS_TIMEOUT;
@@ -1040,10 +1041,11 @@ private void testMultiUserLockout_whenUserSwitches(
10401041
assertThat(mKeyguardUpdateMonitor.isFingerprintLockedOut()).isEqualTo(fpLocked);
10411042
assertThat(mKeyguardUpdateMonitor.isFaceLockedOut()).isEqualTo(faceLocked);
10421043

1043-
// Fingerprint should be restarted once its cancelled bc on lockout, the device
1044-
// can still detectFingerprint (and if it's not locked out, fingerprint can listen)
1044+
// Fingerprint should be cancelled on lockout if going to lockout state, else
1045+
// restarted if it's not
10451046
assertThat(mKeyguardUpdateMonitor.mFingerprintRunningState)
1046-
.isEqualTo(BIOMETRIC_STATE_CANCELLING_RESTARTING);
1047+
.isEqualTo(fpLocked
1048+
? BIOMETRIC_STATE_CANCELLING : BIOMETRIC_STATE_CANCELLING_RESTARTING);
10471049
}
10481050

10491051
@Test

services/core/java/com/android/server/biometrics/sensors/fingerprint/FingerprintService.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,13 @@ public long detectFingerprint(final IBinder token, final int userId,
452452
return -1;
453453
}
454454

455+
if (!Utils.isUserEncryptedOrLockdown(mLockPatternUtils, userId)) {
456+
// If this happens, something in KeyguardUpdateMonitor is wrong. This should only
457+
// ever be invoked when the user is encrypted or lockdown.
458+
Slog.e(TAG, "detectFingerprint invoked when user is not encrypted or lockdown");
459+
return -1;
460+
}
461+
455462
final Pair<Integer, ServiceProvider> provider = getSingleProvider();
456463
if (provider == null) {
457464
Slog.w(TAG, "Null provider for detectFingerprint");

0 commit comments

Comments
 (0)