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

Commit bbb04b99 authored by Uday Kiran jandhyala's avatar Uday Kiran jandhyala Committed by Linux Build Service Account
Browse files

Added validity check for Pointer Index

Checking if the pointer index is valid before querying for X & Y
coordinates. This is done to avoid IllegalArgumentException.

Change-Id: Ic7f3022d33c313a0bfe8b55c9bc89019b33d23b7
parent 68274f52
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -56,6 +56,11 @@ public class StackTapPointerEventListener implements PointerEventListener {
            case MotionEvent.ACTION_MOVE:
                if (mPointerId >= 0) {
                    int index = motionEvent.findPointerIndex(mPointerId);
                    if (index < 0) {
                        mPointerId = -1;
                        break;
                    }

                    if ((motionEvent.getEventTime() - motionEvent.getDownTime()) > TAP_TIMEOUT_MSEC
                            || (motionEvent.getX(index) - mDownX) > mMotionSlop
                            || (motionEvent.getY(index) - mDownY) > mMotionSlop) {