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

Commit 43be3112 authored by Jackal Guo's avatar Jackal Guo
Browse files

Remove unpaired AccessibilityEvent

After a failed gesture, TouchExplorer was trying to announce
the transition to touch exploration mode. Since TouchExplorer
doesn't enter this mode, stop notifying a11y services.

Besides, don't announce the end of the touch interaction if users
don't lift the fingers.

Bug: 118724767
Test: A11y CTS & unit test
Change-Id: I0320c47ac82e5371ef20c5bd16ef2d059ebad6f6
parent 22640b9a
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -809,13 +809,9 @@ class TouchExplorer extends BaseEventStreamTransformation

        // Announce the end of the gesture recognition.
        sendAccessibilityEvent(AccessibilityEvent.TYPE_GESTURE_DETECTION_END);
        // Don't announce the end of a the touch interaction if users didn't lift their fingers.
        if (interactionEnd) {
            // Announce the end of a the touch interaction.
            sendAccessibilityEvent(AccessibilityEvent.TYPE_TOUCH_INTERACTION_END);
        } else {
            // If gesture detection is end, but user doesn't release the finger, announce the
            // transition to exploration state.
            sendAccessibilityEvent(AccessibilityEvent.TYPE_TOUCH_EXPLORATION_GESTURE_START);
        }

        mExitGestureDetectionModeDelayed.cancel();
@@ -1151,10 +1147,7 @@ class TouchExplorer extends BaseEventStreamTransformation
        public void run() {
            // Announce the end of gesture recognition.
            sendAccessibilityEvent(AccessibilityEvent.TYPE_GESTURE_DETECTION_END);
            // Clearing puts is in touch exploration state with a finger already
            // down, so announce the transition to exploration state.
            clear();
            sendAccessibilityEvent(AccessibilityEvent.TYPE_TOUCH_EXPLORATION_GESTURE_START);
        }
    }