Loading packages/SystemUI/src/com/android/keyguard/KeyguardFingerprintListenModel.kt +4 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ data class KeyguardFingerprintListenModel( override var userId: Int = 0, override var listening: Boolean = false, // keepSorted var alternateBouncerShowing: Boolean = false, var biometricEnabledForUser: Boolean = false, var bouncerIsOrWillShow: Boolean = false, var canSkipBouncer: Boolean = false, Loading Loading @@ -57,6 +58,7 @@ data class KeyguardFingerprintListenModel( userId.toString(), listening.toString(), // keep sorted alternateBouncerShowing.toString(), biometricEnabledForUser.toString(), bouncerIsOrWillShow.toString(), canSkipBouncer.toString(), Loading Loading @@ -96,6 +98,7 @@ data class KeyguardFingerprintListenModel( userId = model.userId listening = model.listening // keep sorted alternateBouncerShowing = model.alternateBouncerShowing biometricEnabledForUser = model.biometricEnabledForUser bouncerIsOrWillShow = model.bouncerIsOrWillShow canSkipBouncer = model.canSkipBouncer Loading Loading @@ -141,6 +144,7 @@ data class KeyguardFingerprintListenModel( "userId", "listening", // keep sorted "alternateBouncerShowing", "biometricAllowedForUser", "bouncerIsOrWillShow", "canSkipBouncer", Loading packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +3 −1 Original line number Diff line number Diff line Loading @@ -2632,6 +2632,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab ActiveUnlockConfig.ActiveUnlockRequestOrigin.UNLOCK_INTENT, "alternateBouncer"); } updateFingerprintListeningState(BIOMETRIC_ACTION_UPDATE); } private boolean shouldTriggerActiveUnlock() { Loading Loading @@ -2716,7 +2717,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab || shouldListenForFingerprintAssistant || (mKeyguardOccluded && mIsDreaming) || (mKeyguardOccluded && userDoesNotHaveTrust && (mOccludingAppRequestingFp || isUdfps)); && (mOccludingAppRequestingFp || isUdfps || mAlternateBouncerShowing)); // Only listen if this KeyguardUpdateMonitor belongs to the primary user. There is an // instance of KeyguardUpdateMonitor for each user but KeyguardUpdateMonitor is user-aware. Loading Loading @@ -2757,6 +2758,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab System.currentTimeMillis(), user, shouldListen, mAlternateBouncerShowing, biometricEnabledForUser, mPrimaryBouncerIsOrWillBeShowing, userCanSkipBouncer, Loading packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java +19 −0 Original line number Diff line number Diff line Loading @@ -899,6 +899,25 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase { anyBoolean()); } @Test public void noFpListeningWhenKeyguardIsOccluded_unlessAlternateBouncerShowing() { // GIVEN device is awake but occluded mKeyguardUpdateMonitor.dispatchStartedWakingUp(PowerManager.WAKE_REASON_POWER_BUTTON); mKeyguardUpdateMonitor.setKeyguardShowing(false, true); // THEN fingerprint shouldn't listen assertThat(mKeyguardUpdateMonitor.shouldListenForFingerprint(false)).isFalse(); verify(mFingerprintManager, never()).authenticate(any(), any(), any(), any(), anyInt(), anyInt(), anyInt()); // WHEN alternate bouncer is shown mKeyguardUpdateMonitor.setAlternateBouncerShowing(true); // THEN make sure FP listening begins verify(mFingerprintManager).authenticate(any(), any(), any(), any(), anyInt(), anyInt(), anyInt()); } @Test public void testTriesToAuthenticate_whenTrustOnAgentKeyguard_ifBypass() { mKeyguardUpdateMonitor.dispatchStartedWakingUp(PowerManager.WAKE_REASON_POWER_BUTTON); Loading Loading
packages/SystemUI/src/com/android/keyguard/KeyguardFingerprintListenModel.kt +4 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ data class KeyguardFingerprintListenModel( override var userId: Int = 0, override var listening: Boolean = false, // keepSorted var alternateBouncerShowing: Boolean = false, var biometricEnabledForUser: Boolean = false, var bouncerIsOrWillShow: Boolean = false, var canSkipBouncer: Boolean = false, Loading Loading @@ -57,6 +58,7 @@ data class KeyguardFingerprintListenModel( userId.toString(), listening.toString(), // keep sorted alternateBouncerShowing.toString(), biometricEnabledForUser.toString(), bouncerIsOrWillShow.toString(), canSkipBouncer.toString(), Loading Loading @@ -96,6 +98,7 @@ data class KeyguardFingerprintListenModel( userId = model.userId listening = model.listening // keep sorted alternateBouncerShowing = model.alternateBouncerShowing biometricEnabledForUser = model.biometricEnabledForUser bouncerIsOrWillShow = model.bouncerIsOrWillShow canSkipBouncer = model.canSkipBouncer Loading Loading @@ -141,6 +144,7 @@ data class KeyguardFingerprintListenModel( "userId", "listening", // keep sorted "alternateBouncerShowing", "biometricAllowedForUser", "bouncerIsOrWillShow", "canSkipBouncer", Loading
packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +3 −1 Original line number Diff line number Diff line Loading @@ -2632,6 +2632,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab ActiveUnlockConfig.ActiveUnlockRequestOrigin.UNLOCK_INTENT, "alternateBouncer"); } updateFingerprintListeningState(BIOMETRIC_ACTION_UPDATE); } private boolean shouldTriggerActiveUnlock() { Loading Loading @@ -2716,7 +2717,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab || shouldListenForFingerprintAssistant || (mKeyguardOccluded && mIsDreaming) || (mKeyguardOccluded && userDoesNotHaveTrust && (mOccludingAppRequestingFp || isUdfps)); && (mOccludingAppRequestingFp || isUdfps || mAlternateBouncerShowing)); // Only listen if this KeyguardUpdateMonitor belongs to the primary user. There is an // instance of KeyguardUpdateMonitor for each user but KeyguardUpdateMonitor is user-aware. Loading Loading @@ -2757,6 +2758,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab System.currentTimeMillis(), user, shouldListen, mAlternateBouncerShowing, biometricEnabledForUser, mPrimaryBouncerIsOrWillBeShowing, userCanSkipBouncer, Loading
packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java +19 −0 Original line number Diff line number Diff line Loading @@ -899,6 +899,25 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase { anyBoolean()); } @Test public void noFpListeningWhenKeyguardIsOccluded_unlessAlternateBouncerShowing() { // GIVEN device is awake but occluded mKeyguardUpdateMonitor.dispatchStartedWakingUp(PowerManager.WAKE_REASON_POWER_BUTTON); mKeyguardUpdateMonitor.setKeyguardShowing(false, true); // THEN fingerprint shouldn't listen assertThat(mKeyguardUpdateMonitor.shouldListenForFingerprint(false)).isFalse(); verify(mFingerprintManager, never()).authenticate(any(), any(), any(), any(), anyInt(), anyInt(), anyInt()); // WHEN alternate bouncer is shown mKeyguardUpdateMonitor.setAlternateBouncerShowing(true); // THEN make sure FP listening begins verify(mFingerprintManager).authenticate(any(), any(), any(), any(), anyInt(), anyInt(), anyInt()); } @Test public void testTriesToAuthenticate_whenTrustOnAgentKeyguard_ifBypass() { mKeyguardUpdateMonitor.dispatchStartedWakingUp(PowerManager.WAKE_REASON_POWER_BUTTON); Loading