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

Commit 0b89d5fd authored by Gavin Williams's avatar Gavin Williams
Browse files

Autoclick: Fix Autoclick dragging

Both the BUTTON_PRESS and BUTTON_RELEASE event needed their action
button set for text/drawing dragging to work properly.

Demo: http://b/421940081#comment2

Bug: b/421940081
Test: AutoclickControllerTest
Flag: com.android.server.accessibility.enable_autoclick_indicator
Change-Id: I5de13edd49ad078473819b3d2cf8415c84d58873
parent 35669e44
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1390,6 +1390,7 @@ public class AutoclickController extends BaseEventStreamTransformation {
                            mLastMotionEvent.getFlags());
            MotionEvent pressEvent = MotionEvent.obtain(downEvent);
            pressEvent.setAction(MotionEvent.ACTION_BUTTON_PRESS);
            pressEvent.setActionButton(BUTTON_PRIMARY);
            AutoclickController.super.onMotionEvent(downEvent, downEvent,
                    mEventPolicyFlags);
            downEvent.recycle();
@@ -1421,6 +1422,7 @@ public class AutoclickController extends BaseEventStreamTransformation {
                            /* edgeFlags= */ 0,
                            mLastMotionEvent.getSource(),
                            mLastMotionEvent.getFlags());
            releaseEvent.setActionButton(BUTTON_PRIMARY);
            MotionEvent upEvent = MotionEvent.obtain(releaseEvent);
            upEvent.setAction(MotionEvent.ACTION_UP);
            AutoclickController.super.onMotionEvent(releaseEvent, releaseEvent,