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

Commit db06de0a authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "TouchExplorer: Send hover events based on the event stream." into main

parents 41c13f14 fd9bbd5a
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -154,3 +154,12 @@ flag {
    description: "Sends accessibility events in TouchExplorer#onAccessibilityEvent based on internal state to keep it consistent. This reduces test flakiness."
    bug: "295575684"
}
flag {
    name: "send_hover_events_based_on_event_stream"
    namespace: "accessibility"
    description: "Send hover enter and exit based on the state of the hover event stream rather than the internal state of the touch explorer state machine. Because of the nondeterministic nature of gesture detection when done in talkback, relying on the internal state can cause crashes."
    bug: "314251047"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}
+5 −2
Original line number Diff line number Diff line
@@ -240,7 +240,7 @@ public class TouchExplorer extends BaseEventStreamTransformation
    }

    private void clear(MotionEvent event, int policyFlags) {
        if (mState.isTouchExploring()) {
        if (mState.isTouchExploring() || Flags.sendHoverEventsBasedOnEventStream()) {
            // If a touch exploration gesture is in progress send events for its end.
            sendHoverExitAndTouchExplorationGestureEndIfNeeded(policyFlags);
        }
@@ -563,7 +563,7 @@ public class TouchExplorer extends BaseEventStreamTransformation
        mSendHoverEnterAndMoveDelayed.clear();
        mSendHoverExitDelayed.cancel();
        // If a touch exploration gesture is in progress send events for its end.
        if (mState.isTouchExploring()) {
        if (mState.isTouchExploring() || Flags.sendHoverEventsBasedOnEventStream()) {
            sendHoverExitAndTouchExplorationGestureEndIfNeeded(policyFlags);
        }
        if (mState.isClear()) {
@@ -1602,6 +1602,9 @@ public class TouchExplorer extends BaseEventStreamTransformation
            if (mEvents.size() == 0) {
                return;
            }
            if (Flags.sendHoverEventsBasedOnEventStream()) {
                sendHoverExitAndTouchExplorationGestureEndIfNeeded(mPolicyFlags);
            }
            // Send an accessibility event to announce the touch exploration start.
            mDispatcher.sendAccessibilityEvent(TYPE_TOUCH_EXPLORATION_GESTURE_START);
            if (isSendMotionEventsEnabled()) {