Search in sources :

Example 1 with AccessibilityService

use of android.accessibilityservice.AccessibilityService in project Auto.js by hyb1996.

the class SimpleActionAutomator method performGlobalAction.

private boolean performGlobalAction(final int action) {
    ensureAccessibilityServiceEnabled();
    AccessibilityService service = mAccessibilityBridge.getService();
    if (service == null)
        return false;
    return service.performGlobalAction(action);
}
Also used : AccessibilityService(android.accessibilityservice.AccessibilityService)

Example 2 with AccessibilityService

use of android.accessibilityservice.AccessibilityService in project android_frameworks_base by ParanoidAndroid.

the class AccessibilityManagerService method notifyAccessibilityServicesDelayedLocked.

/**
     * Performs {@link AccessibilityService}s delayed notification. The delay is configurable
     * and denotes the period after the last event before notifying the service.
     *
     * @param event The event.
     * @param isDefault True to notify default listeners, not default services.
     */
private void notifyAccessibilityServicesDelayedLocked(AccessibilityEvent event, boolean isDefault) {
    try {
        UserState state = getCurrentUserStateLocked();
        for (int i = 0, count = state.mBoundServices.size(); i < count; i++) {
            Service service = state.mBoundServices.get(i);
            if (service.mIsDefault == isDefault) {
                if (canDispathEventLocked(service, event, state.mHandledFeedbackTypes)) {
                    state.mHandledFeedbackTypes |= service.mFeedbackType;
                    service.notifyAccessibilityEvent(event);
                }
            }
        }
    } catch (IndexOutOfBoundsException oobe) {
        // there are no more services to notify.
        return;
    }
}
Also used : AccessibilityService(android.accessibilityservice.AccessibilityService) IStatusBarService(com.android.internal.statusbar.IStatusBarService) Point(android.graphics.Point)

Aggregations

AccessibilityService (android.accessibilityservice.AccessibilityService)2 Point (android.graphics.Point)1 IStatusBarService (com.android.internal.statusbar.IStatusBarService)1