From 4c6a4ce03bb5b20103a656948a1932f2894e7f56 Mon Sep 17 00:00:00 2001 From: Svetoslav Date: Wed, 17 Sep 2014 17:17:50 -0700 Subject: [PATCH] Some accessibility events wrongly filtered out (regression). We added new APIs to allow accessibility services to query all windows a user can touch. Sometimes the window state change event arrives before the window manager sent over the new window state which leads to a case that the app gets the event and asks for the window and the window is not there. To address this if we do not have the window, we hold on to the event and fire it as soon as the window arrives. This logic is correct except we were wrongly expecting that the window should have input focus. bug:17464645 Change-Id: I1ef50ebddeb4416a6c0776b096bb16aee703700c --- .../server/accessibility/AccessibilityManagerService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java index ebe21ff58da5b..24bfba640c590 100644 --- a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java +++ b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java @@ -3277,7 +3277,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { // 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 || !window.isFocused()) { + if (window == null) { mShowingFocusedWindowEvent = AccessibilityEvent.obtain(event); return false; } @@ -3377,7 +3377,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { if (mShowingFocusedWindowEvent != null) { final int windowId = mShowingFocusedWindowEvent.getWindowId(); AccessibilityWindowInfo window = findWindowById(windowId); - if (window != null && window.isFocused()) { + if (window != null) { // Sending does the recycle. sendAccessibilityEvent(mShowingFocusedWindowEvent, mCurrentUserId); }