Code example for AccessibilityServiceInfo

0
 
    private Timer mTimer = new Timer();
 
    @Override 
    public void onServiceConnected() { 
        AccessibilityServiceInfo info = new AccessibilityServiceInfo();
        info.eventTypes = AccessibilityEvent.TYPES_ALL_MASK;
        info.feedbackType = AccessibilityServiceInfo.FEEDBACK_AUDIBLE;
        info.notificationTimeout = NOTIFICATION_TIMEOUT_MILLIS;
        info.flags &= AccessibilityServiceInfo.DEFAULT;
        setServiceInfo(info);
 
        // we need to wait until the system picks our configuration 
        // otherwise it will not notify us 
        mTimer.schedule(new TimerTask() {
            @Override 
            public void run() { 
                try { 
                    testAccessibilityEventDispatching(); 
                    testInterrupt();