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

Commit 9e19465f authored by Riley Jones's avatar Riley Jones
Browse files

Adjusting touch explorer to fix split tap behavior discrepancies

Avoids sending TOUCH_INTERACTION_END on double tap if there is still at least one pointer down.
This avoids a duplicate event being sent when the last pointer leaves the screen.

Updates tests to account for this change as needed.

Flag: com.android.server.accessibility.pointer_up_motion_event_in_touch_exploration
Bug: 374930391
Test: atest TouchExplorerTest (both FW and CTS)
Change-Id: I0c7a0dcfdcd595840c79291aac9b290740cae468
parent 7cb3bdab
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -414,8 +414,15 @@ public class TouchExplorer extends BaseEventStreamTransformation
            mSendTouchExplorationEndDelayed.forceSendAndRemove();
        }

        if (!Flags.pointerUpMotionEventInTouchExploration()) {
            // Announce the end of a new touch interaction.
            mDispatcher.sendAccessibilityEvent(TYPE_TOUCH_INTERACTION_END);
        } else {
            // If there are no pointers left on screen, announce the end of the touch interaction.
            if (mReceivedPointerTracker.getReceivedPointerDownCount() == 0) {
                mDispatcher.sendAccessibilityEvent(TYPE_TOUCH_INTERACTION_END);
            }
        }
        mSendTouchInteractionEndDelayed.cancel();
        // Try to use the standard accessibility API to click
        if (!mAms.performActionOnAccessibilityFocusedItem(
+1 −0
Original line number Diff line number Diff line
@@ -360,6 +360,7 @@ public class TouchExplorerTest {
    public void upEventWhenInTwoFingerMove_clearsState() {
        goFromStateClearTo(STATE_MOVING_2FINGERS);

        send(pointerUpEvent());
        send(upEvent());
        assertState(STATE_CLEAR);
    }