# AccessibilityServiceInfoCompat

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  
belongs to Maven artifact com.android.support:support-compat:28.0.0-alpha1  
Summary:[Constants](https://developer.android.com/reference/android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat#constants)\|[Methods](https://developer.android.com/reference/android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat#)  

# AccessibilityServiceInfoCompat

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public

final

class
AccessibilityServiceInfoCompat
`  
`

extends Object


``


`

|---|------------------------------------------------------------------------|
| java.lang.Object                                                          ||
| ↳ | android.support.v4.accessibilityservice.AccessibilityServiceInfoCompat |

<br />

*** ** * ** ***

Helper for accessing features in[AccessibilityServiceInfo](https://developer.android.com/reference/android/accessibilityservice/AccessibilityServiceInfo.html).

## Summary

|                                                                                                                                                                                        ### Constants                                                                                                                                                                                         ||
|-------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | [CAPABILITY_CAN_FILTER_KEY_EVENTS](https://developer.android.com/reference/android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat#CAPABILITY_CAN_FILTER_KEY_EVENTS) Capability: This accessibility service can filter the key event stream.                                                                                                                           |
| `int` | [CAPABILITY_CAN_REQUEST_ENHANCED_WEB_ACCESSIBILITY](https://developer.android.com/reference/android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat#CAPABILITY_CAN_REQUEST_ENHANCED_WEB_ACCESSIBILITY) Capability: This accessibility service can request enhanced web accessibility enhancements.                                                                     |
| `int` | [CAPABILITY_CAN_REQUEST_TOUCH_EXPLORATION](https://developer.android.com/reference/android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat#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](https://developer.android.com/reference/android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat#CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT) Capability: This accessibility service can retrieve the active window content.                                                                                                        |
| `int` | [FEEDBACK_ALL_MASK](https://developer.android.com/reference/android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat#FEEDBACK_ALL_MASK) Mask for all feedback types.                                                                                                                                                                                                    |
| `int` | [FEEDBACK_BRAILLE](https://developer.android.com/reference/android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat#FEEDBACK_BRAILLE) Denotes braille feedback.                                                                                                                                                                                                         |
| `int` | [FLAG_INCLUDE_NOT_IMPORTANT_VIEWS](https://developer.android.com/reference/android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat#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](https://developer.android.com/reference/android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat#FLAG_REPORT_VIEW_IDS) This flag requests that the AccessibilityNodeInfos obtained by an[AccessibilityService](https://developer.android.com/reference/android/accessibilityservice/AccessibilityService.html)contain the id of the source view. |
| `int` | [FLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY](https://developer.android.com/reference/android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat#FLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY) This flag requests from the system to enable web accessibility enhancing extensions.                                                                                                |
| `int` | [FLAG_REQUEST_FILTER_KEY_EVENTS](https://developer.android.com/reference/android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat#FLAG_REQUEST_FILTER_KEY_EVENTS) This flag requests from the system to filter key events.                                                                                                                                              |
| `int` | [FLAG_REQUEST_TOUCH_EXPLORATION_MODE](https://developer.android.com/reference/android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat#FLAG_REQUEST_TOUCH_EXPLORATION_MODE) This flag requests that the system gets into touch exploration mode.                                                                                                                        |

|                                                                                                                                                                                                                                                                                  ### Public methods                                                                                                                                                                                                                                                                                   ||
|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` static String` | ` `[capabilityToString](https://developer.android.com/reference/android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat#capabilityToString(int))`(int capability) ` Returns the string representation of a capability.                                                                                                                                                                                                                                                                                                                               |
| ` static String` | ` `[feedbackTypeToString](https://developer.android.com/reference/android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat#feedbackTypeToString(int))`(int feedbackType) ` Returns the string representation of a feedback type.                                                                                                                                                                                                                                                                                                                      |
| ` static String` | ` `[flagToString](https://developer.android.com/reference/android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat#flagToString(int))`(int flag) ` Returns the string representation of a flag.                                                                                                                                                                                                                                                                                                                                                       |
| ` static int`    | ` `[getCapabilities](https://developer.android.com/reference/android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat#getCapabilities(android.accessibilityservice.AccessibilityServiceInfo))`(`[AccessibilityServiceInfo](https://developer.android.com/reference/android/accessibilityservice/AccessibilityServiceInfo.html)` 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](https://developer.android.com/reference/android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat#loadDescription(android.accessibilityservice.AccessibilityServiceInfo, android.content.pm.PackageManager))`(`[AccessibilityServiceInfo](https://developer.android.com/reference/android/accessibilityservice/AccessibilityServiceInfo.html)` info, `[PackageManager](https://developer.android.com/reference/android/content/pm/PackageManager.html)` packageManager) ` The localized description of the accessibility service. |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat#)From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||

## Constants

### CAPABILITY_CAN_FILTER_KEY_EVENTS

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int CAPABILITY_CAN_FILTER_KEY_EVENTS
```

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

<br />

Constant Value: 8 (0x00000008)  

### CAPABILITY_CAN_REQUEST_ENHANCED_WEB_ACCESSIBILITY

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
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.

<br />

Constant Value: 4 (0x00000004)  

### CAPABILITY_CAN_REQUEST_TOUCH_EXPLORATION

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
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.

<br />

Constant Value: 2 (0x00000002)  

### CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT
```

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

<br />

Constant Value: 1 (0x00000001)  

### FEEDBACK_ALL_MASK

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int FEEDBACK_ALL_MASK
```

Mask for all feedback types.

<br />

**See also:**

- [FEEDBACK_SPOKEN](https://developer.android.com/https://developer.android.com/reference/android/accessibilityservice/AccessibilityServiceInfo#FEEDBACK_SPOKEN)
- [FEEDBACK_HAPTIC](https://developer.android.com/https://developer.android.com/reference/android/accessibilityservice/AccessibilityServiceInfo#FEEDBACK_HAPTIC)
- [FEEDBACK_AUDIBLE](https://developer.android.com/https://developer.android.com/reference/android/accessibilityservice/AccessibilityServiceInfo#FEEDBACK_AUDIBLE)
- [FEEDBACK_VISUAL](https://developer.android.com/https://developer.android.com/reference/android/accessibilityservice/AccessibilityServiceInfo#FEEDBACK_VISUAL)
- [FEEDBACK_GENERIC](https://developer.android.com/https://developer.android.com/reference/android/accessibilityservice/AccessibilityServiceInfo#FEEDBACK_GENERIC)
- [FEEDBACK_BRAILLE](https://developer.android.com/https://developer.android.com/reference/android/accessibilityservice/AccessibilityServiceInfo#FEEDBACK_BRAILLE)

Constant Value: -1 (0xffffffff)  

### FEEDBACK_BRAILLE

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int FEEDBACK_BRAILLE
```

Denotes braille feedback.

<br />

Constant Value: 32 (0x00000020)  

### FLAG_INCLUDE_NOT_IMPORTANT_VIEWS

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
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[IMPORTANT_FOR_ACCESSIBILITY_NO](https://developer.android.com/reference/android/view/View.html#IMPORTANT_FOR_ACCESSIBILITY_NO)or[IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS](https://developer.android.com/reference/android/view/View.html#IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS)and views that are marked as potentially important for accessibility via[IMPORTANT_FOR_ACCESSIBILITY_AUTO](https://developer.android.com/reference/android/view/View.html#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[JELLY_BEAN](https://developer.android.com/reference/android/os/Build.VERSION_CODES.html#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[JELLY_BEAN](https://developer.android.com/reference/android/os/Build.VERSION_CODES.html#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.

<br />

<br />

Constant Value: 2 (0x00000002)  

### FLAG_REPORT_VIEW_IDS

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int FLAG_REPORT_VIEW_IDS
```

This flag requests that the AccessibilityNodeInfos obtained by an[AccessibilityService](https://developer.android.com/reference/android/accessibilityservice/AccessibilityService.html)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.

<br />

Constant Value: 16 (0x00000010)  

### FLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int FLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY
```

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[WebView](https://developer.android.com/reference/android/webkit/WebView.html). An example of such an extension is injecting JavaScript from a secure source. The system will enable enhanced web accessibility if there is at least one accessibility service that has this flag set. Hence, clearing this flag does not guarantee that the device will not have enhanced web accessibility enabled since there may be another enabled service that requested it.

Services that want to set this flag have to declare this capability in their meta-data by setting the attribute canRequestEnhancedWebAccessibility to true, otherwise this flag will be ignored. For how to declare the meta-data of a service refer to[AccessibilityService.SERVICE_META_DATA](https://developer.android.com/reference/android/accessibilityservice/AccessibilityService.html#SERVICE_META_DATA).

<br />

<br />

Constant Value: 8 (0x00000008)  

### FLAG_REQUEST_FILTER_KEY_EVENTS

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int FLAG_REQUEST_FILTER_KEY_EVENTS
```

This flag requests from the system to filter key events. If this flag is set the accessibility service will receive the key events before applications allowing it implement global shortcuts. Setting this flag does not guarantee that this service will filter key events since only one service can do so at any given time. This avoids user confusion due to behavior change in case different key filtering services are enabled. If there is already another key filtering service enabled, this one will not receive key events.

Services that want to set this flag have to declare this capability in their meta-data by setting the attribute canRequestFilterKeyEvents to true, otherwise this flag will be ignored. For how to declare the meta -data of a service refer to[AccessibilityService.SERVICE_META_DATA](https://developer.android.com/reference/android/accessibilityservice/AccessibilityService.html#SERVICE_META_DATA).

<br />

<br />

Constant Value: 32 (0x00000020)  

### FLAG_REQUEST_TOUCH_EXPLORATION_MODE

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int FLAG_REQUEST_TOUCH_EXPLORATION_MODE
```

This flag requests that the system gets into touch exploration mode. In this mode a single finger moving on the screen behaves as a mouse pointer hovering over the user interface. The system will also detect certain gestures performed on the touch screen and notify this service. The system will enable touch exploration mode if there is at least one accessibility service that has this flag set. Hence, clearing this flag does not guarantee that the device will not be in touch exploration mode since there may be another enabled service that requested it.

For accessibility services targeting API version higher than[JELLY_BEAN_MR1](https://developer.android.com/reference/android/os/Build.VERSION_CODES.html#JELLY_BEAN_MR1)that want to set this flag have to declare this capability in their meta-data by setting the attribute canRequestTouchExplorationMode to true, otherwise this flag will be ignored. For how to declare the meta-data of a service refer to[AccessibilityService.SERVICE_META_DATA](https://developer.android.com/reference/android/accessibilityservice/AccessibilityService.html#SERVICE_META_DATA).

Services targeting API version equal to or lower than[JELLY_BEAN_MR1](https://developer.android.com/reference/android/os/Build.VERSION_CODES.html#JELLY_BEAN_MR1)will work normally, i.e. the first time they are run, if this flag is specified, a dialog is shown to the user to confirm enabling explore by touch.

<br />

<br />

Constant Value: 4 (0x00000004)

## Public methods

### capabilityToString

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String capabilityToString (int capability)
```

Returns the string representation of a capability. For example,[CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT](https://developer.android.com/reference/android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat#CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT)is represented by the string CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT.

<br />

|                 Parameters                  ||
|--------------|-------------------------------|
| `capability` | `int`: The capability. <br /> |

|                   Returns                   ||
|----------|-----------------------------------|
| `String` | The string representation. <br /> |

### feedbackTypeToString

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String feedbackTypeToString (int feedbackType)
```

Returns the string representation of a feedback type. For example,[FEEDBACK_SPOKEN](https://developer.android.com/reference/android/accessibilityservice/AccessibilityServiceInfo.html#FEEDBACK_SPOKEN)is represented by the string FEEDBACK_SPOKEN.

<br />

|                    Parameters                    ||
|----------------|----------------------------------|
| `feedbackType` | `int`: The feedback type. <br /> |

|                   Returns                   ||
|----------|-----------------------------------|
| `String` | The string representation. <br /> |

### flagToString

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String flagToString (int flag)
```

Returns the string representation of a flag. For example,[DEFAULT](https://developer.android.com/reference/android/accessibilityservice/AccessibilityServiceInfo.html#DEFAULT)is represented by the string DEFAULT.

<br />

|           Parameters            ||
|--------|-------------------------|
| `flag` | `int`: The flag. <br /> |

|                   Returns                   ||
|----------|-----------------------------------|
| `String` | The string representation. <br /> |

### getCapabilities

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
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.

<br />

|                                       Parameters                                       ||
|--------|--------------------------------------------------------------------------------|
| `info` | `AccessibilityServiceInfo`: The service info whose capabilities to get. <br /> |

|                Returns                 ||
|-------|---------------------------------|
| `int` | The capability bit mask. <br /> |

**See also:**

- [CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT](https://developer.android.com/reference/android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat#CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT)
- [CAPABILITY_CAN_REQUEST_TOUCH_EXPLORATION](https://developer.android.com/reference/android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat#CAPABILITY_CAN_REQUEST_TOUCH_EXPLORATION)
- [CAPABILITY_CAN_REQUEST_ENHANCED_WEB_ACCESSIBILITY](https://developer.android.com/reference/android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat#CAPABILITY_CAN_REQUEST_ENHANCED_WEB_ACCESSIBILITY)
- [CAPABILITY_CAN_FILTER_KEY_EVENTS](https://developer.android.com/reference/android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat#CAPABILITY_CAN_FILTER_KEY_EVENTS)  

### loadDescription

added in[version 25.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String loadDescription (AccessibilityServiceInfo info, 
                PackageManager packageManager)
```

The localized description of the accessibility service.

**Statically set from[meta-data](https://developer.android.com/reference/android/accessibilityservice/AccessibilityService.html#SERVICE_META_DATA).**

<br />

<br />

|                                    Parameters                                     ||
|------------------|-----------------------------------------------------------------|
| `info`           | `AccessibilityServiceInfo`: The service info of interest <br /> |
| `packageManager` | `PackageManager`: The current package manager <br />            |

|                   Returns                   ||
|----------|-----------------------------------|
| `String` | The localized description. <br /> |

-

  ## Classes

  - [AccessibilityServiceInfoCompat](https://developer.android.com/reference/android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat)