Loading services/accessibility/java/com/android/server/accessibility/autoclick/AutoclickController.java +2 −2 Original line number Diff line number Diff line Loading @@ -1631,15 +1631,15 @@ public class AutoclickController extends BaseEventStreamTransformation implement mTempPointerProperties, mTempPointerCoords, mMetaState, BUTTON_PRIMARY, /* buttonState= */ 0, /* xPrecision= */ 1.0f, /* yPrecision= */ 1.0f, mLastMotionEvent.getDeviceId(), /* edgeFlags= */ 0, mLastMotionEvent.getSource(), mLastMotionEvent.getFlags()); releaseEvent.setActionButton(BUTTON_PRIMARY); MotionEvent upEvent = MotionEvent.obtain(releaseEvent); releaseEvent.setActionButton(BUTTON_PRIMARY); upEvent.setAction(MotionEvent.ACTION_UP); AutoclickController.super.onMotionEvent(releaseEvent, releaseEvent, mEventPolicyFlags); Loading services/tests/servicestests/src/com/android/server/accessibility/autoclick/AutoclickControllerTest.java +7 −0 Original line number Diff line number Diff line Loading @@ -1235,6 +1235,13 @@ public class AutoclickControllerTest { assertThat(mMotionEventCaptor.upEvent).isNotNull(); assertThat(mMotionEventCaptor.upEvent.getDownTime()).isEqualTo( mMotionEventCaptor.downEvent.getDownTime()); // Verify the button release & up event have the correct click parameters. assertThat(mMotionEventCaptor.buttonReleaseEvent.getActionButton()).isEqualTo( MotionEvent.BUTTON_PRIMARY); assertThat(mMotionEventCaptor.buttonReleaseEvent.getButtonState()).isEqualTo(0); assertThat(mMotionEventCaptor.upEvent.getActionButton()).isEqualTo(0); assertThat(mMotionEventCaptor.upEvent.getButtonState()).isEqualTo(0); } Loading Loading
services/accessibility/java/com/android/server/accessibility/autoclick/AutoclickController.java +2 −2 Original line number Diff line number Diff line Loading @@ -1631,15 +1631,15 @@ public class AutoclickController extends BaseEventStreamTransformation implement mTempPointerProperties, mTempPointerCoords, mMetaState, BUTTON_PRIMARY, /* buttonState= */ 0, /* xPrecision= */ 1.0f, /* yPrecision= */ 1.0f, mLastMotionEvent.getDeviceId(), /* edgeFlags= */ 0, mLastMotionEvent.getSource(), mLastMotionEvent.getFlags()); releaseEvent.setActionButton(BUTTON_PRIMARY); MotionEvent upEvent = MotionEvent.obtain(releaseEvent); releaseEvent.setActionButton(BUTTON_PRIMARY); upEvent.setAction(MotionEvent.ACTION_UP); AutoclickController.super.onMotionEvent(releaseEvent, releaseEvent, mEventPolicyFlags); Loading
services/tests/servicestests/src/com/android/server/accessibility/autoclick/AutoclickControllerTest.java +7 −0 Original line number Diff line number Diff line Loading @@ -1235,6 +1235,13 @@ public class AutoclickControllerTest { assertThat(mMotionEventCaptor.upEvent).isNotNull(); assertThat(mMotionEventCaptor.upEvent.getDownTime()).isEqualTo( mMotionEventCaptor.downEvent.getDownTime()); // Verify the button release & up event have the correct click parameters. assertThat(mMotionEventCaptor.buttonReleaseEvent.getActionButton()).isEqualTo( MotionEvent.BUTTON_PRIMARY); assertThat(mMotionEventCaptor.buttonReleaseEvent.getButtonState()).isEqualTo(0); assertThat(mMotionEventCaptor.upEvent.getActionButton()).isEqualTo(0); assertThat(mMotionEventCaptor.upEvent.getButtonState()).isEqualTo(0); } Loading