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

Commit 119abb21 authored by Jeff Brown's avatar Jeff Brown Committed by Android (Google) Code Review
Browse files

Merge "Enter touch mode on ACTION_SCROLL."

parents 4540926d 7564d62a
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);