public
final
class
AccessibilityManager
extends Object
java.lang.Object | |
↳ | android.view.accessibility.AccessibilityManager |
System level service that serves as an event dispatch for AccessibilityEvent
s,
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:
Nested classes | |
---|---|
interface |
AccessibilityManager.AccessibilityStateChangeListener
Listener for the system accessibility state. |
interface |
AccessibilityManager.TouchExplorationStateChangeListener
Listener for the system touch exploration state. |
Inherited methods | |
---|---|
From
class
java.lang.Object
|
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. |
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. |
List<ServiceInfo> getAccessibilityServiceList ()
This method was deprecated
in API level 14.
Use getInstalledAccessibilityServiceList()
Returns the ServiceInfo
s of the installed accessibility services.
Returns | |
---|---|
List<ServiceInfo> |
An unmodifiable list with ServiceInfo s. |
List<AccessibilityServiceInfo> getEnabledAccessibilityServiceList (int feedbackTypeFlags)
Returns the AccessibilityServiceInfo
s of the enabled accessibility services
for a given feedback type.
Parameters | |
---|---|
feedbackTypeFlags |
int :
The feedback type flags. |
Returns | |
---|---|
List<AccessibilityServiceInfo> |
An unmodifiable list with AccessibilityServiceInfo s. |
List<AccessibilityServiceInfo> getInstalledAccessibilityServiceList ()
Returns the AccessibilityServiceInfo
s of the installed accessibility services.
Returns | |
---|---|
List<AccessibilityServiceInfo> |
An unmodifiable list with AccessibilityServiceInfo s.
|
void interrupt ()
Requests feedback interruption from all accessibility services.
boolean isEnabled ()
Returns if the accessibility in the system is enabled.
Returns | |
---|---|
boolean |
True if accessibility is enabled, false otherwise. |
boolean isTouchExplorationEnabled ()
Returns if the touch exploration in the system is enabled.
Returns | |
---|---|
boolean |
True if touch exploration is enabled, false otherwise. |
boolean removeAccessibilityStateChangeListener (AccessibilityManager.AccessibilityStateChangeListener listener)
Unregisters an AccessibilityManager.AccessibilityStateChangeListener
.
Parameters | |
---|---|
listener |
AccessibilityManager.AccessibilityStateChangeListener :
The listener. |
Returns | |
---|---|
boolean |
True if successfully unregistered. |
boolean removeTouchExplorationStateChangeListener (AccessibilityManager.TouchExplorationStateChangeListener listener)
Unregisters a AccessibilityManager.TouchExplorationStateChangeListener
.
Parameters | |
---|---|
listener |
AccessibilityManager.TouchExplorationStateChangeListener :
The listener. |
Returns | |
---|---|
boolean |
True if successfully unregistered. |
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.
|