summaryrefslogtreecommitdiffstats
path: root/core/java/android/accessibilityservice
diff options
context:
space:
mode:
authorSvetoslav <svetoslavganov@google.com>2014-06-12 11:29:35 -0700
committerSvetoslav <svetoslavganov@google.com>2014-06-12 12:11:39 -0700
commitf7174e87b6007000777b0124de9cef70d8618788 (patch)
tree47d9f60bdc9b0d72d7c247d24e84527143847998 /core/java/android/accessibilityservice
parent02a9c359a1a6e1175cdd2d560f97be9cdb816a0e (diff)
downloadframeworks_base-f7174e87b6007000777b0124de9cef70d8618788.zip
frameworks_base-f7174e87b6007000777b0124de9cef70d8618788.tar.gz
frameworks_base-f7174e87b6007000777b0124de9cef70d8618788.tar.bz2
Fix backwards compatibility for introspected windows.
1. The APIs for introspecting interactive windows were reporting only the touchable windows but were missing the focused window. The user can interact with the latter by typing, hence it should always be reported. Also this was breaking backwards compatibility as if the focused window is covered by a modal one, the focused window was not reporeted and this was putting the active window in a bad state as the latter is either the focused window or the one the user is touching. 2. Window change events are too frequent as on window transition things are chanign a lot. Now we are trottling the windows changed events at the standard recurring accessibility event interval. 3. Fixed a wrong flag comparison and removed some unneded code. buy:15434666 bug:15432989 Change-Id: I825b33067e8cbf26396a4d38642bde4907b6427a
Diffstat (limited to 'core/java/android/accessibilityservice')
-rw-r--r--core/java/android/accessibilityservice/AccessibilityService.java4
-rw-r--r--core/java/android/accessibilityservice/AccessibilityServiceInfo.java4
2 files changed, 5 insertions, 3 deletions
diff --git a/core/java/android/accessibilityservice/AccessibilityService.java b/core/java/android/accessibilityservice/AccessibilityService.java
index 2620c44..cbc8150 100644
--- a/core/java/android/accessibilityservice/AccessibilityService.java
+++ b/core/java/android/accessibilityservice/AccessibilityService.java
@@ -462,7 +462,9 @@ public abstract class AccessibilityService extends Service {
* anything behind it, then only the modal window will be reported
* (assuming it is the top one). For convenience the returned windows
* are ordered in a descending layer order, which is the windows that
- * are higher in the Z-order are reported first.
+ * are higher in the Z-order are reported first. Since the user can always
+ * interact with the window that has input focus by typing, the focused
+ * window is always returned (even if covered by a modal window).
* <p>
* <strong>Note:</strong> In order to access the windows your service has
* to declare the capability to retrieve window content by setting the
diff --git a/core/java/android/accessibilityservice/AccessibilityServiceInfo.java b/core/java/android/accessibilityservice/AccessibilityServiceInfo.java
index 4f9ba59..4edb0c6 100644
--- a/core/java/android/accessibilityservice/AccessibilityServiceInfo.java
+++ b/core/java/android/accessibilityservice/AccessibilityServiceInfo.java
@@ -286,8 +286,8 @@ public class AccessibilityServiceInfo implements Parcelable {
/**
* This flag indicates to the system that the accessibility service wants
* to access content of all interactive windows. An interactive window is a
- * window that can be touched by a sighted user when explore by touch is not
- * enabled. If this flag is not set your service will not receive
+ * window that has input focus or can be touched by a sighted user when explore
+ * by touch is not enabled. If this flag is not set your service will not receive
* {@link android.view.accessibility.AccessibilityEvent#TYPE_WINDOWS_CHANGED}
* events, calling AccessibilityService{@link AccessibilityService#getWindows()
* AccessibilityService.getWindows()} will return an empty list, and {@link