Skip to content

Commit df549f8

Browse files
committed
Make UiTestAutomationBridge see non-important views again
This problem was introduced in I74df9c24. The intention of the change was still let UiTestAutomationBridge see the non-important views, but there were bugs in the implementation: 1. AccessibilityManagerService was not really updating mIncludeNotImportantViews when mIsAutomation is true 2. Wrong constant is used to set the flag Change-Id: Ia0a2e9ed9720bd0ea3a563e0b492e870a6ec1586
1 parent bad417d commit df549f8

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

core/java/android/accessibilityservice/UiTestAutomationBridge.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public class UiTestAutomationBridge {
8383
* @return The event.
8484
*/
8585
public AccessibilityEvent getLastAccessibilityEvent() {
86-
return mLastEvent;
86+
return mLastEvent;
8787
}
8888

8989
/**
@@ -142,7 +142,7 @@ public void onServiceConnected() {
142142

143143
@Override
144144
public void onInterrupt() {
145-
UiTestAutomationBridge.this.onInterrupt();
145+
UiTestAutomationBridge.this.onInterrupt();
146146
}
147147

148148
@Override
@@ -189,7 +189,7 @@ public boolean onGesture(int gestureId) {
189189
final AccessibilityServiceInfo info = new AccessibilityServiceInfo();
190190
info.eventTypes = AccessibilityEvent.TYPES_ALL_MASK;
191191
info.feedbackType = AccessibilityServiceInfo.FEEDBACK_GENERIC;
192-
info.flags |= AccessibilityNodeInfo.INCLUDE_NOT_IMPORTANT_VIEWS;
192+
info.flags |= AccessibilityServiceInfo.INCLUDE_NOT_IMPORTANT_VIEWS;
193193

194194
try {
195195
manager.registerUiTestAutomationService(mListener, info);

services/java/com/android/server/accessibility/AccessibilityManagerService.java

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ public void onReceive(Context context, Intent intent) {
259259
updateInputFilterLocked();
260260
sendStateToClientsLocked();
261261
}
262-
262+
263263
return;
264264
}
265265

@@ -1266,16 +1266,13 @@ public void setDynamicallyConfigurableProperties(AccessibilityServiceInfo info)
12661266
mNotificationTimeout = info.notificationTimeout;
12671267
mIsDefault = (info.flags & DEFAULT) != 0;
12681268

1269-
if (!mIsAutomation) {
1270-
final int targetSdkVersion =
1271-
info.getResolveInfo().serviceInfo.applicationInfo.targetSdkVersion;
1272-
// TODO: Uncomment this line and remove the line below when JellyBean
1273-
// SDK version is finalized.
1274-
// if (targetSdkVersion >= Build.VERSION_CODES.JELLY_BEAN) {
1275-
if (targetSdkVersion > Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) {
1276-
mIncludeNotImportantViews =
1277-
(info.flags & INCLUDE_NOT_IMPORTANT_VIEWS) != 0;
1278-
}
1269+
if (mIsAutomation || info.getResolveInfo().serviceInfo.applicationInfo.targetSdkVersion
1270+
// TODO: Uncomment this line and remove the line below when JellyBean
1271+
// SDK version is finalized.
1272+
// >= Build.VERSION_CODES.JELLY_BEAN) {
1273+
> Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) {
1274+
mIncludeNotImportantViews =
1275+
(info.flags & INCLUDE_NOT_IMPORTANT_VIEWS) != 0;
12791276
}
12801277

12811278
synchronized (mLock) {

0 commit comments

Comments
 (0)