Skip to content

Commit 601d581

Browse files
sganovAndroid (Google) Code Review
authored andcommitted
Merge "TouchExplorer crashes if there is incative pointer while dragging." into ics-mr0
2 parents 6d9d17f + d8581c7 commit 601d581

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

services/java/com/android/server/accessibility/TouchExplorer.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,8 +487,16 @@ private void handleMotionEventStateDragging(MotionEvent event, int policyFlags)
487487
}
488488
} break;
489489
case MotionEvent.ACTION_POINTER_UP: {
490-
// Send an event to the end of the drag gesture.
491-
sendMotionEvent(event, MotionEvent.ACTION_UP, pointerIdBits, policyFlags);
490+
final int activePointerCount = mPointerTracker.getActivePointerCount();
491+
switch (activePointerCount) {
492+
case 1: {
493+
// Send an event to the end of the drag gesture.
494+
sendMotionEvent(event, MotionEvent.ACTION_UP, pointerIdBits, policyFlags);
495+
} break;
496+
default: {
497+
mCurrentState = STATE_TOUCH_EXPLORING;
498+
}
499+
}
492500
} break;
493501
case MotionEvent.ACTION_UP: {
494502
mCurrentState = STATE_TOUCH_EXPLORING;

0 commit comments

Comments
 (0)