Skip to content

Commit 2e1c66b

Browse files
committed
Dragging in touch explore mode should not become exploring.
In touch exploration two fingers in the same direction drag and if one of them goes up the other starts to touch explore. This however causes inadvertent touch exploring to happen on almost every scroll causing confusion. Now two finger drag and they should both go up to allow exploring. This way the inadvertent exploring is gone and user experience is much better. bug:5440411 Change-Id: Id8aaece92e5dea1fc740400d2adc9dd63a1674e4
1 parent 99f3668 commit 2e1c66b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,9 @@ private void handleMotionEventStateDragging(MotionEvent event, int policyFlags)
457457
case MotionEvent.ACTION_MOVE: {
458458
final int activePointerCount = mPointerTracker.getActivePointerCount();
459459
switch (activePointerCount) {
460+
case 1: {
461+
// do nothing
462+
} break;
460463
case 2: {
461464
if (isDraggingGesture(event)) {
462465
// If still dragging send a drag event.
@@ -484,10 +487,12 @@ private void handleMotionEventStateDragging(MotionEvent event, int policyFlags)
484487
}
485488
} break;
486489
case MotionEvent.ACTION_POINTER_UP: {
487-
mCurrentState = STATE_TOUCH_EXPLORING;
488490
// Send an event to the end of the drag gesture.
489491
sendMotionEvent(event, MotionEvent.ACTION_UP, pointerIdBits, policyFlags);
490492
} break;
493+
case MotionEvent.ACTION_UP: {
494+
mCurrentState = STATE_TOUCH_EXPLORING;
495+
} break;
491496
case MotionEvent.ACTION_CANCEL: {
492497
clear();
493498
} break;
@@ -500,7 +505,7 @@ private void handleMotionEventStateDragging(MotionEvent event, int policyFlags)
500505
* @param event The event to be handled.
501506
* @param policyFlags The policy flags associated with the event.
502507
*/
503-
public void handleMotionEventStateDelegating(MotionEvent event, int policyFlags) {
508+
private void handleMotionEventStateDelegating(MotionEvent event, int policyFlags) {
504509
switch (event.getActionMasked()) {
505510
case MotionEvent.ACTION_DOWN: {
506511
throw new IllegalStateException("Delegating state can only be reached if "

0 commit comments

Comments
 (0)