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

Commit 6ab4498c authored by Zach Kuznia's avatar Zach Kuznia Committed by Android (Google) Code Review
Browse files

Merge "Fix double tap issue in TouchExplorer" into nyc-dev

parents 5a032c33 fd6aa8a1
Loading
Loading
Loading
Loading
+9 −10
Original line number Diff line number Diff line
@@ -62,14 +62,6 @@ class AccessibilityGestureDetector extends GestureDetector.SimpleOnGestureListen
         */
        void onDoubleTapAndHold(MotionEvent event, int policyFlags);

        /**
         * Called when the user touches the screen on the second tap of a double
         * tap.
         *
         * @return true if the event is consumed, else false
         */
        boolean onDoubleTapStarted();

        /**
         * Called when the user lifts their finger on the second tap of a double
         * tap.
@@ -246,13 +238,20 @@ class AccessibilityGestureDetector extends GestureDetector.SimpleOnGestureListen
                        mBaseY = y;
                        mBaseTime = time;

                        // Since the pointer has moved, this is not a double
                        // tap.
                        mFirstTapDetected = false;
                        mDoubleTapDetected = false;

                        // If this hasn't been confirmed as a gesture yet, send
                        // the event.
                        if (!mGestureStarted) {
                            mGestureStarted = true;
                            return mListener.onGestureStarted();
                        }
                    } else {
                    } else if (!mFirstTapDetected) {
                        // The finger may not move if they are double tapping.
                        // In that case, we shouldn't cancel the gesture.
                        final long timeDelta = time - mBaseTime;
                        final long threshold = mGestureStarted ?
                            CANCEL_ON_PAUSE_THRESHOLD_STARTED_MS :
@@ -371,7 +370,7 @@ class AccessibilityGestureDetector extends GestureDetector.SimpleOnGestureListen
        // The processing of the double tap is deferred until the finger is
        // lifted, so that we can detect a long press on the second tap.
        mDoubleTapDetected = true;
        return mListener.onDoubleTapStarted();
        return false;
    }

    private void maybeSendLongPress(MotionEvent event, int policyFlags) {
+0 −5
Original line number Diff line number Diff line
@@ -389,11 +389,6 @@ class TouchExplorer implements EventStreamTransformation, AccessibilityGestureDe
        sendDownForAllNotInjectedPointers(event, policyFlags);
    }

    @Override
    public boolean onDoubleTapStarted() {
        return true;
    }

    @Override
    public boolean onDoubleTap(MotionEvent event, int policyFlags) {
        // Ignore the event if we aren't touch exploring.