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

Commit 4f65ca0f authored by tingna_sung's avatar tingna_sung
Browse files

Fix pointer index out of range exception



Avoid pointer index out of range error if return value is -1 of
findPointerIndex() when there is no data available for that pointer
identifier.

Change-Id: I2a08f04c678164e220852094baa124ba157e2e42
Signed-off-by: default avatartingna_sung <tingna_sung@htc.com>
parent 87c5f362
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ public class StackTapPointerEventListener implements PointerEventListener {
                if (mPointerId >= 0) {
                    int index = motionEvent.findPointerIndex(mPointerId);
                    if ((motionEvent.getEventTime() - motionEvent.getDownTime()) > TAP_TIMEOUT_MSEC
                            || index < 0
                            || Math.abs(motionEvent.getX(index) - mDownX) > mMotionSlop
                            || Math.abs(motionEvent.getY(index) - mDownY) > mMotionSlop) {
                        mPointerId = -1;