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

Commit e8aa09dc authored by Ameer Armaly's avatar Ameer Armaly Committed by Android (Google) Code Review
Browse files

Merge "TouchExplorer: reset hover event timer on ACTION_UP." into main

parents c225d4b2 35b7f967
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -96,6 +96,16 @@ flag {
    bug: "286587811"
}

flag {
    name: "reset_hover_event_timer_on_action_up"
    namespace: "accessibility"
    description: "Reset the timer for sending hover events on receiving ACTION_UP to guarantee the correct amount of time is available between taps."
    bug: "326260351"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
    name: "scan_packages_without_lock"
    namespace: "accessibility"
+13 −0
Original line number Diff line number Diff line
@@ -852,6 +852,11 @@ public class TouchExplorer extends BaseEventStreamTransformation
        final int pointerIdBits = (1 << pointerId);
        if (mSendHoverEnterAndMoveDelayed.isPending()) {
            // If we have not delivered the enter schedule an exit.
            if (Flags.resetHoverEventTimerOnActionUp()) {
                // We cancel first to reset the time window so that the user has the full amount of
                // time to do a multi tap.
                mSendHoverEnterAndMoveDelayed.repost();
            }
            mSendHoverExitDelayed.post(event, rawEvent, pointerIdBits, policyFlags);
        } else {
            // The user is touch exploring so we send events for end.
@@ -1554,6 +1559,14 @@ public class TouchExplorer extends BaseEventStreamTransformation
            }
        }

        public void repost() {
            // cancel without clearing
            if (isPending()) {
                mHandler.removeCallbacks(this);
                mHandler.postDelayed(this, mDetermineUserIntentTimeout);
            }
        }

        private boolean isPending() {
            return mHandler.hasCallbacks(this);
        }