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

Commit 4c2a12a5 authored by Ameer Armaly's avatar Ameer Armaly Committed by Automerger Merge Worker
Browse files

Merge "TouchExplorer: do not crash when the user lifts a finger while...

Merge "TouchExplorer: do not crash when the user lifts a finger while dragging." into tm-dev am: f26d0418

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17124991

Change-Id: I224d104d2a96bcff8223c36b020a5e013ab47816
parents 630a0e8b f26d0418
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1006,12 +1006,10 @@ public class TouchExplorer extends BaseEventStreamTransformation
                }
                break;
            case ACTION_POINTER_UP:
                if (event.getPointerId(GestureUtils.getActionIndex(event)) == mDraggingPointerId) {
                    mDraggingPointerId = INVALID_POINTER_ID;
                    // Send an event to the end of the drag gesture.
                    mDispatcher.sendMotionEvent(
                            event, ACTION_UP, rawEvent, pointerIdBits, policyFlags);
                }
                break;
            case ACTION_UP:
                if (event.getPointerId(GestureUtils.getActionIndex(event)) == mDraggingPointerId) {
@@ -1146,6 +1144,10 @@ public class TouchExplorer extends BaseEventStreamTransformation
     * closet to an edge of the screen.
     */
    private void computeDraggingPointerIdIfNeeded(MotionEvent event) {
        if (event.getPointerCount() != 2) {
            mDraggingPointerId = INVALID_POINTER_ID;
            return;
        }
        if (mDraggingPointerId != INVALID_POINTER_ID) {
            // If we have a valid pointer ID, we should be good
            final int pointerIndex = event.findPointerIndex(mDraggingPointerId);