Code example for AccessibilityServiceInfo

0
public class NotificationAccessibilityService extends AccessibilityService {
  public static final String TAG = Notifications.TAG;
 
  @Override 
  protected void onServiceConnected() { 
    AccessibilityServiceInfo info = new AccessibilityServiceInfo();
    info.eventTypes = AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED;
    info.feedbackType = AccessibilityServiceInfo.FEEDBACK_VISUAL;
    setServiceInfo(info);
 
    super.onServiceConnected(); 
  } 
 
  @Override 
  public void onAccessibilityEvent(AccessibilityEvent event) {
    Log.v(TAG, "onAccessibilityEvent " + event);
    if (event.getEventType() != AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED) {
      return; 
    }