Loading packages/SystemUI/src/com/android/systemui/biometrics/AuthRippleController.kt +4 −1 Original line number Diff line number Diff line Loading @@ -328,8 +328,11 @@ class AuthRippleController @Inject constructor( private val udfpsControllerCallback = object : UdfpsController.Callback { override fun onFingerDown() { // only show dwell ripple for device entry if (keyguardUpdateMonitor.isFingerprintDetectionRunning) { showDwellRipple() } } override fun onFingerUp() { mView.retractDwellRipple() Loading packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthRippleControllerTest.kt +21 −1 Original line number Diff line number Diff line Loading @@ -301,7 +301,10 @@ class AuthRippleControllerTest : SysuiTestCase() { } @Test fun testUdfps_onFingerDown_showDwellRipple() { fun testUdfps_onFingerDown_runningForDeviceEntry_showDwellRipple() { // GIVEN fingerprint detection is running on keyguard `when`(keyguardUpdateMonitor.isFingerprintDetectionRunning).thenReturn(true) // GIVEN view is already attached controller.onViewAttached() val captor = ArgumentCaptor.forClass(UdfpsController.Callback::class.java) Loading @@ -318,4 +321,21 @@ class AuthRippleControllerTest : SysuiTestCase() { verify(rippleView).setFingerprintSensorLocation(fpsLocation, 0f) verify(rippleView).startDwellRipple(false) } @Test fun testUdfps_onFingerDown_notDeviceEntry_doesNotShowDwellRipple() { // GIVEN fingerprint detection is NOT running on keyguard `when`(keyguardUpdateMonitor.isFingerprintDetectionRunning).thenReturn(false) // GIVEN view is already attached controller.onViewAttached() val captor = ArgumentCaptor.forClass(UdfpsController.Callback::class.java) verify(udfpsController).addCallback(captor.capture()) // WHEN finger is down captor.value.onFingerDown() // THEN doesn't show dwell ripple verify(rippleView, never()).startDwellRipple(false) } } Loading
packages/SystemUI/src/com/android/systemui/biometrics/AuthRippleController.kt +4 −1 Original line number Diff line number Diff line Loading @@ -328,8 +328,11 @@ class AuthRippleController @Inject constructor( private val udfpsControllerCallback = object : UdfpsController.Callback { override fun onFingerDown() { // only show dwell ripple for device entry if (keyguardUpdateMonitor.isFingerprintDetectionRunning) { showDwellRipple() } } override fun onFingerUp() { mView.retractDwellRipple() Loading
packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthRippleControllerTest.kt +21 −1 Original line number Diff line number Diff line Loading @@ -301,7 +301,10 @@ class AuthRippleControllerTest : SysuiTestCase() { } @Test fun testUdfps_onFingerDown_showDwellRipple() { fun testUdfps_onFingerDown_runningForDeviceEntry_showDwellRipple() { // GIVEN fingerprint detection is running on keyguard `when`(keyguardUpdateMonitor.isFingerprintDetectionRunning).thenReturn(true) // GIVEN view is already attached controller.onViewAttached() val captor = ArgumentCaptor.forClass(UdfpsController.Callback::class.java) Loading @@ -318,4 +321,21 @@ class AuthRippleControllerTest : SysuiTestCase() { verify(rippleView).setFingerprintSensorLocation(fpsLocation, 0f) verify(rippleView).startDwellRipple(false) } @Test fun testUdfps_onFingerDown_notDeviceEntry_doesNotShowDwellRipple() { // GIVEN fingerprint detection is NOT running on keyguard `when`(keyguardUpdateMonitor.isFingerprintDetectionRunning).thenReturn(false) // GIVEN view is already attached controller.onViewAttached() val captor = ArgumentCaptor.forClass(UdfpsController.Callback::class.java) verify(udfpsController).addCallback(captor.capture()) // WHEN finger is down captor.value.onFingerDown() // THEN doesn't show dwell ripple verify(rippleView, never()).startDwellRipple(false) } }