summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Svetoslav Ganov <svetoslavganov@google.com> 2012-10-03 17:00:18 -0700
committer Svetoslav Ganov <svetoslavganov@google.com> 2012-10-03 17:05:57 -0700
commitec33d56300aa417efb4a055786d73d1bf23a6a85 (patch)
tree799051fa73e8f2f7dd7c750809444ec5986df63b
parent26884df75c69587561e397ec4da6b5b463e37fe9 (diff)
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
-rw-r--r--services/java/com/android/server/accessibility/TouchExplorer.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/services/java/com/android/server/accessibility/TouchExplorer.java b/services/java/com/android/server/accessibility/TouchExplorer.java
index c9f89b162ec8..2d81b6c61e4c 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: {