AccessibilityServiceInfo
public
class
AccessibilityServiceInfo
extends Object
implements
Parcelable
| java.lang.Object | |
| ↳ | android.accessibilityservice.AccessibilityServiceInfo |
This class describes an AccessibilityService. The system notifies an
AccessibilityService for AccessibilityEvents
according to the information encapsulated in this class.
Developer Guides
For more information about creating AccessibilityServices, read the Accessibility developer guide.
Summary
XML attributes | ||
|---|---|---|
android:accessibilityEventTypes |
The event types this service would like to receive as specified in
AccessibilityEvent.
|
|
android:accessibilityFeedbackType |
The feedback types this service provides as specified in
AccessibilityServiceInfo.
|
|
android:accessibilityFlags |
Additional flags as specified in
AccessibilityServiceInfo.
|
|
android:canRequestEnhancedWebAccessibility |
Attribute whether the accessibility service wants to be able to request enhanced web accessibility enhancements. | |
android:canRequestFilterKeyEvents |
Attribute whether the accessibility service wants to be able to request to filter key events. | |
android:canRequestTouchExplorationMode |
Attribute whether the accessibility service wants to be able to request touch exploration mode in which touched items are spoken aloud and the UI can be explored via gestures. | |
android:canRetrieveWindowContent |
Attribute whether the accessibility service wants to be able to retrieve the active window content. | |
android:description |
Short description of the accessibility service purpose or behavior. | |
android:notificationTimeout |
The minimal period in milliseconds between two accessibility events of the same type are sent to this service. | |
android:packageNames |
Comma separated package names from which this service would like to receive events (leave out for all packages). | |
android:settingsActivity |
Component name of an activity that allows the user to modify the settings for this service. | |
android:summary |
Brief summary of the accessibility service purpose or behavior. | |
Constants | |
|---|---|
int |
CAPABILITY_CAN_CONTROL_MAGNIFICATION
Capability: This accessibility service can control display magnification. |
int |
CAPABILITY_CAN_PERFORM_GESTURES
Capability: This accessibility service can perform gestures. |
int |
CAPABILITY_CAN_REQUEST_ENHANCED_WEB_ACCESSIBILITY
This constant was deprecated in API level O. No longer used |
int |
CAPABILITY_CAN_REQUEST_FILTER_KEY_EVENTS
Capability: This accessibility service can request to filter the key event stream. |
int |
CAPABILITY_CAN_REQUEST_FINGERPRINT_GESTURES
Capability: This accessibility service can capture gestures from the fingerprint sensor |
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. |
int |
CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT
Capability: This accessibility service can retrieve the active window content. |
int |
DEFAULT
If an |
int |
FEEDBACK_ALL_MASK
Mask for all feedback types. |
int |
FEEDBACK_AUDIBLE
Denotes audible (not spoken) feedback. |
int |
FEEDBACK_BRAILLE
Denotes braille feedback. |
int |
FEEDBACK_GENERIC
Denotes generic feedback. |
int |
FEEDBACK_HAPTIC
Denotes haptic feedback. |
int |
FEEDBACK_SPOKEN
Denotes spoken feedback. |
int |
FEEDBACK_VISUAL
Denotes visual feedback. |
int |
FLAG_ENABLE_ACCESSIBILITY_VOLUME
This flag requests that all audio tracks system-wide with
|
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. |
int |
FLAG_REPORT_VIEW_IDS
This flag requests that the |
int |
FLAG_REQUEST_ACCESSIBILITY_BUTTON
This flag indicates to the system that the accessibility service requests that an accessibility button be shown within the system's navigation area, if available. |
int |
FLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY
This constant was deprecated in API level O. No longer used |
int |
FLAG_REQUEST_FILTER_KEY_EVENTS
This flag requests from the system to filter key events. |
int |
FLAG_REQUEST_FINGERPRINT_GESTURES
This flag requests that all fingerprint gestures be sent to the accessibility service. |
int |
FLAG_REQUEST_TOUCH_EXPLORATION_MODE
This flag requests that the system gets into touch exploration mode. |
int |
FLAG_RETRIEVE_INTERACTIVE_WINDOWS
This flag indicates to the system that the accessibility service wants to access content of all interactive windows. |
Inherited constants |
|---|
android.os.Parcelable
|
Fields | |
|---|---|
public
static
final
Creator<AccessibilityServiceInfo> |
CREATOR
|
public
int |
eventTypes
The event types an |
public
int |
feedbackType
The feedback type an |
public
int |
flags
This field represents a set of flags used for configuring an
|
public
long |
notificationTimeout
The timeout after the most recent event of a given type before an
|
public
String[] |
packageNames
The package names an |
Public constructors | |
|---|---|
AccessibilityServiceInfo()
Creates a new instance. |
|
Public methods | |
|---|---|
static
String
|
capabilityToString(int capability)
Returns the string representation of a capability. |
int
|
describeContents()
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one. |
static
String
|
feedbackTypeToString(int feedbackType)
Returns the string representation of a feedback type. |
static
String
|
flagToString(int flag)
Returns the string representation of a flag. |
boolean
|
getCanRetrieveWindowContent()
This method was deprecated
in API level 18.
Use |
int
|
getCapabilities()
Returns the bit mask of capabilities this accessibility service has such as being able to retrieve the active window content, etc. |
String
|
getDescription()
This method was deprecated
in API level 16.
Use |
String
|
getId()
The accessibility service id. |
ResolveInfo
|
getResolveInfo()
The service |
String
|
getSettingsActivityName()
The settings activity name. |
int
|
hashCode()
Returns a hash code value for the object. |
String
|
loadDescription(PackageManager packageManager)
The localized description of the accessibility service. |
CharSequence
|
loadSummary(PackageManager packageManager)
The localized summary of the accessibility service. |
String
|
toString()
Returns a string representation of the object. |
void
|
writeToParcel(Parcel parcel, int flagz)
Flatten this object in to a Parcel. |
Inherited methods | |
|---|---|
java.lang.Object
| |
android.os.Parcelable
| |
XML attributes
android:accessibilityEventTypes
The event types this service would like to receive as specified in
AccessibilityEvent. This setting
can be changed at runtime by calling
android.accessibilityservice.AccessibilityService.setServiceInfo(android.accessibilityservice.AccessibilityServiceInfo).
Must be one or more (separated by '|') of the following constant values.
| Constant | Value | Description |
|---|---|---|
| typeAllMask | ffffffff | Receives TYPES_ALL_MASK i.e. all events. |
| typeAnnouncement | 4000 | Receives TYPE_ANNOUNCEMENT events. |
| typeAssistReadingContext | 1000000 | Receives TYPE_ASSIST_READING_CONTEXT events. |
| typeContextClicked | 800000 | Receives TYPE_VIEW_CONTEXT_CLICKED events. |
| typeGestureDetectionEnd | 80000 | Receives TYPE_GESTURE_DETECTION_END events. |
| typeGestureDetectionStart | 40000 | Receives TYPE_GESTURE_DETECTION_START events. |
| typeNotificationStateChanged | 40 | Receives TYPE_NOTIFICATION_STATE_CHANGED events. |
| typeTouchExplorationGestureEnd | 400 | Receives TYPE_TOUCH_EXPLORATION_GESTURE_END events. |
| typeTouchExplorationGestureStart | 200 | Receives TYPE_TOUCH_EXPLORATION_GESTURE_START events. |
| typeTouchInteractionEnd | 200000 | Receives TYPE_TOUCH_INTERACTION_END events. |
| typeTouchInteractionStart | 100000 | Receives TYPE_TOUCH_INTERACTION_START events. |
| typeViewAccessibilityFocusCleared | 10000 | Receives TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED events. |
| typeViewAccessibilityFocused | 8000 | Receives TYPE_VIEW_ACCESSIBILITY_FOCUSED events. |
| typeViewClicked | 1 | Receives TYPE_VIEW_CLICKED events. |
| typeViewFocused | 8 | Receives TYPE_VIEW_FOCUSED events. |
| typeViewHoverEnter | 80 | Receives TYPE_VIEW_HOVER_ENTER events. |
| typeViewHoverExit | 100 | Receives TYPE_VIEW_HOVER_EXIT events. |
| typeViewLongClicked | 2 | Receives TYPE_VIEW_LONG_CLICKED events. |
| typeViewScrolled | 1000 | Receives TYPE_VIEW_SCROLLED events. |
| typeViewSelected | 4 | Receives TYPE_VIEW_SELECTED events. |
| typeViewTextChanged | 10 | Receives TYPE_VIEW_TEXT_CHANGED events. |
| typeViewTextSelectionChanged | 2000 | Receives TYPE_VIEW_TEXT_SELECTION_CHANGED events. |
| typeViewTextTraversedAtMovementGranularity | 20000 | Receives TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY events. |
| typeWindowContentChanged | 800 | Receives TYPE_WINDOW_CONTENT_CHANGED events. |
| typeWindowStateChanged | 20 | Receives TYPE_WINDOW_STATE_CHANGED events. |
| typeWindowsChanged | 400000 | Receives TYPE_WINDOWS_CHANGED events. |
android:accessibilityFeedbackType
The feedback types this service provides as specified in
AccessibilityServiceInfo. This setting
can be changed at runtime by calling
android.accessibilityservice.AccessibilityService.setServiceInfo(android.accessibilityservice.AccessibilityServiceInfo).
Must be one or more (separated by '|') of the following constant values.
| Constant | Value | Description |
|---|---|---|
| feedbackAllMask | ffffffff | Provides FEEDBACK_ALL_MASK feedback. |
| feedbackAudible | 4 | Provides FEEDBACK_AUDIBLE feedback. |
| feedbackGeneric | 10 | Provides FEEDBACK_GENERIC feedback. |
| feedbackHaptic | 2 | Provides FEEDBACK_HAPTIC feedback. |
| feedbackSpoken | 1 | Provides FEEDBACK_SPOKEN feedback. |
| feedbackVisual | 8 | Provides FEEDBACK_VISUAL feedback. |
android:accessibilityFlags
Additional flags as specified in
AccessibilityServiceInfo.
This setting can be changed at runtime by calling
android.accessibilityservice.AccessibilityService.setServiceInfo(android.accessibilityservice.AccessibilityServiceInfo).
Must be one or more (separated by '|') of the following constant values.
| Constant | Value | Description |
|---|---|---|
| flagDefault | 1 | Has flag DEFAULT. |
| flagEnableAccessibilityVolume | 80 | Has flag FLAG_ENABLE_ACCESSIBILITY_VOLUME. |
| flagIncludeNotImportantViews | 2 | Has flag FLAG_INCLUDE_NOT_IMPORTANT_VIEWS. |
| flagReportViewIds | 10 | Has flag FLAG_REPORT_VIEW_IDS. |
| flagRequestAccessibilityButton | 100 | Has flag FLAG_REQUEST_ACCESSIBILITY_BUTTON. |
| flagRequestEnhancedWebAccessibility | 8 | Has flag FLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY.
Not used by the framework. |
| flagRequestFilterKeyEvents | 20 | Has flag FLAG_REQUEST_FILTER_KEY_EVENTS. |
| flagRequestFingerprintGestures | 200 | Has flag FLAG_REQUEST_FINGERPRINT_GESTURES. |
| flagRequestTouchExplorationMode | 4 | Has flag FLAG_REQUEST_TOUCH_EXPLORATION_MODE. |
| flagRetrieveInteractiveWindows | 40 | Has flag FLAG_RETRIEVE_INTERACTIVE_WINDOWS. |
android:canRequestEnhancedWebAccessibility
Attribute whether the accessibility service wants to be able to request enhanced web accessibility enhancements.
May be a boolean value, such as "true" or
"false".
android:canRequestFilterKeyEvents
Attribute whether the accessibility service wants to be able to request to filter key events.
Required to allow setting the #AccessibilityServiceInfo#FLAG_REQUEST_FILTER_KEY_EVENTS flag.
May be a boolean value, such as "true" or
"false".
android:canRequestTouchExplorationMode
Attribute whether the accessibility service wants to be able to request touch exploration mode in which touched items are spoken aloud and the UI can be explored via gestures.
Required to allow setting the #AccessibilityServiceInfo#FLAG_REQUEST_TOUCH_EXPLORATION_MODE flag.
May be a boolean value, such as "true" or
"false".
android:canRetrieveWindowContent
Attribute whether the accessibility service wants to be able to retrieve the active window content. This setting cannot be changed at runtime.
May be a boolean value, such as "true" or
"false".
android:description
Short description of the accessibility service purpose or behavior.
May be a reference to another resource, in the form
"@[+][package:]type/name" or a theme
attribute in the form
"?[package:]type/name".
android:notificationTimeout
The minimal period in milliseconds between two accessibility events of the same type
are sent to this service. This setting can be changed at runtime by calling
android.accessibilityservice.AccessibilityService.setServiceInfo(android.accessibilityservice.AccessibilityServiceInfo).
May be an integer value, such as "100".
android:packageNames
Comma separated package names from which this service would like to receive events (leave out for all packages).
android.accessibilityservice.AccessibilityService.setServiceInfo(android.accessibilityservice.AccessibilityServiceInfo).
May be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character;
android:settingsActivity
Component name of an activity that allows the user to modify the settings for this service. This setting cannot be changed at runtime.
May be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character;
android:summary
Brief summary of the accessibility service purpose or behavior.
May be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character;
Constants
CAPABILITY_CAN_CONTROL_MAGNIFICATION
int CAPABILITY_CAN_CONTROL_MAGNIFICATION
Capability: This accessibility service can control display magnification.
Constant Value: 16 (0x00000010)
CAPABILITY_CAN_PERFORM_GESTURES
int CAPABILITY_CAN_PERFORM_GESTURES
Capability: This accessibility service can perform gestures.
See also:
Constant Value: 32 (0x00000020)
CAPABILITY_CAN_REQUEST_ENHANCED_WEB_ACCESSIBILITY
int CAPABILITY_CAN_REQUEST_ENHANCED_WEB_ACCESSIBILITY
This constant was deprecated
in API level O.
No longer used
Constant Value: 4 (0x00000004)
CAPABILITY_CAN_REQUEST_FILTER_KEY_EVENTS
int CAPABILITY_CAN_REQUEST_FILTER_KEY_EVENTS
Capability: This accessibility service can request to filter the key event stream.
Constant Value: 8 (0x00000008)
CAPABILITY_CAN_REQUEST_FINGERPRINT_GESTURES
int CAPABILITY_CAN_REQUEST_FINGERPRINT_GESTURES
Capability: This accessibility service can capture gestures from the fingerprint sensor
Constant Value: 64 (0x00000040)
CAPABILITY_CAN_REQUEST_TOUCH_EXPLORATION
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.
Constant Value: 2 (0x00000002)
CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT
int CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT
Capability: This accessibility service can retrieve the active window content.
Constant Value: 1 (0x00000001)
DEFAULT
int DEFAULT
If an AccessibilityService is the default for a given type.
Default service is invoked only if no package specific one exists. In case of
more than one package specific service only the earlier registered is notified.
Constant Value: 1 (0x00000001)
FEEDBACK_ALL_MASK
int FEEDBACK_ALL_MASK
Mask for all feedback types.
See also:
Constant Value: -1 (0xffffffff)
FEEDBACK_AUDIBLE
int FEEDBACK_AUDIBLE
Denotes audible (not spoken) feedback.
Constant Value: 4 (0x00000004)
FEEDBACK_BRAILLE
int FEEDBACK_BRAILLE
Denotes braille feedback.
Constant Value: 32 (0x00000020)
FEEDBACK_GENERIC
int FEEDBACK_GENERIC
Denotes generic feedback.
Constant Value: 16 (0x00000010)
FEEDBACK_HAPTIC
int FEEDBACK_HAPTIC
Denotes haptic feedback.
Constant Value: 2 (0x00000002)
FEEDBACK_SPOKEN
int FEEDBACK_SPOKEN
Denotes spoken feedback.
Constant Value: 1 (0x00000001)
FEEDBACK_VISUAL
int FEEDBACK_VISUAL
Denotes visual feedback.
Constant Value: 8 (0x00000008)
FLAG_ENABLE_ACCESSIBILITY_VOLUME
int FLAG_ENABLE_ACCESSIBILITY_VOLUME
This flag requests that all audio tracks system-wide with
USAGE_ASSISTANCE_ACCESSIBILITY be controlled by the
STREAM_ACCESSIBILITY volume.
Constant Value: 128 (0x00000080)
FLAG_INCLUDE_NOT_IMPORTANT_VIEWS
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 or
IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS and views that are
marked as potentially important for accessibility via
IMPORTANT_FOR_ACCESSIBILITY_AUTO for which the system has determined
that are not important for accessibility, are 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 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 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.
Constant Value: 2 (0x00000002)
FLAG_REPORT_VIEW_IDS
int FLAG_REPORT_VIEW_IDS
This flag requests that the AccessibilityNodeInfos obtained
by an AccessibilityService 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.
Constant Value: 16 (0x00000010)
FLAG_REQUEST_ACCESSIBILITY_BUTTON
int FLAG_REQUEST_ACCESSIBILITY_BUTTON
This flag indicates to the system that the accessibility service requests that an accessibility button be shown within the system's navigation area, if available.
Constant Value: 256 (0x00000100)
FLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY
int FLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY
This constant was deprecated
in API level O.
No longer used
Constant Value: 8 (0x00000008)
FLAG_REQUEST_FILTER_KEY_EVENTS
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.
Services that want to set this flag have to declare this capability
in their meta-data by setting the attribute #canRequestFilterKeyEvents 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.
Constant Value: 32 (0x00000020)
FLAG_REQUEST_FINGERPRINT_GESTURES
int FLAG_REQUEST_FINGERPRINT_GESTURES
This flag requests that all fingerprint gestures be sent to the accessibility service.
It is handled in FingerprintGestureController
Constant Value: 512 (0x00000200)
FLAG_REQUEST_TOUCH_EXPLORATION_MODE
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 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.
Services targeting API version equal to or lower than
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.
Constant Value: 4 (0x00000004)
FLAG_RETRIEVE_INTERACTIVE_WINDOWS
int FLAG_RETRIEVE_INTERACTIVE_WINDOWS
This flag indicates to the system that the accessibility service wants
to access content of all interactive windows. An interactive window is a
window that has input focus or can be touched by a sighted user when explore
by touch is not enabled. If this flag is not set your service will not receive
TYPE_WINDOWS_CHANGED
events, calling AccessibilityServiceAccessibilityService.getWindows() will return an empty list, and AccessibilityNodeInfo.getWindow() will
return null.
Services that want to set this flag have to declare the capability
to retrieve window content in their meta-data by setting the attribute
canRetrieveWindowContent to
true, otherwise this flag will be ignored. For how to declare the meta-data
of a service refer to AccessibilityService.SERVICE_META_DATA.
Constant Value: 64 (0x00000040)
Fields
eventTypes
int eventTypes
The event types an AccessibilityService is interested in.
Can be dynamically set at runtime.
See also:
TYPE_VIEW_CLICKEDTYPE_VIEW_LONG_CLICKEDTYPE_VIEW_FOCUSEDTYPE_VIEW_SELECTEDTYPE_VIEW_TEXT_CHANGEDTYPE_WINDOW_STATE_CHANGEDTYPE_NOTIFICATION_STATE_CHANGEDTYPE_TOUCH_EXPLORATION_GESTURE_STARTTYPE_TOUCH_EXPLORATION_GESTURE_ENDTYPE_VIEW_HOVER_ENTERTYPE_VIEW_HOVER_EXITTYPE_VIEW_SCROLLEDTYPE_VIEW_TEXT_SELECTION_CHANGEDTYPE_WINDOW_CONTENT_CHANGEDTYPE_TOUCH_INTERACTION_STARTTYPE_TOUCH_INTERACTION_ENDTYPE_ANNOUNCEMENTTYPE_GESTURE_DETECTION_STARTTYPE_GESTURE_DETECTION_ENDTYPE_VIEW_ACCESSIBILITY_FOCUSEDTYPE_VIEW_ACCESSIBILITY_FOCUS_CLEAREDTYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITYTYPE_WINDOWS_CHANGED
feedbackType
int feedbackType
The feedback type an AccessibilityService provides.
Can be dynamically set at runtime.
flags
int flags
This field represents a set of flags used for configuring an
AccessibilityService.
Can be dynamically set at runtime.
notificationTimeout
long notificationTimeout
The timeout after the most recent event of a given type before an
AccessibilityService is notified.
Can be dynamically set at runtime..
Note: The event notification timeout is useful to avoid propagating events to the client too frequently since this is accomplished via an expensive interprocess call. One can think of the timeout as a criteria to determine when event generation has settled down.
packageNames
String[] packageNames
The package names an AccessibilityService is interested in. Setting
to null is equivalent to all packages.
Can be dynamically set at runtime.
Public constructors
Public methods
capabilityToString
String capabilityToString (int capability)
Returns the string representation of a capability. For example,
CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT is represented
by the string CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT.
| Parameters | |
|---|---|
capability |
int: The capability. |
| Returns | |
|---|---|
String |
The string representation. |
describeContents
int describeContents ()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation. For example, if the object will
include a file descriptor in the output of writeToParcel(Parcel, int),
the return value of this method must include the
CONTENTS_FILE_DESCRIPTOR bit.
| Returns | |
|---|---|
int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. |
equals
boolean equals (Object obj)
Indicates whether some other object is "equal to" this one.
The equals method implements an equivalence relation
on non-null object references:
- It is reflexive: for any non-null reference value
x,x.equals(x)should returntrue. - It is symmetric: for any non-null reference values
xandy,x.equals(y)should returntrueif and only ify.equals(x)returnstrue. - It is transitive: for any non-null reference values
x,y, andz, ifx.equals(y)returnstrueandy.equals(z)returnstrue, thenx.equals(z)should returntrue. - It is consistent: for any non-null reference values
xandy, multiple invocations ofx.equals(y)consistently returntrueor consistently returnfalse, provided no information used inequalscomparisons on the objects is modified. - For any non-null reference value
x,x.equals(null)should returnfalse.
The equals method for class Object implements
the most discriminating possible equivalence relation on objects;
that is, for any non-null reference values x and
y, this method returns true if and only
if x and y refer to the same object
(x == y has the value true).
Note that it is generally necessary to override the hashCode
method whenever this method is overridden, so as to maintain the
general contract for the hashCode method, which states
that equal objects must have equal hash codes.
| Parameters | |
|---|---|
obj |
Object: the reference object with which to compare. |
| Returns | |
|---|---|
boolean |
true if this object is the same as the obj
argument; false otherwise. |
feedbackTypeToString
String feedbackTypeToString (int feedbackType)
Returns the string representation of a feedback type. For example,
FEEDBACK_SPOKEN is represented by the string FEEDBACK_SPOKEN.
| Parameters | |
|---|---|
feedbackType |
int: The feedback type. |
| Returns | |
|---|---|
String |
The string representation. |
flagToString
String flagToString (int flag)
Returns the string representation of a flag. For example,
DEFAULT is represented by the string DEFAULT.
| Parameters | |
|---|---|
flag |
int: The flag. |
| Returns | |
|---|---|
String |
The string representation. |
getCanRetrieveWindowContent
boolean getCanRetrieveWindowContent ()
This method was deprecated
in API level 18.
Use getCapabilities().
Whether this service can retrieve the current window's content.
Statically set from
meta-data.
| Returns | |
|---|---|
boolean |
True if window content can be retrieved. |
getCapabilities
int getCapabilities ()
Returns the bit mask of capabilities this accessibility service has such as being able to retrieve the active window content, etc.
| Returns | |
|---|---|
int |
The capability bit mask. |
getDescription
String getDescription ()
This method was deprecated
in API level 16.
Use loadDescription(PackageManager).
Gets the non-localized description of the accessibility service.
Statically set from
meta-data.
| Returns | |
|---|---|
String |
The description. |
getId
String getId ()
The accessibility service id.
Generated by the system.
| Returns | |
|---|---|
String |
The id. |
getResolveInfo
ResolveInfo getResolveInfo ()
The service ResolveInfo.
Generated by the system.
| Returns | |
|---|---|
ResolveInfo |
The info. |
getSettingsActivityName
String getSettingsActivityName ()
The settings activity name.
Statically set from
meta-data.
| Returns | |
|---|---|
String |
The settings activity name. |
hashCode
int hashCode ()
Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
HashMap.
The general contract of hashCode is:
- Whenever it is invoked on the same object more than once during
an execution of a Java application, the
hashCodemethod must consistently return the same integer, provided no information used inequalscomparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application. - If two objects are equal according to the
equals(Object)method, then calling thehashCodemethod on each of the two objects must produce the same integer result. - It is not required that if two objects are unequal
according to the
equals(java.lang.Object)method, then calling thehashCodemethod on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
As much as is reasonably practical, the hashCode method defined by
class Object does return distinct integers for distinct
objects. (This is typically implemented by converting the internal
address of the object into an integer, but this implementation
technique is not required by the
Java™ programming language.)
| Returns | |
|---|---|
int |
a hash code value for this object. |
loadDescription
String loadDescription (PackageManager packageManager)
The localized description of the accessibility service.
Statically set from
meta-data.
| Parameters | |
|---|---|
packageManager |
PackageManager |
| Returns | |
|---|---|
String |
The localized description. |
loadSummary
CharSequence loadSummary (PackageManager packageManager)
The localized summary of the accessibility service.
Statically set from
meta-data.
| Parameters | |
|---|---|
packageManager |
PackageManager |
| Returns | |
|---|---|
CharSequence |
The localized summary if available, and null if a summary
has not been provided.
|
toString
String toString ()
Returns a string representation of the object. In general, the
toString method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
| Returns | |
|---|---|
String |
a string representation of the object. |
writeToParcel
void writeToParcel (Parcel parcel, int flagz)
Flatten this object in to a Parcel.
| Parameters | |
|---|---|
parcel |
Parcel: The Parcel in which the object should be written. |
flagz |
int: Additional flags about how the object should be written.
May be 0 or PARCELABLE_WRITE_RETURN_VALUE.
|
Interfaces
Classes
- AccessibilityButtonController
- AccessibilityButtonController.AccessibilityButtonCallback
- AccessibilityService
- AccessibilityService.GestureResultCallback
- AccessibilityService.MagnificationController
- AccessibilityService.SoftKeyboardController
- AccessibilityServiceInfo
- FingerprintGestureController
- FingerprintGestureController.FingerprintGestureCallback
- GestureDescription
- GestureDescription.Builder
- GestureDescription.StrokeDescription