Loading packages/SystemUI/src/com/android/systemui/biometrics/AuthRippleController.kt +1 −1 Original line number Original line Diff line number Diff line Loading @@ -116,7 +116,7 @@ class AuthRippleController @Inject constructor( } } fun showRipple(biometricSourceType: BiometricSourceType?) { fun showRipple(biometricSourceType: BiometricSourceType?) { if (!keyguardUpdateMonitor.isKeyguardVisible || if (!(keyguardUpdateMonitor.isKeyguardVisible || keyguardUpdateMonitor.isDreaming) || keyguardUpdateMonitor.userNeedsStrongAuth()) { keyguardUpdateMonitor.userNeedsStrongAuth()) { return return } } Loading packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthRippleControllerTest.kt +27 −2 Original line number Original line Diff line number Diff line Loading @@ -114,12 +114,13 @@ class AuthRippleControllerTest : SysuiTestCase() { } } @Test @Test fun testFingerprintTrigger_Ripple() { fun testFingerprintTrigger_KeyguardVisible_Ripple() { // GIVEN fp exists, keyguard is visible, user doesn't need strong auth // GIVEN fp exists, keyguard is visible, user doesn't need strong auth val fpsLocation = PointF(5f, 5f) val fpsLocation = PointF(5f, 5f) `when`(authController.fingerprintSensorLocation).thenReturn(fpsLocation) `when`(authController.fingerprintSensorLocation).thenReturn(fpsLocation) controller.onViewAttached() controller.onViewAttached() `when`(keyguardUpdateMonitor.isKeyguardVisible).thenReturn(true) `when`(keyguardUpdateMonitor.isKeyguardVisible).thenReturn(true) `when`(keyguardUpdateMonitor.isDreaming).thenReturn(false) `when`(keyguardUpdateMonitor.userNeedsStrongAuth()).thenReturn(false) `when`(keyguardUpdateMonitor.userNeedsStrongAuth()).thenReturn(false) // WHEN fingerprint authenticated // WHEN fingerprint authenticated Loading @@ -136,7 +137,30 @@ class AuthRippleControllerTest : SysuiTestCase() { } } @Test @Test fun testFingerprintTrigger_KeyguardNotVisible_NoRipple() { fun testFingerprintTrigger_Dreaming_Ripple() { // GIVEN fp exists, keyguard is visible, user doesn't need strong auth val fpsLocation = PointF(5f, 5f) `when`(authController.fingerprintSensorLocation).thenReturn(fpsLocation) controller.onViewAttached() `when`(keyguardUpdateMonitor.isKeyguardVisible).thenReturn(false) `when`(keyguardUpdateMonitor.isDreaming).thenReturn(true) `when`(keyguardUpdateMonitor.userNeedsStrongAuth()).thenReturn(false) // WHEN fingerprint authenticated val captor = ArgumentCaptor.forClass(KeyguardUpdateMonitorCallback::class.java) verify(keyguardUpdateMonitor).registerCallback(captor.capture()) captor.value.onBiometricAuthenticated( 0 /* userId */, BiometricSourceType.FINGERPRINT /* type */, false /* isStrongBiometric */) // THEN update sensor location and show ripple verify(rippleView).setFingerprintSensorLocation(fpsLocation, -1f) verify(rippleView).startUnlockedRipple(any()) } @Test fun testFingerprintTrigger_KeyguardNotVisible_NotDreaming_NoRipple() { // GIVEN fp exists & user doesn't need strong auth // GIVEN fp exists & user doesn't need strong auth val fpsLocation = PointF(5f, 5f) val fpsLocation = PointF(5f, 5f) `when`(authController.udfpsSensorLocation).thenReturn(fpsLocation) `when`(authController.udfpsSensorLocation).thenReturn(fpsLocation) Loading @@ -145,6 +169,7 @@ class AuthRippleControllerTest : SysuiTestCase() { // WHEN keyguard is NOT visible & fingerprint authenticated // WHEN keyguard is NOT visible & fingerprint authenticated `when`(keyguardUpdateMonitor.isKeyguardVisible).thenReturn(false) `when`(keyguardUpdateMonitor.isKeyguardVisible).thenReturn(false) `when`(keyguardUpdateMonitor.isDreaming).thenReturn(false) val captor = ArgumentCaptor.forClass(KeyguardUpdateMonitorCallback::class.java) val captor = ArgumentCaptor.forClass(KeyguardUpdateMonitorCallback::class.java) verify(keyguardUpdateMonitor).registerCallback(captor.capture()) verify(keyguardUpdateMonitor).registerCallback(captor.capture()) captor.value.onBiometricAuthenticated( captor.value.onBiometricAuthenticated( Loading Loading
packages/SystemUI/src/com/android/systemui/biometrics/AuthRippleController.kt +1 −1 Original line number Original line Diff line number Diff line Loading @@ -116,7 +116,7 @@ class AuthRippleController @Inject constructor( } } fun showRipple(biometricSourceType: BiometricSourceType?) { fun showRipple(biometricSourceType: BiometricSourceType?) { if (!keyguardUpdateMonitor.isKeyguardVisible || if (!(keyguardUpdateMonitor.isKeyguardVisible || keyguardUpdateMonitor.isDreaming) || keyguardUpdateMonitor.userNeedsStrongAuth()) { keyguardUpdateMonitor.userNeedsStrongAuth()) { return return } } Loading
packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthRippleControllerTest.kt +27 −2 Original line number Original line Diff line number Diff line Loading @@ -114,12 +114,13 @@ class AuthRippleControllerTest : SysuiTestCase() { } } @Test @Test fun testFingerprintTrigger_Ripple() { fun testFingerprintTrigger_KeyguardVisible_Ripple() { // GIVEN fp exists, keyguard is visible, user doesn't need strong auth // GIVEN fp exists, keyguard is visible, user doesn't need strong auth val fpsLocation = PointF(5f, 5f) val fpsLocation = PointF(5f, 5f) `when`(authController.fingerprintSensorLocation).thenReturn(fpsLocation) `when`(authController.fingerprintSensorLocation).thenReturn(fpsLocation) controller.onViewAttached() controller.onViewAttached() `when`(keyguardUpdateMonitor.isKeyguardVisible).thenReturn(true) `when`(keyguardUpdateMonitor.isKeyguardVisible).thenReturn(true) `when`(keyguardUpdateMonitor.isDreaming).thenReturn(false) `when`(keyguardUpdateMonitor.userNeedsStrongAuth()).thenReturn(false) `when`(keyguardUpdateMonitor.userNeedsStrongAuth()).thenReturn(false) // WHEN fingerprint authenticated // WHEN fingerprint authenticated Loading @@ -136,7 +137,30 @@ class AuthRippleControllerTest : SysuiTestCase() { } } @Test @Test fun testFingerprintTrigger_KeyguardNotVisible_NoRipple() { fun testFingerprintTrigger_Dreaming_Ripple() { // GIVEN fp exists, keyguard is visible, user doesn't need strong auth val fpsLocation = PointF(5f, 5f) `when`(authController.fingerprintSensorLocation).thenReturn(fpsLocation) controller.onViewAttached() `when`(keyguardUpdateMonitor.isKeyguardVisible).thenReturn(false) `when`(keyguardUpdateMonitor.isDreaming).thenReturn(true) `when`(keyguardUpdateMonitor.userNeedsStrongAuth()).thenReturn(false) // WHEN fingerprint authenticated val captor = ArgumentCaptor.forClass(KeyguardUpdateMonitorCallback::class.java) verify(keyguardUpdateMonitor).registerCallback(captor.capture()) captor.value.onBiometricAuthenticated( 0 /* userId */, BiometricSourceType.FINGERPRINT /* type */, false /* isStrongBiometric */) // THEN update sensor location and show ripple verify(rippleView).setFingerprintSensorLocation(fpsLocation, -1f) verify(rippleView).startUnlockedRipple(any()) } @Test fun testFingerprintTrigger_KeyguardNotVisible_NotDreaming_NoRipple() { // GIVEN fp exists & user doesn't need strong auth // GIVEN fp exists & user doesn't need strong auth val fpsLocation = PointF(5f, 5f) val fpsLocation = PointF(5f, 5f) `when`(authController.udfpsSensorLocation).thenReturn(fpsLocation) `when`(authController.udfpsSensorLocation).thenReturn(fpsLocation) Loading @@ -145,6 +169,7 @@ class AuthRippleControllerTest : SysuiTestCase() { // WHEN keyguard is NOT visible & fingerprint authenticated // WHEN keyguard is NOT visible & fingerprint authenticated `when`(keyguardUpdateMonitor.isKeyguardVisible).thenReturn(false) `when`(keyguardUpdateMonitor.isKeyguardVisible).thenReturn(false) `when`(keyguardUpdateMonitor.isDreaming).thenReturn(false) val captor = ArgumentCaptor.forClass(KeyguardUpdateMonitorCallback::class.java) val captor = ArgumentCaptor.forClass(KeyguardUpdateMonitorCallback::class.java) verify(keyguardUpdateMonitor).registerCallback(captor.capture()) verify(keyguardUpdateMonitor).registerCallback(captor.capture()) captor.value.onBiometricAuthenticated( captor.value.onBiometricAuthenticated( Loading