AccessibilityManagerCompat

Added in 1.1.0

public final class AccessibilityManagerCompat


Helper for accessing features in AccessibilityManager.

Summary

Nested types

This interface is deprecated.

Use AccessibilityManager.AccessibilityStateChangeListener directly instead of this listener.

This class is deprecated.

Use AccessibilityManager.AccessibilityStateChangeListener directly instead of this listener.

Listener for the system touch exploration state.

Public methods

static boolean

This method is deprecated.

Use addAccessibilityStateChangeListener directly.

static boolean
@ReplaceWith(expression = "manager.addTouchExplorationStateChangeListener(listener)")
addTouchExplorationStateChangeListener(
    @NonNull AccessibilityManager manager,
    @NonNull AccessibilityManagerCompat.TouchExplorationStateChangeListener listener
)

This method is deprecated.

Call addTouchExplorationStateChangeListener directly.

static List<AccessibilityServiceInfo>
@ReplaceWith(expression = "manager.getEnabledAccessibilityServiceList(feedbackTypeFlags)")
getEnabledAccessibilityServiceList(
    AccessibilityManager manager,
    int feedbackTypeFlags
)

This method is deprecated.

Use getEnabledAccessibilityServiceList directly.

static List<AccessibilityServiceInfo>
@ReplaceWith(expression = "manager.getInstalledAccessibilityServiceList()")
getInstalledAccessibilityServiceList(AccessibilityManager manager)

This method is deprecated.

Use getInstalledAccessibilityServiceList directly.

static boolean

Whether the current accessibility request comes from an android.accessibilityservice.AccessibilityService with the isAccessibilityTool property set to true.

static boolean
@ReplaceWith(expression = "manager.isTouchExplorationEnabled()")
isTouchExplorationEnabled(AccessibilityManager manager)

This method is deprecated.

Use isTouchExplorationEnabled directly.

static boolean

This method is deprecated.

Use removeAccessibilityStateChangeListener directly.

static boolean
@ReplaceWith(expression = "manager.removeTouchExplorationStateChangeListener(listener)")
removeTouchExplorationStateChangeListener(
    @NonNull AccessibilityManager manager,
    @NonNull AccessibilityManagerCompat.TouchExplorationStateChangeListener listener
)

This method is deprecated.

Call removeTouchExplorationStateChangeListener directly.

Public methods

addAccessibilityStateChangeListener

Added in 1.1.0
Deprecated in 1.1.0
public static boolean addAccessibilityStateChangeListener(
    AccessibilityManager manager,
    AccessibilityManagerCompat.AccessibilityStateChangeListener listener
)

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

Parameters
AccessibilityManager manager

The accessibility manager.

AccessibilityManagerCompat.AccessibilityStateChangeListener listener

The listener.

Returns
boolean

True if successfully registered.

addTouchExplorationStateChangeListener

Added in 1.1.0
Deprecated in 1.15.0-rc01
@ReplaceWith(expression = "manager.addTouchExplorationStateChangeListener(listener)")
public static boolean addTouchExplorationStateChangeListener(
    @NonNull AccessibilityManager manager,
    @NonNull AccessibilityManagerCompat.TouchExplorationStateChangeListener listener
)

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

Parameters
@NonNull AccessibilityManager manager

AccessibilityManager for which to add the listener.

@NonNull AccessibilityManagerCompat.TouchExplorationStateChangeListener listener

The listener.

Returns
boolean

True if successfully registered.

getEnabledAccessibilityServiceList

Added in 1.1.0
Deprecated in 1.1.0
@ReplaceWith(expression = "manager.getEnabledAccessibilityServiceList(feedbackTypeFlags)")
public static List<AccessibilityServiceInfogetEnabledAccessibilityServiceList(
    AccessibilityManager manager,
    int feedbackTypeFlags
)

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

Parameters
AccessibilityManager manager

The accessibility manager.

int feedbackTypeFlags

The feedback type flags.

Returns
List<AccessibilityServiceInfo>

An unmodifiable list with AccessibilityServiceInfos.

getInstalledAccessibilityServiceList

Added in 1.1.0
Deprecated in 1.1.0
@ReplaceWith(expression = "manager.getInstalledAccessibilityServiceList()")
public static List<AccessibilityServiceInfogetInstalledAccessibilityServiceList(AccessibilityManager manager)

Returns the AccessibilityServiceInfos of the installed accessibility services.

Parameters
AccessibilityManager manager

The accessibility manager.

Returns
List<AccessibilityServiceInfo>

An unmodifiable list with AccessibilityServiceInfos.

isRequestFromAccessibilityTool

Added in 1.12.0
public static boolean isRequestFromAccessibilityTool(@NonNull AccessibilityManager manager)

Whether the current accessibility request comes from an android.accessibilityservice.AccessibilityService with the isAccessibilityTool property set to true.

You can use this method inside android.view.accessibility.AccessibilityNodeProvider to decide how to populate your nodes.

Note: The return value is valid only when an android.view.accessibility.AccessibilityNodeInfo request is in progress, can change from one request to another, and has no meaning when a request is not in progress.

Returns
boolean

True if the current request is from a tool that sets isAccessibilityTool.

isTouchExplorationEnabled

Added in 1.1.0
Deprecated in 1.1.0
@ReplaceWith(expression = "manager.isTouchExplorationEnabled()")
public static boolean isTouchExplorationEnabled(AccessibilityManager manager)

Returns if the touch exploration in the system is enabled.

Parameters
AccessibilityManager manager

The accessibility manager.

Returns
boolean

True if touch exploration is enabled, false otherwise.

removeAccessibilityStateChangeListener

Added in 1.1.0
Deprecated in 1.1.0
public static boolean removeAccessibilityStateChangeListener(
    AccessibilityManager manager,
    AccessibilityManagerCompat.AccessibilityStateChangeListener listener
)

Unregisters an AccessibilityManager.AccessibilityStateChangeListener.

Parameters
AccessibilityManager manager

The accessibility manager.

AccessibilityManagerCompat.AccessibilityStateChangeListener listener

The listener.

Returns
boolean

True if successfully unregistered.

removeTouchExplorationStateChangeListener

Added in 1.1.0
Deprecated in 1.15.0-rc01
@ReplaceWith(expression = "manager.removeTouchExplorationStateChangeListener(listener)")
public static boolean removeTouchExplorationStateChangeListener(
    @NonNull AccessibilityManager manager,
    @NonNull AccessibilityManagerCompat.TouchExplorationStateChangeListener listener
)

Unregisters a TouchExplorationStateChangeListener.

Parameters
@NonNull AccessibilityManager manager

AccessibilityManager for which to remove the listener.

@NonNull AccessibilityManagerCompat.TouchExplorationStateChangeListener listener

The listener.

Returns
boolean

True if successfully unregistered.