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

Commit 7564d62a authored by Jeff Brown's avatar Jeff Brown
Browse files

Enter touch mode on ACTION_SCROLL.

Also fix the lastTouch tracking so it ignores irrelevant non-touch
events (like ACTION_HOVER).

Change-Id: I9e04872cb1f762aa6dcded1f9f83bf20eda17415
parent 7770b901
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -2634,8 +2634,9 @@ public final class ViewAncestor extends Handler implements ViewParent,
            mInputEventDeliverTimeNanos = System.nanoTime();
        }

        final boolean isTouchEvent = event.isTouchEvent();
        if (mInputEventConsistencyVerifier != null) {
            if (event.isTouchEvent()) {
            if (isTouchEvent) {
                mInputEventConsistencyVerifier.onTouchEvent(event, 0);
            } else {
                mInputEventConsistencyVerifier.onGenericMotionEvent(event, 0);
@@ -2653,9 +2654,9 @@ public final class ViewAncestor extends Handler implements ViewParent,
            mTranslator.translateEventInScreenToAppWindow(event);
        }

        // Enter touch mode on the down.
        boolean isDown = event.getAction() == MotionEvent.ACTION_DOWN;
        if (isDown) {
        // Enter touch mode on down or scroll.
        final int action = event.getAction();
        if (action == MotionEvent.ACTION_DOWN || action == MotionEvent.ACTION_SCROLL) {
            ensureTouchMode(true);
        }

@@ -2668,8 +2669,10 @@ public final class ViewAncestor extends Handler implements ViewParent,
        }

        // Remember the touch position for possible drag-initiation.
        if (isTouchEvent) {
            mLastTouchPoint.x = event.getRawX();
            mLastTouchPoint.y = event.getRawY();
        }

        // Dispatch touch to view hierarchy.
        boolean handled = mView.dispatchPointerEvent(event);