diff options
author | Svetoslav <svetoslavganov@google.com> | 2014-12-04 12:50:11 -0800 |
---|---|---|
committer | Svetoslav Ganov <svetoslavganov@google.com> | 2014-12-05 00:37:38 +0000 |
commit | 3a0d878ab56475276c61d574af7651820a5cea5a (patch) | |
tree | 52c7a0e7d8a075102a5797fcd6b000bd78971ed6 /services/accessibility | |
parent | bcaa315d488c18deb1ab4c6169dc4b4236982990 (diff) | |
download | frameworks_base-3a0d878ab56475276c61d574af7651820a5cea5a.zip frameworks_base-3a0d878ab56475276c61d574af7651820a5cea5a.tar.gz frameworks_base-3a0d878ab56475276c61d574af7651820a5cea5a.tar.bz2 |
Ensure all events from a showing window are dispatched.
Accessibility services may opt-in to introspect the interactive
windows on the screen. If window introspection is enabled there
is a case where some events from a showing window are received
before the updated window state from the window manager. Now the
window manager sends over the windows before notifying the app
for the focus change.
bug:18625996
Change-Id: Ic481e01efbe12dc92f090f799feeb236672fc7b3
Diffstat (limited to 'services/accessibility')
-rw-r--r-- | services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java index 2781890..89aebe8 100644 --- a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java +++ b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java @@ -3314,8 +3314,6 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { public int mAccessibilityFocusedWindowId = INVALID_WINDOW_ID; public long mAccessibilityFocusNodeId = AccessibilityNodeInfo.UNDEFINED_ITEM_ID; - public AccessibilityEvent mShowingFocusedWindowEvent; - private boolean mTouchInteractionInProgress; private boolean canDispatchAccessibilityEventLocked(AccessibilityEvent event) { @@ -3324,19 +3322,6 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { // All events that are for changes in a global window // state should *always* be dispatched. case AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED: - if (mWindowsForAccessibilityCallback != null) { - // OK, this is fun. Sometimes the focused window is notified - // it has focus before being shown. Historically this event - // means that the window is focused and can be introspected. - // But we still have not gotten the window state from the - // window manager, so delay the notification until then. - AccessibilityWindowInfo window = findWindowById(event.getWindowId()); - if (window == null) { - mShowingFocusedWindowEvent = AccessibilityEvent.obtain(event); - return false; - } - } - // $fall-through$ case AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED: case AccessibilityEvent.TYPE_ANNOUNCEMENT: // All events generated by the user touching the @@ -3428,18 +3413,6 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { } notifyWindowsChanged(); - - // If we are delaying a window state change event as the window - // source was showing when it was fired, now is the time to send. - if (mShowingFocusedWindowEvent != null) { - final int windowId = mShowingFocusedWindowEvent.getWindowId(); - AccessibilityWindowInfo window = findWindowById(windowId); - if (window != null) { - // Sending does the recycle. - sendAccessibilityEvent(mShowingFocusedWindowEvent, mCurrentUserId); - } - mShowingFocusedWindowEvent = null; - } } public boolean computePartialInteractiveRegionForWindowLocked(int windowId, |