AccessibilityServiceInfoCompat
class AccessibilityServiceInfoCompat
kotlin.Any | |
↳ | androidx.core.accessibilityservice.AccessibilityServiceInfoCompat |
Helper for accessing features in AccessibilityServiceInfo
.
Summary
Constants | |
---|---|
static Int |
Capability: This accessibility service can filter the key event stream. |
static Int |
Capability: This accessibility service can request enhanced web accessibility enhancements. |
static Int |
Capability: This accessibility service can request touch exploration mode in which touched items are spoken aloud and the UI can be explored via gestures. |
static Int |
Capability: This accessibility service can retrieve the active window content. |
static Int |
Mask for all feedback types. |
static Int |
Denotes braille feedback. |
static Int |
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. |
static Int |
This flag requests that the AccessibilityNodeInfos obtained by an |
static Int |
This flag requests from the system to enable web accessibility enhancing extensions. |
static Int |
This flag requests from the system to filter key events. |
static Int |
This flag requests that the system gets into touch exploration mode. |
Public methods | |
---|---|
static String |
capabilityToString(capability: Int) Returns the string representation of a capability. |
static String |
feedbackTypeToString(feedbackType: Int) Returns the string representation of a feedback type. |
static String? |
flagToString(flag: Int) Returns the string representation of a flag. |
static Int |
getCapabilities(@NonNull info: AccessibilityServiceInfo) Returns the bit mask of capabilities this accessibility service has such as being able to retrieve the active window content, etc. |
static String? |
loadDescription(@NonNull info: AccessibilityServiceInfo, @NonNull packageManager: PackageManager) The localized description of the accessibility service. |
Constants
CAPABILITY_CAN_FILTER_KEY_EVENTS
static val CAPABILITY_CAN_FILTER_KEY_EVENTS: Int
Capability: This accessibility service can filter the key event stream.
Value: 0x00000008
CAPABILITY_CAN_REQUEST_ENHANCED_WEB_ACCESSIBILITY
static val CAPABILITY_CAN_REQUEST_ENHANCED_WEB_ACCESSIBILITY: Int
Capability: This accessibility service can request enhanced web accessibility enhancements. For example, installing scripts to make app content more accessible.
Value: 0x00000004
CAPABILITY_CAN_REQUEST_TOUCH_EXPLORATION
static val CAPABILITY_CAN_REQUEST_TOUCH_EXPLORATION: Int
Capability: This accessibility service can request touch exploration mode in which touched items are spoken aloud and the UI can be explored via gestures.
Value: 0x00000002
CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT
static val CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT: Int
Capability: This accessibility service can retrieve the active window content.
Value: 0x00000001
FLAG_INCLUDE_NOT_IMPORTANT_VIEWS
static val FLAG_INCLUDE_NOT_IMPORTANT_VIEWS: Int
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 are not important, rather it is important that there are nine evenly distributed elements.
Value: 0x0000002
FLAG_REPORT_VIEW_IDS
static val FLAG_REPORT_VIEW_IDS: Int
This flag requests that the AccessibilityNodeInfos obtained by an AccessibilityService
contain the id of the source view. The source view id will be a fully qualified resource name of the form "package:id/name", for example "foo.bar:id/my_list", and it is useful for UI test automation. This flag is not set by default.
Value: 0x00000010
FLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY
static val FLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY: Int
This flag requests from the system to enable web accessibility enhancing extensions. Such extensions aim to provide improved accessibility support for content presented in a android.webkit.WebView
. An example of such an extension is injecting JavaScript from a secure so