AccessibilityServiceInfoCompat

public final class AccessibilityServiceInfoCompat
extends Object

java.lang.Object
   ↳ androidx.core.accessibilityservice.AccessibilityServiceInfoCompat


Helper for accessing features in AccessibilityServiceInfo.

Summary

Constants

int CAPABILITY_CAN_FILTER_KEY_EVENTS

Capability: This accessibility service can filter the key event stream.

int CAPABILITY_CAN_REQUEST_ENHANCED_WEB_ACCESSIBILITY

Capability: This accessibility service can request enhanced web accessibility enhancements.

int CAPABILITY_CAN_REQUEST_TOUCH_EXPLORATION

Capability: This accessibility service can request touch exploration mode in which touched items are spoken aloud and the UI can be explored via gestures.

int CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT

Capability: This accessibility service can retrieve the active window content.

int FEEDBACK_ALL_MASK

Mask for all feedback types.

int FEEDBACK_BRAILLE

Denotes braille feedback.

int FLAG_INCLUDE_NOT_IMPORTANT_VIEWS

If this flag is set the system will regard views that are not important for accessibility in addition to the ones that are important for accessibility.

int FLAG_REPORT_VIEW_IDS

This flag requests that the AccessibilityNodeInfos obtained by an AccessibilityService contain the id of the source view.

int FLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY

This flag requests from the system to enable web accessibility enhancing extensions.

int FLAG_REQUEST_FILTER_KEY_EVENTS

This flag requests from the system to filter key events.

int FLAG_REQUEST_TOUCH_EXPLORATION_MODE

This flag requests that the system gets into touch exploration mode.

Public methods

static String capabilityToString(int capability)

Returns the string representation of a capability.

static String feedbackTypeToString(int feedbackType)

Returns the string representation of a feedback type.

static String flagToString(int flag)

Returns the string representation of a flag.

static int getCapabilities(AccessibilityServiceInfo info)

Returns the bit mask of capabilities this accessibility service has such as being able to retrieve the active window content, etc.

static String loadDescription(AccessibilityServiceInfo info, PackageManager packageManager)

The localized description of the accessibility service.

Inherited methods

Constants

CAPABILITY_CAN_FILTER_KEY_EVENTS

public static final int CAPABILITY_CAN_FILTER_KEY_EVENTS

Capability: This accessibility service can filter the key event stream.

Constant Value: 8 (0x00000008)

CAPABILITY_CAN_REQUEST_ENHANCED_WEB_ACCESSIBILITY

public static final int CAPABILITY_CAN_REQUEST_ENHANCED_WEB_ACCESSIBILITY

Capability: This accessibility service can request enhanced web accessibility enhancements. For example, installing scripts to make app content more accessible.

Constant Value: 4 (0x00000004)

CAPABILITY_CAN_REQUEST_TOUCH_EXPLORATION

public static final int CAPABILITY_CAN_REQUEST_TOUCH_EXPLORATION

Capability: This accessibility service can request touch exploration mode in which touched items are spoken aloud and the UI can be explored via gestures.

Constant Value: 2 (0x00000002)

CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT

public static final int CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT

Capability: This accessibility service can retrieve the active window content.

Constant Value: 1 (0x00000001)

FEEDBACK_BRAILLE

public static final int FEEDBACK_BRAILLE

Denotes braille feedback.

Constant Value: 32 (0x00000020)

FLAG_INCLUDE_NOT_IMPORTANT_VIEWS

public static final int FLAG_INCLUDE_NOT_IMPORTANT_VIEWS

If this flag is set the system will regard views that are not important for accessibility in addition to the ones that are important for accessibility. That is, views that are marked as not important for accessibility via View.IMPORTANT_FOR_ACCESSIBILITY_NO or View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS and views that are marked as potentially important for accessibility via View.IMPORTANT_FOR_ACCESSIBILITY_AUTO for which the system has determined that are not important for accessibility, are both reported while querying the window content and also the accessibility service will receive accessibility events from them.

Note: For accessibility services targeting API version Build.VERSION_CODES.JELLY_BEAN or higher this flag has to be explicitly set for the system to regard views that are not important for accessibility. For accessibility services targeting API version lower than Build.VERSION_CODES.JELLY_BEAN this flag is ignored and all views are regarded for accessibility purposes.

Usually views not important for accessibility are layout managers that do not react to user actions, do not draw any content, and do not have any special semantics in the context of the screen content. For example, a three by three grid can be implemented as three horizontal linear layouts and one vertical, or three vertical linear layouts and one horizontal, or one grid layout, etc. In this context the actual layout mangers used to achieve the grid configuration