Merge "Fix pointer index out of range exception"

This commit is contained in:
Craig Mautner
2014-12-01 00:13:27 +00:00
committed by Gerrit Code Review

View File

@@ -57,6 +57,7 @@ public class StackTapPointerEventListener implements PointerEventListener {
if (mPointerId >= 0) { if (mPointerId >= 0) {
int index = motionEvent.findPointerIndex(mPointerId); int index = motionEvent.findPointerIndex(mPointerId);
if ((motionEvent.getEventTime() - motionEvent.getDownTime()) > TAP_TIMEOUT_MSEC if ((motionEvent.getEventTime() - motionEvent.getDownTime()) > TAP_TIMEOUT_MSEC
|| index < 0
|| Math.abs(motionEvent.getX(index) - mDownX) > mMotionSlop || Math.abs(motionEvent.getX(index) - mDownX) > mMotionSlop
|| Math.abs(motionEvent.getY(index) - mDownY) > mMotionSlop) { || Math.abs(motionEvent.getY(index) - mDownY) > mMotionSlop) {
mPointerId = -1; mPointerId = -1;