From ec33d56300aa417efb4a055786d73d1bf23a6a85 Mon Sep 17 00:00:00 2001 From: Svetoslav Ganov Date: Wed, 3 Oct 2012 17:00:18 -0700 Subject: [PATCH] Exception in the touch explorer when dragging. 1. During a drag in touch exploration we have two pointers moving in the same direction but inject only one of them. If the dragging pointer goes up we send an up to the view system and wait for all pointers to go up to transition to touch exploring state. At this point the dragging pointer id is cleared and if a new pointer goes down we are trying to send up (rather do nothing) for the dragging pointer which we already did and due to the invalid pointer id we get an exception when splitting the motion event. bug:7282053 Change-Id: I690bf8bdf6e2e5851ee46a322c4a1bb7d484b53a --- .../java/com/android/server/accessibility/TouchExplorer.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/java/com/android/server/accessibility/TouchExplorer.java b/services/java/com/android/server/accessibility/TouchExplorer.java index c9f89b162ec87..2d81b6c61e4ca 100644 --- a/services/java/com/android/server/accessibility/TouchExplorer.java +++ b/services/java/com/android/server/accessibility/TouchExplorer.java @@ -645,7 +645,9 @@ class TouchExplorer implements EventStreamTransformation { // We are in dragging state so we have two pointers and another one // goes down => delegate the three pointers to the view hierarchy mCurrentState = STATE_DELEGATING; - sendMotionEvent(event, MotionEvent.ACTION_UP, pointerIdBits, policyFlags); + if (mDraggingPointerId != INVALID_POINTER_ID) { + sendMotionEvent(event, MotionEvent.ACTION_UP, pointerIdBits, policyFlags); + } sendDownForAllActiveNotInjectedPointers(event, policyFlags); } break; case MotionEvent.ACTION_MOVE: {