diff options
author | Svetoslav Ganov <svetoslavganov@google.com> | 2012-10-02 16:27:06 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-10-02 16:36:29 -0700 |
commit | 9bfb8bcfeb585c1692830ff91a36afa852455cf7 (patch) | |
tree | 2f133d76f32e809bc8f975793fddf3920fdccea4 | |
parent | 046184f97aa71bd36a11b9d2cd27dafe2d29d246 (diff) | |
parent | aeb8d0ed0d98d398a66a092c418f4f2bca8719e0 (diff) | |
download | frameworks_base-9bfb8bcfeb585c1692830ff91a36afa852455cf7.zip frameworks_base-9bfb8bcfeb585c1692830ff91a36afa852455cf7.tar.gz frameworks_base-9bfb8bcfeb585c1692830ff91a36afa852455cf7.tar.bz2 |
Merge "Up motion event not injected by the touch explorer at the end of a drag." into jb-mr1-dev
-rw-r--r-- | services/java/com/android/server/accessibility/TouchExplorer.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/services/java/com/android/server/accessibility/TouchExplorer.java b/services/java/com/android/server/accessibility/TouchExplorer.java index 616bc13..c9f89b1 100644 --- a/services/java/com/android/server/accessibility/TouchExplorer.java +++ b/services/java/com/android/server/accessibility/TouchExplorer.java @@ -198,7 +198,7 @@ class TouchExplorer implements EventStreamTransformation { private GestureLibrary mGestureLibrary; // The long pressing pointer id if coordinate remapping is needed. - private int mLongPressingPointerId; + private int mLongPressingPointerId = -1; // The long pressing pointer X if coordinate remapping is needed. private int mLongPressingPointerDeltaX; @@ -702,10 +702,24 @@ class TouchExplorer implements EventStreamTransformation { } } } break; + case MotionEvent.ACTION_POINTER_UP: { + final int pointerId = event.getPointerId(event.getActionIndex()); + if (pointerId == mDraggingPointerId) { + mDraggingPointerId = INVALID_POINTER_ID; + // Send an event to the end of the drag gesture. + sendMotionEvent(event, MotionEvent.ACTION_UP, pointerIdBits, policyFlags); + } + } break; case MotionEvent.ACTION_UP: { // Announce the end of a new touch interaction. sendAccessibilityEvent( AccessibilityEvent.TYPE_TOUCH_INTERACTION_END); + final int pointerId = event.getPointerId(event.getActionIndex()); + if (pointerId == mDraggingPointerId) { + mDraggingPointerId = INVALID_POINTER_ID; + // Send an event to the end of the drag gesture. + sendMotionEvent(event, MotionEvent.ACTION_UP, pointerIdBits, policyFlags); + } mCurrentState = STATE_TOUCH_EXPLORING; } break; case MotionEvent.ACTION_CANCEL: { |