Skip to content

Commit

Permalink
little modify
Browse files Browse the repository at this point in the history
  • Loading branch information
codeskyblue committed Mar 9, 2018
1 parent c48b665 commit d7eacad
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,18 @@ public DeviceInfo deviceInfo() {
public void setAccessibilityPatterns(HashMap<String, String[]> patterns) {
String[] packageNames = patterns.keySet().toArray(new String[patterns.size()]);
for (String name : packageNames) {
Log.d("Accessibility package names " + name);
Log.d("Accessibility package name " + name);
}
AccessibilityServiceInfo serviceInfo = uiAutomation.getServiceInfo();
serviceInfo.packageNames = packageNames;
serviceInfo.eventTypes = AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED | AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED;
serviceInfo.notificationTimeout = 500;
uiAutomation.setServiceInfo(serviceInfo);
uiAutomation.setOnAccessibilityEventListener(new EventListener(patterns));
if (patterns.isEmpty()){
uiAutomation.setOnAccessibilityEventListener(null);
} else {
uiAutomation.setOnAccessibilityEventListener(new EventListener(patterns));
}
}

@Override
Expand Down

0 comments on commit d7eacad

Please sign in to comment.