Fix pointer index out of range exception DO NOT MERGE
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: tingna_sung <tingna_sung@htc.com> Fixes bug 18883936
This commit is contained in:
committed by
Craig Mautner
parent
f61bc8a262
commit
1ab7d3b9a8
@@ -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
|
||||
|| (motionEvent.getX(index) - mDownX) > mMotionSlop
|
||||
|| (motionEvent.getY(index) - mDownY) > mMotionSlop) {
|
||||
mPointerId = -1;
|
||||
|
||||
Reference in New Issue
Block a user