Skip to content

Commit d8581c7

Browse files
committed
TouchExplorer crashes if there is incative pointer while dragging.
The TouchExplorer was not taking into account the case with incative pointers while dragging. If one puts a finger down and then perfroms a dragging gestore the explorer tries to inject UP event for the end of the gesture upon every of the two dragging pointers going up instead only for one the first went up. bug:5476098 Change-Id: I20d2dd7bde7e016b0678a35d14cd068d9ff37023
1 parent 11116b8 commit d8581c7

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)