我有一项服务正在运行以收集可访问性事件。在 Jelly Bean 中,它不会捕获 TYPE_NOTIFICATION_STATE_CHANGED 事件的任何变化。我按照教程进行操作,但没有...
这是我的代码:
@Override
protected void onServiceConnected() {
super.onServiceConnected();
AccessibilityServiceInfo localAccessibilityServiceInfo = new AccessibilityServiceInfo();
localAccessibilityServiceInfo.eventTypes = AccessibilityEvent.TYPES_ALL_MASK;
localAccessibilityServiceInfo.notificationTimeout = 80L;
localAccessibilityServiceInfo.feedbackType = AccessibilityServiceInfo.DEFAULT;
setServiceInfo(localAccessibilityServiceInfo);
}
@Override
public void onAccessibilityEvent(AccessibilityEvent event) {
if(event.getEventType() == AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED)
doSomething();
}