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

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

Merge "Frameworks: fixes possible invalid pointer index call."

parents 119abb21 2585e9bd
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -2888,7 +2888,11 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
        }

        case MotionEvent.ACTION_MOVE: {
            final int pointerIndex = ev.findPointerIndex(mActivePointerId);
            int pointerIndex = ev.findPointerIndex(mActivePointerId);
            if (pointerIndex == -1) {
                pointerIndex = 0;
                mActivePointerId = ev.getPointerId(pointerIndex);
            }
            final int y = (int) ev.getY(pointerIndex);
            deltaY = y - mMotionY;
            switch (mTouchMode) {
@@ -3464,7 +3468,11 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
        case MotionEvent.ACTION_MOVE: {
            switch (mTouchMode) {
            case TOUCH_MODE_DOWN:
                final int pointerIndex = ev.findPointerIndex(mActivePointerId);
                int pointerIndex = ev.findPointerIndex(mActivePointerId);
                if (pointerIndex == -1) {
                    pointerIndex = 0;
                    mActivePointerId = ev.getPointerId(pointerIndex);
                }
                final int y = (int) ev.getY(pointerIndex);
                if (startScrollIfNeeded(y - mMotionY)) {
                    return true;