diff options
| author | Svet Ganov <svetoslavganov@google.com> | 2014-10-16 09:18:34 -0700 |
|---|---|---|
| committer | Svetoslav Ganov <svetoslavganov@google.com> | 2014-10-16 17:31:52 +0000 |
| commit | d5b0842a1ddbfc2ea5335854fe2834b6e9b965de (patch) | |
| tree | 9c1c123b2f2e782d89b9f5c6d57064c97457740c /services/accessibility/java/com/android | |
| parent | 70807ab128c544b972f3710e53eeedd0d40dce2a (diff) | |
| download | frameworks_base-d5b0842a1ddbfc2ea5335854fe2834b6e9b965de.zip frameworks_base-d5b0842a1ddbfc2ea5335854fe2834b6e9b965de.tar.gz frameworks_base-d5b0842a1ddbfc2ea5335854fe2834b6e9b965de.tar.bz2 | |
Send accessibility events with no window.
An app can send an accessibility event by calling the send methods
on view or directly asking the accessibility manager to do that.
While the recommened way to send such events is calling the methods
on view a legacy app or app whose developer did not read the docs
carefully may be calling the accessibility manager APIs directly.
In such a case the event does not have assigned window id and does
not get send. Since events fired by using the accessibility manager
directly lack context to determine whether thier source is important
for accessibility we assume they come from an important view to
avoid breaking backwards compatibility.
bug:18001711
Change-Id: Ie1c298fa5a0670cbeaedfcd64f820961c296b6ca
Diffstat (limited to 'services/accessibility/java/com/android')
| -rw-r--r-- | services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java index aff64e3..8ef5b04 100644 --- a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java +++ b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java @@ -148,6 +148,8 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { private static final int MAX_POOL_SIZE = 10; + private static final int WINDOW_ID_UNKNOWN = -1; + private static int sIdCounter = 0; private static int sNextWindowId; @@ -1079,7 +1081,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { return false; } - if (!event.isImportantForAccessibility() + if (event.getWindowId() != WINDOW_ID_UNKNOWN && !event.isImportantForAccessibility() && (service.mFetchFlags & AccessibilityNodeInfo.FLAG_INCLUDE_NOT_IMPORTANT_VIEWS) == 0) { return false; |
