diff options
author | Svetoslav Ganov <svetoslavganov@google.com> | 2012-10-02 14:16:08 -0700 |
---|---|---|
committer | Svetoslav Ganov <svetoslavganov@google.com> | 2012-10-02 14:33:27 -0700 |
commit | aeb8d0ed0d98d398a66a092c418f4f2bca8719e0 (patch) | |
tree | f2205d1c13a56ac161e19c19bf3f7a16dd9c7484 /services/java/com | |
parent | 0944d625448209185452eb4e800daec49de51986 (diff) | |
download | frameworks_base-aeb8d0ed0d98d398a66a092c418f4f2bca8719e0.zip frameworks_base-aeb8d0ed0d98d398a66a092c418f4f2bca8719e0.tar.gz frameworks_base-aeb8d0ed0d98d398a66a092c418f4f2bca8719e0.tar.bz2 |
Up motion event not injected by the touch explorer at the end of a drag.
1. The up event was not injected when the last pointer went up, i.e.
at the end of the drag. This patch sends an up event if the dragging
pointer goes up for both cases, when the dragging pointer goes up
first and when it goes up second.
bug:7272830
Change-Id: I708a2b93ee2d0a4c46dbeea002841666e919602d
Diffstat (limited to 'services/java/com')
-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: { |