diff options
author | Svetoslav Ganov <svetoslavganov@google.com> | 2012-10-10 14:15:13 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-10-10 14:15:14 -0700 |
commit | 9ea6343fa4dc6c0e2144880594fa7a80f94c31f3 (patch) | |
tree | 69c90921154bd9ac84e9682dcf9fe6231d169f6d /services | |
parent | fa5bc081593891959c143e0de9e59dd076a47b42 (diff) | |
parent | 6ae8a24fc045bc7970f2843fa9baf06aff15e22d (diff) | |
download | frameworks_base-9ea6343fa4dc6c0e2144880594fa7a80f94c31f3.zip frameworks_base-9ea6343fa4dc6c0e2144880594fa7a80f94c31f3.tar.gz frameworks_base-9ea6343fa4dc6c0e2144880594fa7a80f94c31f3.tar.bz2 |
Merge "The active window for accessibility purposes can be miscomputed." into jb-mr1-dev
Diffstat (limited to 'services')
-rw-r--r-- | services/java/com/android/server/accessibility/AccessibilityManagerService.java | 16 | ||||
-rw-r--r-- | services/java/com/android/server/accessibility/TouchExplorer.java | 1 |
2 files changed, 16 insertions, 1 deletions
diff --git a/services/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/java/com/android/server/accessibility/AccessibilityManagerService.java index 3d77b3a..7c482f5 100644 --- a/services/java/com/android/server/accessibility/AccessibilityManagerService.java +++ b/services/java/com/android/server/accessibility/AccessibilityManagerService.java @@ -643,6 +643,10 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { return mSecurityPolicy.mActiveWindowId; } + void onTouchInteractionStart() { + mSecurityPolicy.onTouchInteractionStart(); + } + void onTouchInteractionEnd() { mSecurityPolicy.onTouchInteractionEnd(); } @@ -2138,6 +2142,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { | AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED; private int mActiveWindowId; + private boolean mTouchInteractionInProgress; private boolean canDispatchAccessibilityEvent(AccessibilityEvent event) { final int eventType = event.getEventType(); @@ -2185,12 +2190,21 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { } } break; case AccessibilityEvent.TYPE_VIEW_HOVER_ENTER: { - mActiveWindowId = windowId; + // Do not allow delayed hover events to confuse us + // which the active window is. + if (mTouchInteractionInProgress) { + mActiveWindowId = windowId; + } } break; } } + public void onTouchInteractionStart() { + mTouchInteractionInProgress = true; + } + public void onTouchInteractionEnd() { + mTouchInteractionInProgress = false; // We want to set the active window to be current immediately // after the user has stopped touching the screen since if the // user types with the IME he should get a feedback for the diff --git a/services/java/com/android/server/accessibility/TouchExplorer.java b/services/java/com/android/server/accessibility/TouchExplorer.java index 2688776..dcf87350 100644 --- a/services/java/com/android/server/accessibility/TouchExplorer.java +++ b/services/java/com/android/server/accessibility/TouchExplorer.java @@ -398,6 +398,7 @@ class TouchExplorer implements EventStreamTransformation { switch (event.getActionMasked()) { case MotionEvent.ACTION_DOWN: + mAms.onTouchInteractionStart(); // Pre-feed the motion events to the gesture detector since we // have a distance slop before getting into gesture detection // mode and not using the points within this slop significantly |