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

Commit 30615ede authored by Yuhan Yang's avatar Yuhan Yang Committed by Android (Google) Code Review
Browse files

Merge "Update send motion event method name" into main

parents e71077fd 5f247459
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();
                }