diff options
author | Svetoslav Ganov <svetoslavganov@google.com> | 2012-06-14 10:48:09 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-06-14 10:48:09 -0700 |
commit | 9b1767bbb451e96ae6b2216a7ea26aa4a937ad55 (patch) | |
tree | c85dd3f1e5939853a7bd2ab6ea1f5b55e8d87f5b /services/java/com/android/server | |
parent | 52d3465d0503a3362ec9335ae3de8e23b2ae75a3 (diff) | |
parent | 5d043ce8cc2f588fdfb336cc843fb3b07b196f83 (diff) | |
download | frameworks_base-9b1767bbb451e96ae6b2216a7ea26aa4a937ad55.zip frameworks_base-9b1767bbb451e96ae6b2216a7ea26aa4a937ad55.tar.gz frameworks_base-9b1767bbb451e96ae6b2216a7ea26aa4a937ad55.tar.bz2 |
Merge "Active window not updated window not updated properly." into jb-dev
Diffstat (limited to 'services/java/com/android/server')
-rw-r--r-- | services/java/com/android/server/accessibility/TouchExplorer.java | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/services/java/com/android/server/accessibility/TouchExplorer.java b/services/java/com/android/server/accessibility/TouchExplorer.java index a8296f8..152e188 100644 --- a/services/java/com/android/server/accessibility/TouchExplorer.java +++ b/services/java/com/android/server/accessibility/TouchExplorer.java @@ -312,9 +312,9 @@ public class TouchExplorer { switch (eventType) { case AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED: case AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED: { - if (mInjectedPointerTracker.mLastInjectedHoverEvent != null) { - mInjectedPointerTracker.mLastInjectedHoverEvent.recycle(); - mInjectedPointerTracker.mLastInjectedHoverEvent = null; + if (mInjectedPointerTracker.mLastInjectedHoverEventForClick != null) { + mInjectedPointerTracker.mLastInjectedHoverEventForClick.recycle(); + mInjectedPointerTracker.mLastInjectedHoverEventForClick = null; } mLastTouchedWindowId = -1; } break; @@ -1077,7 +1077,8 @@ public class TouchExplorer { final int pointerId = secondTapUp.getPointerId(secondTapUp.getActionIndex()); final int pointerIndex = secondTapUp.findPointerIndex(pointerId); - MotionEvent lastExploreEvent = mInjectedPointerTracker.getLastInjectedHoverEvent(); + MotionEvent lastExploreEvent = + mInjectedPointerTracker.getLastInjectedHoverEventForClick(); if (lastExploreEvent == null) { // No last touch explored event but there is accessibility focus in // the active window. We click in the middle of the focus bounds. @@ -1328,7 +1329,8 @@ public class TouchExplorer { final int pointerId = mEvent.getPointerId(mEvent.getActionIndex()); final int pointerIndex = mEvent.findPointerIndex(pointerId); - MotionEvent lastExploreEvent = mInjectedPointerTracker.getLastInjectedHoverEvent(); + MotionEvent lastExploreEvent = + mInjectedPointerTracker.getLastInjectedHoverEventForClick(); if (lastExploreEvent == null) { // No last touch explored event but there is accessibility focus in // the active window. We click in the middle of the focus bounds. @@ -1482,6 +1484,9 @@ public class TouchExplorer { // The last injected hover event. private MotionEvent mLastInjectedHoverEvent; + // The last injected hover event used for performing clicks. + private MotionEvent mLastInjectedHoverEventForClick; + /** * Processes an injected {@link MotionEvent} event. * @@ -1513,6 +1518,10 @@ public class TouchExplorer { mLastInjectedHoverEvent.recycle(); } mLastInjectedHoverEvent = MotionEvent.obtain(event); + if (mLastInjectedHoverEventForClick != null) { + mLastInjectedHoverEventForClick.recycle(); + } + mLastInjectedHoverEventForClick = MotionEvent.obtain(event); } break; } if (DEBUG) { @@ -1566,6 +1575,13 @@ public class TouchExplorer { return mLastInjectedHoverEvent; } + /** + * @return The the last injected hover event. + */ + public MotionEvent getLastInjectedHoverEventForClick() { + return mLastInjectedHoverEventForClick; + } + @Override public String toString() { StringBuilder builder = new StringBuilder(); |