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. |
Inherited methods | |
|---|---|
java.lang.Object
| |
Public methods
addAccessibilityStateChangeListener
boolean addAccessibilityStateChangeListener (AccessibilityManager.AccessibilityStateChangeListener listener)
Registers an AccessibilityManager.AccessibilityStateChangeListener for changes in
the global accessibility state of the system. Equivalent to calling
addAccessibilityStateChangeListener(AccessibilityStateChangeListener, Handler)
with a null handler.
| Parameters | |
|---|---|
listener |
AccessibilityManager.AccessibilityStateChangeListener: The listener.This value must never be |
| Returns | |
|---|---|
boolean |
Always returns true.
|
addAccessibilityStateChangeListener
void addAccessibilityStateChangeListener (AccessibilityManager.AccessibilityStateChangeListener listener, Handler handler)
Registers an AccessibilityManager.AccessibilityStateChangeListener for changes in
the global accessibility state of the system. If the listener has already been registered,
the handler used to call it back is updated.
| Parameters | |
|---|---|
listener |
AccessibilityManager.AccessibilityStateChangeListener: The listener.This value must never be |
handler |
Handler: The handler on which the listener should be called back, or null
for a callback on the process's main handler.
This value may be |
addTouchExplorationStateChangeListener
void addTouchExplorationStateChangeListener (AccessibilityManager.TouchExplorationStateChangeListener listener, Handler handler)
Registers an AccessibilityManager.TouchExplorationStateChangeListener for changes in
the global touch exploration state of the system. If the listener has already been
registered, the handler used to call it back is updated.
| Parameters | |
|---|---|
listener |
AccessibilityManager.TouchExplorationStateChangeListener: The listener.This value must never be |
handler |
Handler: The handler on which the listener should be called back, or null
for a callback on the process's main handler.
This value may be |
addTouchExplorationStateChangeListener
boolean addTouchExplorationStateChangeListener (AccessibilityManager.TouchExplorationStateChangeListener listener)
Registers a AccessibilityManager.TouchExplorationStateChangeListener for changes in
the global touch exploration state of the system. Equivalent to calling
addTouchExplorationStateChangeListener(TouchExplorationStateChangeListener, Handler)
with a null handler.
| Parameters | |
|---|---|
listener |
AccessibilityManager.TouchExplorationStateChangeListener: The listener.This value must never be |
| Returns | |
|---|---|
boolean |
Always returns true.
|
getAccessibilityServiceList
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
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. |
getInstalledAccessibilityServiceList
List<AccessibilityServiceInfo> getInstalledAccessibilityServiceList ()
Returns the AccessibilityServiceInfos of the installed accessibility services.
| Returns | |
|---|---|
List<AccessibilityServiceInfo> |
An unmodifiable list with AccessibilityServiceInfos.
|
interrupt
void interrupt ()
Requests feedback interruption from all accessibility services.
isEnabled
boolean isEnabled ()
Returns if the accessibility in the system is enabled.
| Returns | |
|---|---|
boolean |
True if accessibility is enabled, false otherwise. |
isTouchExplorationEnabled
boolean isTouchExplorationEnabled ()
Returns if the touch exploration in the system is enabled.
| Returns | |
|---|---|
boolean |
True if touch exploration is enabled, false otherwise. |
removeAccessibilityStateChangeListener
boolean removeAccessibilityStateChangeListener (AccessibilityManager.AccessibilityStateChangeListener listener)
Unregisters an AccessibilityManager.AccessibilityStateChangeListener.
| Parameters | |
|---|---|
listener |
AccessibilityManager.AccessibilityStateChangeListener: The listener.This value must never be |
| Returns | |
|---|---|
boolean |
True if the listener was previously registered. |
removeTouchExplorationStateChangeListener
boolean removeTouchExplorationStateChangeListener (AccessibilityManager.TouchExplorationStateChangeListener listener)
Unregisters a AccessibilityManager.TouchExplorationStateChangeListener.
| Parameters | |
|---|---|
listener |
AccessibilityManager.TouchExplorationStateChangeListener: The listener.This value must never be |
| Returns | |
|---|---|
boolean |
True if listener was previously registered. |
sendAccessibilityEvent
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.
|
Interfaces
Classes
- AccessibilityEvent
- AccessibilityManager
- AccessibilityNodeInfo
- AccessibilityNodeInfo.AccessibilityAction
- AccessibilityNodeInfo.CollectionInfo
- AccessibilityNodeInfo.CollectionItemInfo
- AccessibilityNodeInfo.RangeInfo
- AccessibilityNodeProvider
- AccessibilityRecord
- AccessibilityWindowInfo
- CaptioningManager
- CaptioningManager.CaptioningChangeListener
- CaptioningManager.CaptionStyle


