diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java index 1613ca1fd0348..6e815d6073955 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java @@ -330,17 +330,19 @@ public class UdfpsController implements DozeReceiver, Dumpable { * * @param event MotionEvent to simulate in onTouch */ - public void debugOnTouch(long requestId, MotionEvent event) { - UdfpsController.this.onTouch(requestId, event, false); + public void debugOnTouch(MotionEvent event) { + final long requestId = (mOverlay != null) ? mOverlay.getRequestId() : 0L; + UdfpsController.this.onTouch(requestId, event, true); } /** * Debug to run onUiReady */ - public void debugOnUiReady(long requestId, int sensorId) { + public void debugOnUiReady(int sensorId) { if (UdfpsController.this.mAlternateTouchProvider != null) { UdfpsController.this.mAlternateTouchProvider.onUiReady(); } else { + final long requestId = (mOverlay != null) ? mOverlay.getRequestId() : 0L; UdfpsController.this.mFingerprintManager.onUiReady(requestId, sensorId); } } diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsShell.kt b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsShell.kt index f48cfd3dc3a4a..fca4cf9bf0826 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsShell.kt +++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsShell.kt @@ -148,7 +148,7 @@ class UdfpsShell @Inject constructor( @VisibleForTesting fun onUiReady() { - udfpsOverlayController?.debugOnUiReady(REQUEST_ID, SENSOR_ID) + udfpsOverlayController?.debugOnUiReady(SENSOR_ID) } @VisibleForTesting @@ -157,11 +157,11 @@ class UdfpsShell @Inject constructor( val downEvent: MotionEvent? = obtainMotionEvent(ACTION_DOWN, sensorBounds.exactCenterX(), sensorBounds.exactCenterY(), MINOR, MAJOR) - udfpsOverlayController?.debugOnTouch(REQUEST_ID, downEvent) + udfpsOverlayController?.debugOnTouch(downEvent) val moveEvent: MotionEvent? = obtainMotionEvent(ACTION_MOVE, sensorBounds.exactCenterX(), sensorBounds.exactCenterY(), MINOR, MAJOR) - udfpsOverlayController?.debugOnTouch(REQUEST_ID, moveEvent) + udfpsOverlayController?.debugOnTouch(moveEvent) downEvent?.recycle() moveEvent?.recycle() @@ -173,7 +173,7 @@ class UdfpsShell @Inject constructor( val upEvent: MotionEvent? = obtainMotionEvent(ACTION_UP, sensorBounds.exactCenterX(), sensorBounds.exactCenterY(), MINOR, MAJOR) - udfpsOverlayController?.debugOnTouch(REQUEST_ID, upEvent) + udfpsOverlayController?.debugOnTouch(upEvent) upEvent?.recycle() } diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsShellTest.kt b/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsShellTest.kt index 54f20db59afde..5c0924011259e 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsShellTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsShellTest.kt @@ -68,7 +68,7 @@ class UdfpsShellTest : SysuiTestCase() { fun testSimFingerDown() { udfpsShell.simFingerDown() - verify(udfpsOverlayController, times(2)).debugOnTouch(any(), motionEvent.capture()) + verify(udfpsOverlayController, times(2)).debugOnTouch(motionEvent.capture()) assertEquals(motionEvent.allValues[0].action, MotionEvent.ACTION_DOWN) // ACTION_MOVE assertEquals(motionEvent.allValues[1].action, MotionEvent.ACTION_MOVE) // ACTION_MOVE @@ -78,7 +78,7 @@ class UdfpsShellTest : SysuiTestCase() { fun testSimFingerUp() { udfpsShell.simFingerUp() - verify(udfpsOverlayController).debugOnTouch(any(), motionEvent.capture()) + verify(udfpsOverlayController).debugOnTouch(motionEvent.capture()) assertEquals(motionEvent.value.action, MotionEvent.ACTION_UP) } @@ -87,6 +87,6 @@ class UdfpsShellTest : SysuiTestCase() { fun testOnUiReady() { udfpsShell.onUiReady() - verify(udfpsOverlayController).debugOnUiReady(any(), any()) + verify(udfpsOverlayController).debugOnUiReady(any()) } }