Most visited

Recently visited

Added in API level 4

AccessibilityManager

public final class AccessibilityManager
extends Object

java.lang.Object
   ↳ android.view.accessibility.AccessibilityManager


System level service that serves as an event dispatch for AccessibilityEvents, and provides facilities for querying the accessibility state of the system. Accessibility events are generated when something notable happens in the user interface, for example an Activity starts, the focus or selection of a View changes etc. Parties interested in handling accessibility events implement and register an accessibility service which extends AccessibilityService.

To obtain a handle to the accessibility manager do the following:

AccessibilityManager accessibilityManager =
        (AccessibilityManager) context.getSystemService(Context.ACCESSIBILITY_SERVICE);

See also:

Summary

Nested classes

interface AccessibilityManager.AccessibilityStateChangeListener

Listener for the system accessibility state. 

interface AccessibilityManager.TouchExplorationStateChangeListener

Listener for the system touch exploration state. 

Public methods

boolean addAccessibilityStateChangeListener(AccessibilityManager.AccessibilityStateChangeListener listener)

Registers an AccessibilityManager.AccessibilityStateChangeListener for changes in the global accessibility state of the system.

boolean addTouchExplorationStateChangeListener(AccessibilityManager.TouchExplorationStateChangeListener listener)

Registers a AccessibilityManager.TouchExplorationStateChangeListener for changes in the global touch exploration state of the system.

List<ServiceInfo> getAccessibilityServiceList()

This method was deprecated in API level 14. Use getInstalledAccessibilityServiceList()

List<AccessibilityServiceInfo> getEnabledAccessibilityServiceList(int feedbackTypeFlags)

Returns the AccessibilityServiceInfos of the enabled accessibility services for a given feedback type.

List<AccessibilityServiceInfo> getInstalledAccessibilityServiceList()

Returns the AccessibilityServiceInfos of the installed accessibility services.

void interrupt()

Requests feedback interruption from all accessibility services.

boolean isEnabled()

Returns if the accessibility in the system is enabled.

boolean isTouchExplorationEnabled()

Returns if the touch exploration in the system is enabled.

boolean removeAccessibilityStateChangeListener(AccessibilityManager.AccessibilityStateChangeListener listener)

Unregisters an AccessibilityManager.AccessibilityStateChangeListener.

boolean removeTouchExplorationStateChangeListener(AccessibilityManager.TouchExplorationStateChangeListener listener)

Unregisters a AccessibilityManager.TouchExplorationStateChangeListener.

void sendAccessibilityEvent(AccessibilityEvent event)

Sends an AccessibilityEvent.

Inherited methods

From class java.lang.Object

Public methods

addAccessibilityStateChangeListener

Added in API level 14
boolean addAccessibilityStateChangeListener (AccessibilityManager.AccessibilityStateChangeListener listener)

Registers an AccessibilityManager.AccessibilityStateChangeListener for changes in the global accessibility state of the system.

Parameters
listener AccessibilityManager.AccessibilityStateChangeListener: The listener.
Returns
boolean True if successfully registered.

addTouchExplorationStateChangeListener

Added in API level 19
boolean addTouchExplorationStateChangeListener (AccessibilityManager.TouchExplorationStateChangeListener listener)

Registers a AccessibilityManager.TouchExplorationStateChangeListener for changes in the global touch exploration state of the system.

Parameters
listener AccessibilityManager.TouchExplorationStateChangeListener: The listener.
Returns
boolean True if successfully registered.

getAccessibilityServiceList

Added in API level 4
List<ServiceInfo> getAccessibilityServiceList ()

This method was deprecated in API level 14.
Use getInstalledAccessibilityServiceList()

Returns the ServiceInfos of the installed accessibility services.

Returns
List<ServiceInfo> An unmodifiable list with ServiceInfos.

getEnabledAccessibilityServiceList

Added in API level 14
List<AccessibilityServiceInfo> getEnabledAccessibilityServiceList (int feedbackTypeFlags)

Returns the AccessibilityServiceInfos of the enabled accessibility services for a given feedback type.

Parameters
feedbackTypeFlags int: The feedback type flags.
Returns
List<AccessibilityServiceInfo> An unmodifiable list with AccessibilityServiceInfos.

See also:

getInstalledAccessibilityServiceList

Added in API level 14
List<AccessibilityServiceInfo> getInstalledAccessibilityServiceList ()

Returns the AccessibilityServiceInfos of the installed accessibility services.

Returns
List<AccessibilityServiceInfo> An unmodifiable list with AccessibilityServiceInfos.

interrupt

Added in API level 4
void interrupt ()

Requests feedback interruption from all accessibility services.

isEnabled

Added in API level 4
boolean isEnabled ()

Returns if the accessibility in the system is enabled.

Returns
boolean True if accessibility is enabled, false otherwise.

isTouchExplorationEnabled

Added in API level 14
boolean isTouchExplorationEnabled ()

Returns if the touch exploration in the system is enabled.

Returns
boolean True if touch exploration is enabled, false otherwise.

removeAccessibilityStateChangeListener

Added in API level 14
boolean removeAccessibilityStateChangeListener (AccessibilityManager.AccessibilityStateChangeListener listener)

Unregisters an AccessibilityManager.AccessibilityStateChangeListener.

Parameters
listener AccessibilityManager.AccessibilityStateChangeListener: The listener.
Returns
boolean True if successfully unregistered.

removeTouchExplorationStateChangeListener

Added in API level 19
boolean removeTouchExplorationStateChangeListener (AccessibilityManager.TouchExplorationStateChangeListener listener)

Unregisters a AccessibilityManager.TouchExplorationStateChangeListener.

Parameters
listener AccessibilityManager.TouchExplorationStateChangeListener: The listener.
Returns
boolean True if successfully unregistered.

sendAccessibilityEvent

Added in API level 4
void sendAccessibilityEvent (AccessibilityEvent event)

Sends an AccessibilityEvent.

Parameters
event AccessibilityEvent: The event to send.
Throws
IllegalStateException if accessibility is not enabled. Note: The preferred mechanism for sending custom accessibility events is through calling requestSendAccessibilityEvent(View, AccessibilityEvent) instead of this method to allow predecessors to augment/filter events sent by their descendants.

Hooray!