summaryrefslogtreecommitdiffstats
path: root/core/java/android/accessibilityservice
diff options
context:
space:
mode:
authorSvetoslav <svetoslavganov@google.com>2013-04-22 18:34:02 -0700
committerSvetoslav <svetoslavganov@google.com>2013-04-23 17:44:00 -0700
commitdb7da0eb8b7d515c168d5b410764e24c9a0f9431 (patch)
tree203e63c36f247904943614120e4772689ee762d5 /core/java/android/accessibilityservice
parentea236f19e652942a7af384566c70cdd0c7f88c58 (diff)
downloadframeworks_base-db7da0eb8b7d515c168d5b410764e24c9a0f9431.zip
frameworks_base-db7da0eb8b7d515c168d5b410764e24c9a0f9431.tar.gz
frameworks_base-db7da0eb8b7d515c168d5b410764e24c9a0f9431.tar.bz2
Fixing bugs exposed when moving accessibility CTS tests to UiAutomation.
1. UiAutomation#executeAndWaitForEvent method was invoking the passed runnable while holding the lock which may lead to a deadlock. For example: a runnable that calls getActivity() gets us into a state like this. 2. UI automation services did not get all capabilities such a service can have. Now a UI test service gets all of them. 3. When UiAutomation was exiting for event fired as a result of a performed action, it was checking whether the received evnet time is strictly before the time of executing the command that should fire the event. However, if the execution is fast enough, i.e. less than one millisecond, then the event time and the execution time are the same. This was leading to a missed signal in rare cases. 4. AccessibilityNodeInfoCache was not clearing the relevant state for accessibility focus clearing event. 5. Accessibility text traversal in TextView was partially using text and partially content description - broken. Now we are using the text since for text view and content desc for other views. In other words, we are using the most precise text we have. 6. AccessibilityManagerService was not granting capabilities of a UiAutomation service - plainly wrong. CTS change:https://googleplex-android-review.googlesource.com/#/c/300693/ bug:8695422 bug:8657560 Change-Id: I9afc5c3c69eb51f1c01930959232f44681b15e86
Diffstat (limited to 'core/java/android/accessibilityservice')
-rw-r--r--core/java/android/accessibilityservice/AccessibilityServiceInfo.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/core/java/android/accessibilityservice/AccessibilityServiceInfo.java b/core/java/android/accessibilityservice/AccessibilityServiceInfo.java
index 40f45b7..7e21db3 100644
--- a/core/java/android/accessibilityservice/AccessibilityServiceInfo.java
+++ b/core/java/android/accessibilityservice/AccessibilityServiceInfo.java
@@ -378,6 +378,23 @@ public class AccessibilityServiceInfo implements Parcelable {
/**
* Creates a new instance.
*
+ * @param isAutomation Whether this is a test automation service.
+ *
+ * @hide
+ */
+ public AccessibilityServiceInfo(boolean isAutomation) {
+ // Automation service can do anything.
+ if (isAutomation) {
+ mCapabilities |= CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT
+ | CAPABILITY_CAN_REQUEST_TOUCH_EXPLORATION
+ | CAPABILITY_CAN_REQUEST_ENHANCED_WEB_ACCESSIBILITY
+ | CAPABILITY_CAN_REQUEST_FILTER_KEY_EVENTS;
+ }
+ }
+
+ /**
+ * Creates a new instance.
+ *
* @param resolveInfo The service resolve info.
* @param context Context for accessing resources.
* @throws XmlPullParserException If a XML parsing error occurs.