Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5f247459 authored by Yuhan Yang's avatar Yuhan Yang
Browse files

Update send motion event method name

This is a follow up nit fix for ag/32877524/comment/5f31f8d8_700a2c6b
since the original method name does not suggest sending a serial of
four events.

Bug: 400744833
Test: atest AutoclickControllerTest
Flag: com.android.server.accessibility.enable_autoclick_indicator
Change-Id: Ifdf435f1791038c26e02b332534d103d36cffd68
parent 817428e7
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -1189,7 +1189,7 @@ public class AutoclickController extends BaseEventStreamTransformation {
                default:
                    break;
            }
            sendMotionEvent(actionButton);
            sendMotionEventsForClick(actionButton);
        }

        /**
@@ -1239,7 +1239,11 @@ public class AutoclickController extends BaseEventStreamTransformation {
            return true;
        }

        private void sendMotionEvent(int actionButton) {
        /**
         * Sends a set of motion events consisting of downEvent, pressEvent, releaseEvent
         * and downEvent for a specific action button.
         */
        private void sendMotionEventsForClick(int actionButton) {
            final long now = SystemClock.uptimeMillis();
            MotionEvent downEvent = buildMotionEvent(
                    now, now, actionButton, mLastMotionEvent);
@@ -1272,11 +1276,11 @@ public class AutoclickController extends BaseEventStreamTransformation {

        private void sendDoubleClickEvent() {
            mHasOngoingDoubleClick = true;
            sendMotionEvent(BUTTON_PRIMARY);
            sendMotionEventsForClick(BUTTON_PRIMARY);
            mHandler.postDelayed(new Runnable() {
                @Override
                public void run() {
                    sendMotionEvent(BUTTON_PRIMARY);
                    sendMotionEventsForClick(BUTTON_PRIMARY);
                    mHasOngoingDoubleClick = false;
                    resetInternalState();
                }