Loading packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java +5 −3 Original line number Diff line number Diff line Loading @@ -332,17 +332,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); } } Loading packages/SystemUI/src/com/android/systemui/biometrics/UdfpsShell.kt +4 −4 Original line number Diff line number Diff line Loading @@ -148,7 +148,7 @@ class UdfpsShell @Inject constructor( @VisibleForTesting fun onUiReady() { udfpsOverlayController?.debugOnUiReady(REQUEST_ID, SENSOR_ID) udfpsOverlayController?.debugOnUiReady(SENSOR_ID) } @VisibleForTesting Loading @@ -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() Loading @@ -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() } Loading packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsShellTest.kt +3 −3 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -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) } Loading @@ -87,6 +87,6 @@ class UdfpsShellTest : SysuiTestCase() { fun testOnUiReady() { udfpsShell.onUiReady() verify(udfpsOverlayController).debugOnUiReady(any(), any()) verify(udfpsOverlayController).debugOnUiReady(any()) } } Loading
packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java +5 −3 Original line number Diff line number Diff line Loading @@ -332,17 +332,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); } } Loading
packages/SystemUI/src/com/android/systemui/biometrics/UdfpsShell.kt +4 −4 Original line number Diff line number Diff line Loading @@ -148,7 +148,7 @@ class UdfpsShell @Inject constructor( @VisibleForTesting fun onUiReady() { udfpsOverlayController?.debugOnUiReady(REQUEST_ID, SENSOR_ID) udfpsOverlayController?.debugOnUiReady(SENSOR_ID) } @VisibleForTesting Loading @@ -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() Loading @@ -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() } Loading
packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsShellTest.kt +3 −3 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -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) } Loading @@ -87,6 +87,6 @@ class UdfpsShellTest : SysuiTestCase() { fun testOnUiReady() { udfpsShell.onUiReady() verify(udfpsOverlayController).debugOnUiReady(any(), any()) verify(udfpsOverlayController).debugOnUiReady(any()) } }