android-AccessibilityServiceInfo
2016-06-22 17:27
567 查看
AccessibilityServiceInfo
public class AccessibilityServiceInfo
extends Object
implements Parcelable
java.lang.Object | |
↳ | android.accessibilityservice.AccessibilityServiceInfo |
AccessibilityService. The system notifies
an
AccessibilityServicefor
AccessibilityEvents
according to the information encapsulated in this class.
Developer Guides
For more information about creating AccessibilityServices, read the Accessibility developerguide.
See also:
AccessibilityService
AccessibilityEvent
AccessibilityManager
Summary
| |
---|---|
android:accessibilityEventTypes | The event types this serivce would like to receive as specified in AccessibilityEvent. |
android:accessibilityFeedbackType | The feedback types this serivce 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 serivce. |
android:packageNames | Comma separated package names from which this serivce 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. |
| |
---|---|
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 Capability: This accessibility service can request enhanced web accessibility enhancements. |
int | CAPABILITY_CAN_REQUEST_FILTER_KEY_EVENTS Capability: This accessibility service can request to filter the key event stream. |
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 AccessibilityServiceis the default for a given type. |
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_INCLUDE_NOT_IMPORTANT_VIEWS If this flagis 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 flagrequests that the AccessibilityNodeInfos obtained by an AccessibilityServicecontain the id of the source view. |
int | FLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY This flagrequests from the system to enable web accessibility enhancing extensions. |
int | FLAG_REQUEST_FILTER_KEY_EVENTS This flagrequests from the system to filter key events. |
int | FLAG_REQUEST_TOUCH_EXPLORATION_MODE This flagrequests that the system gets into touch exploration mode. |
int | FLAG_RETRIEVE_INTERACTIVE_WINDOWS This flagindicates to the system that the accessibility service wants to access content of all interactive windows. |
|
---|
![]() From interface android.os.Parcelable |
| |
---|---|
public static finalCreator<AccessibilityServiceInfo> | CREATOR |
public int | eventTypes The event types an AccessibilityServiceis interested in. |
public int | feedbackType The feedback type an AccessibilityServiceprovides. |
public int | flags This field represents a set of flags used for configuring an AccessibilityService. |
public long | notificationTimeout The timeout after the most recent event of a given type before an AccessibilityServiceis notified. |
public String[] | packageNames The package names an AccessibilityServiceis interested in. |
|
---|
AccessibilityServiceInfo() Creates a new instance. |
| |
---|---|
staticString | 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. |
staticString | feedbackTypeToString(int feedbackType) Returns the string representation of a feedback type. |
staticString | flagToString(intflag) Returns the string representation of a flag. |
boolean | getCanRetrieveWindowContent() This method was deprecated in API level 18. Use getCapabilities(). |
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 loadDescription(PackageManager). |
String | getId() The accessibility service id. |
ResolveInfo | getResolveInfo() The service ResolveInfo. |
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. |
String | toString() Returns a string representation of the object. |
void | writeToParcel(Parcel parcel, Flatten this object in to a Parcel. |
|
---|
![]() From class java.lang.Object |
![]() From interface android.os.Parcelable |
XML attributes
android:accessibilityEventTypes
The event types this serivce 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 |
---|---|---|
typeViewClicked | 0x00000001 | Receives TYPE_VIEW_CLICKEDevents. |
typeViewLongClicked | 0x00000002 | Receives TYPE_VIEW_LONG_CLICKEDevents. |
typeViewSelected | 0x00000004 | Receives TYPE_VIEW_SELECTEDevents. |
typeViewFocused | 0x00000008 | Receives TYPE_VIEW_FOCUSEDevents. |
typeViewTextChanged | 0x00000010 | Receives TYPE_VIEW_TEXT_CHANGEDevents. |
typeWindowStateChanged | 0x00000020 | Receives TYPE_WINDOW_STATE_CHANGEDevents. |
typeNotificationStateChanged | 0x00000040 | Receives TYPE_NOTIFICATION_STATE_CHANGEDevents. |
typeViewHoverEnter | 0x00000080 | Receives TYPE_VIEW_HOVER_ENTERevents. |
typeViewHoverExit | 0x00000100 | Receives TYPE_VIEW_HOVER_EXITevents. |
typeTouchExplorationGestureStart | 0x00000200 | Receives TYPE_TOUCH_EXPLORATION_GESTURE_STARTevents. |
typeTouchExplorationGestureEnd | 0x00000400 | Receives TYPE_TOUCH_EXPLORATION_GESTURE_ENDevents. |
typeWindowContentChanged | 0x00000800 | Receives TYPE_WINDOW_CONTENT_CHANGEDevents. |
typeViewScrolled | 0x000001000 | Receives TYPE_VIEW_SCROLLEDevents. |
typeViewTextSelectionChanged | 0x000002000 | Receives TYPE_VIEW_TEXT_SELECTION_CHANGEDevents. |
typeAnnouncement | 0x00004000 | Receives TYPE_ANNOUNCEMENTevents. |
typeViewAccessibilityFocused | 0x00008000 | Receives TYPE_VIEW_ACCESSIBILITY_FOCUSEDevents. |
typeViewAccessibilityFocusCleared | 0x00010000 | Receives TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEAREDevents. |
typeViewTextTraversedAtMovementGranularity | 0x00020000 | Receives TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITYevents. |
typeGestureDetectionStart | 0x00040000 | Receives TYPE_GESTURE_DETECTION_STARTevents. |
typeGestureDetectionEnd | 0x00080000 | Receives TYPE_GESTURE_DETECTION_ENDevents. |
typeTouchInteractionStart | 0x00100000 | Receives TYPE_TOUCH_INTERACTION_STARTevents. |
typeTouchInteractionEnd | 0x00200000 | Receives TYPE_TOUCH_INTERACTION_ENDevents. |
typeWindowsChanged | 0x00400000 | Receives TYPE_WINDOWS_CHANGEDevents. |
typeContextClicked | 0x00800000 | Receives TYPE_VIEW_CONTEXT_CLICKEDevents. |
typeAssistReadingContext | 0x01000000 | Receives TYPE_ASSIST_READING_CONTEXTevents. |
typeAllMask | 0xffffffff | Receives TYPES_ALL_MASKi.e. all events. |
accessibilityEventTypes.
android:accessibilityFeedbackType
The feedback types this serivce 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 |
---|---|---|
feedbackSpoken | 0x00000001 | Provides FEEDBACK_SPOKENfeedback. |
feedbackHaptic | 0x00000002 | Provides FEEDBACK_HAPTICfeedback. |
feedbackAudible | 0x00000004 | Provides FEEDBACK_AUDIBLEfeedback. |
feedbackVisual | 0x00000008 | Provides FEEDBACK_VISUALfeedback. |
feedbackGeneric | 0x00000010 | Provides FEEDBACK_GENERICfeedback. |
feedbackAllMask | 0xffffffff | Provides FEEDBACK_ALL_MASKfeedback. |
accessibilityFeedbackType.
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 | 0x00000001 | Has flagDEFAULT |
flagIncludeNotImportantViews | 0x00000002 | Has flagFLAG_INCLUDE_NOT_IMPORTANT_VIEWS |
flagRequestTouchExplorationMode | 0x00000004 | Has flagFLAG_REQUEST_TOUCH_EXPLORATION_MODE |
flagRequestEnhancedWebAccessibility | 0x00000008 | Has flagFLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY |
flagReportViewIds | 0x00000010 | Has flagFLAG_REPORT_VIEW_IDS |
flagRequestFilterKeyEvents | 0x00000020 | Has flagFLAG_REQUEST_FILTER_KEY_EVENTS |
flagRetrieveInteractiveWindows | 0x00000040 | Has flagFLAG_RETRIEVE_INTERACTIVE_WINDOWS |
accessibilityFlags.
android:canRequestEnhancedWebAccessibility
Attribute whether the accessibility service wants to be able to request enhanced web accessibility enhancements. For example, installing scripts to make app content more accessible.Required to allow setting the
#AccessibilityServiceInfo#FLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITYflag.
Must be a booleanvalue, either "
true" or "
false".
This may also be a reference to a resource (in the form "
@[package:]type:name") or theme attribute (in the form "
?[package:][type:]name") containing a value of
this type.
This corresponds to the global attribute resource symbol
canRequestEnhancedWebAccessibility.
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_EVENTSflag.
Must be a booleanvalue, either "
true" or "
false".
This may also be a reference to a resource (in the form "
@[package:]type:name") or theme attribute (in the form "
?[package:][type:]name") containing a value of
this type.
This corresponds to the global attribute resource symbol
canRequestFilterKeyEvents.
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_MODEflag.
Must be a booleanvalue, either "
true" or "
false".
This may also be a reference to a resource (in the form "
@[package:]type:name") or theme attribute (in the form "
?[package:][type:]name") containing a value of
this type.
This corresponds to the global attribute resource symbol
canRequestTouchExplorationMode.
android:canRetrieveWindowContent
Attribute whether the accessibility service wants to be able to retrieve the active window content. This setting cannot be changed at runtime.Must be a booleanvalue, either "
true" or "
false".
This may also be a reference to a resource (in the form "
@[package:]type:name") or theme attribute (in the form "
?[package:][type:]name") containing a value of
this type.
This corresponds to the global attribute resource symbol
canRetrieveWindowContent.
android:description
Short description of the accessibility service purpose or behavior.Must be a reference to another resource, in the form "
@[+][package:]type:name" or to a theme attribute in the form "
?[package:][type:]name".
This corresponds to the global attribute resource symbol
description.
android:notificationTimeout
The minimal period in milliseconds between two accessibility events of the same type are sent to this serivce. This setting can be changed at runtime by calling android.accessibilityservice.AccessibilityService.setServiceInfo(android.accessibilityservice.AccessibilityServiceInfo).
Must be an integer value, such as "
100".
This may also be a reference to a resource (in the form "
@[package:]type:name") or theme attribute (in the form "
?[package:][type:]name") containing a value of
this type.
This corresponds to the global attribute resource symbol
notificationTimeout.
android:packageNames
Comma separated package names from which this serivce would like to receive events (leave out for all packages).android.accessibilityservice.AccessibilityService.setServiceInfo(android.accessibilityservice.AccessibilityServiceInfo).
Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
This may also be a reference to a resource (in the form "
@[package:]type:name") or theme attribute (in the form "
?[package:][type:]name") containing a value of
this type.
This corresponds to the global attribute resource symbol
packageNames.
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.Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
This may also be a reference to a resource (in the form "
@[package:]type:name") or theme attribute (in the form "
?[package:][type:]name") containing a value of
this type.
This corresponds to the global attribute resource symbol
settingsActivity.
Constants
CAPABILITY_CAN_CONTROL_MAGNIFICATION
Added in API level 24intCAPABILITY_CAN_CONTROL_MAGNIFICATION
Capability: This accessibility service can control display magnification.
See also:
AccessibilityService_canControlMagnification
Constant Value: 16 (0x00000010)
CAPABILITY_CAN_PERFORM_GESTURES
Added in API level 24intCAPABILITY_CAN_PERFORM_GESTURES
Capability: This accessibility service can perform gestures.
See also:
AccessibilityService_canPerformGestures
Constant Value: 32 (0x00000020)
CAPABILITY_CAN_REQUEST_ENHANCED_WEB_ACCESSIBILITY
Added in API level 18intCAPABILITY_CAN_REQUEST_ENHANCED_WEB_ACCESSIBILITY
Capability: This accessibility service can request enhanced web accessibility enhancements. For example, installing scripts to make app content more accessible.
See also:
AccessibilityService_canRequestEnhancedWebAccessibility
Constant Value: 4 (0x00000004)
CAPABILITY_CAN_REQUEST_FILTER_KEY_EVENTS
Added in API level 18intCAPABILITY_CAN_REQUEST_FILTER_KEY_EVENTS
Capability: This accessibility service can request to filter the key event stream.
See also:
AccessibilityService_canRequestFilterKeyEvents
Constant Value: 8 (0x00000008)
CAPABILITY_CAN_REQUEST_TOUCH_EXPLORATION
Added in API level 18intCAPABILITY_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.
See also:
AccessibilityService_canRequestTouchExplorationMode
Constant Value: 2 (0x00000002)
CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT
Added in API level 18intCAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT
Capability: This accessibility service can retrieve the active window content.
See also:
AccessibilityService_canRetrieveWindowContent
Constant Value: 1 (0x00000001)
DEFAULT
Added in API level 4intDEFAULT
If an
AccessibilityServiceis
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
Added in API level 14intFEEDBACK_ALL_MASK
Mask for all feedback types.
See also:
FEEDBACK_SPOKEN
FEEDBACK_HAPTIC
FEEDBACK_AUDIBLE
FEEDBACK_VISUAL
FEEDBACK_GENERIC
FEEDBACK_BRAILLE
Constant Value: -1 (0xffffffff)
FEEDBACK_AUDIBLE
Added in API level 4intFEEDBACK_AUDIBLE
Denotes audible (not spoken) feedback.
Constant Value: 4 (0x00000004)
FEEDBACK_BRAILLE
Added in API level 17intFEEDBACK_BRAILLE
Denotes braille feedback.
Constant Value: 32 (0x00000020)
FEEDBACK_GENERIC
Added in API level 4intFEEDBACK_GENERIC
Denotes generic feedback.
Constant Value: 16 (0x00000010)
FEEDBACK_HAPTIC
Added in API level 4intFEEDBACK_HAPTIC
Denotes haptic feedback.
Constant Value: 2 (0x00000002)
FEEDBACK_SPOKEN
Added in API level 4intFEEDBACK_SPOKEN
Denotes spoken feedback.
Constant Value: 1 (0x00000001)
FEEDBACK_VISUAL
Added in API level 4intFEEDBACK_VISUAL
Denotes visual feedback.
Constant Value: 8 (0x00000008)
FLAG_INCLUDE_NOT_IMPORTANT_VIEWS
Added in API level 16intFLAG_INCLUDE_NOT_IMPORTANT_VIEWS
If this flagis 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_NOor
IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTSand
views that are marked as potentially important for accessibility via
IMPORTANT_FOR_ACCESSIBILITY_AUTOfor
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_BEANor
higher this flaghas 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_BEANthis
flagis 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
Added in API level 18intFLAG_REPORT_VIEW_IDS
This flagrequests that the
AccessibilityNodeInfos
obtained by an
AccessibilityServicecontain 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 flagis not set by default.
Constant Value: 16 (0x00000010)
FLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY
Added in API level 18intFLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY
This flagrequests from the system to enable web accessibility enhancing extensions. Such extensions aim to provide improved accessibility support for content presented in a
WebView.
An example of such an extension is injecting JavaScript from a secure source. The system will enable enhanced web accessibility if there is at least one accessibility service that has this flagset. Hence, clearing this flagdoes not guarantee that the device
will not have enhanced web accessibility enabled since there may be another enabled service that requested it.
Services that want to set this flaghave to declare this capabilityin their meta-data by setting the attribute
#canRequestEnhancedWebAccessibility canRequestEnhancedWebAccessibilityto true, otherwise this flagwill be ignored. For how to declare the meta-data of a service refer to
AccessibilityService.SERVICE_META_DATA.
See also:
AccessibilityService_canRequestEnhancedWebAccessibility
Constant Value: 8 (0x00000008)
FLAG_REQUEST_FILTER_KEY_EVENTS
Added in API level 18intFLAG_REQUEST_FILTER_KEY_EVENTS
This flagrequests from the system to filter key events. If this flagis set the accessibility service will receive the key events before applications allowing it implement global shortcuts.
Services that want to set this flaghave to declare this capabilityin their meta-data by setting the attribute
#canRequestFilterKeyEvents canRequestFilterKeyEventsto true, otherwise this flagwill be ignored. For how to declare the meta-data of a service refer to
AccessibilityService.SERVICE_META_DATA.
See also:
AccessibilityService_canRequestFilterKeyEvents
Constant Value: 32 (0x00000020)
FLAG_REQUEST_TOUCH_EXPLORATION_MODE
Added in API level 16intFLAG_REQUEST_TOUCH_EXPLORATION_MODE
This flagrequests 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 flagset. Hence, clearing this flagdoes 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_MR1that
want to set this flaghave to declare this capabilityin their meta-data by setting the attribute
canRequestTouchExplorationModeto
true, otherwise this flagwill 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_MR1will
work normally, i.e. the first time they are run, if this flagis specified, a dialog is shown to the user to confirm enabling explore by touch.
See also:
AccessibilityService_canRequestTouchExplorationMode
Constant Value: 4 (0x00000004)
FLAG_RETRIEVE_INTERACTIVE_WINDOWS
Added in API level 21intFLAG_RETRIEVE_INTERACTIVE_WINDOWS
This flagindicates 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 flagis not set your service will not receive
TYPE_WINDOWS_CHANGEDevents,
calling AccessibilityService
AccessibilityService.getWindows()will
return an empty list, and
AccessibilityNodeInfo.getWindow()will
return null.
Services that want to set this flaghave to declare the capabilityto retrieve window content in their meta-data by setting the attribute
canRetrieveWindowContentto
true, otherwise this flagwill be ignored. For how to declare the meta-data of a service refer to
AccessibilityService.SERVICE_META_DATA.
See also:
AccessibilityService_canRetrieveWindowContent
Constant Value: 64 (0x00000040)
Fields
CREATOR
Added in API level 4Creator<AccessibilityServiceInfo> CREATOR
See also:
Parcelable.Creator
eventTypes
Added in API level 4inteventTypes
The event types an
AccessibilityServiceis
interested in.
Can be dynamically set at runtime.
See also:
TYPE_VIEW_CLICKED
TYPE_VIEW_LONG_CLICKED
TYPE_VIEW_FOCUSED
TYPE_VIEW_SELECTED
TYPE_VIEW_TEXT_CHANGED
TYPE_WINDOW_STATE_CHANGED
TYPE_NOTIFICATION_STATE_CHANGED
TYPE_TOUCH_EXPLORATION_GESTURE_START
TYPE_TOUCH_EXPLORATION_GESTURE_END
TYPE_VIEW_HOVER_ENTER
TYPE_VIEW_HOVER_EXIT
TYPE_VIEW_SCROLLED
TYPE_VIEW_TEXT_SELECTION_CHANGED
TYPE_WINDOW_CONTENT_CHANGED
TYPE_TOUCH_INTERACTION_START
TYPE_TOUCH_INTERACTION_END
TYPE_ANNOUNCEMENT
TYPE_GESTURE_DETECTION_START
TYPE_GESTURE_DETECTION_END
TYPE_VIEW_ACCESSIBILITY_FOCUSED
TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED
TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY
TYPE_WINDOWS_CHANGED
feedbackType
Added in API level 4intfeedbackType
The feedback type an
AccessibilityServiceprovides.
Can be dynamically set at runtime.
See also:
FEEDBACK_AUDIBLE
FEEDBACK_GENERIC
FEEDBACK_HAPTIC
FEEDBACK_SPOKEN
FEEDBACK_VISUAL
FEEDBACK_BRAILLE
flags
Added in API level 4intflags
This field represents a set of flags used for configuring an
AccessibilityService.
Can be dynamically set at runtime.
See also:
DEFAULT
FLAG_INCLUDE_NOT_IMPORTANT_VIEWS
FLAG_REQUEST_TOUCH_EXPLORATION_MODE
FLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY
FLAG_REQUEST_FILTER_KEY_EVENTS
FLAG_REPORT_VIEW_IDS
FLAG_RETRIEVE_INTERACTIVE_WINDOWS
notificationTimeout
Added in API level 4long notificationTimeout
The timeout after the most recent event of a given type before an
AccessibilityServiceis
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
Added in API level 4String[] packageNames
The package names an
AccessibilityServiceis
interested in. Setting to
nullis equivalent to all packages.
Can be dynamically set at runtime.
Public constructors
AccessibilityServiceInfo
Added in API level 4AccessibilityServiceInfo ()
Creates a new instance.
Public methods
capabilityToString
Added in API level 18String capabilityToString (intcapability)
Returns the string representation of a capability. For example,
CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENTis
represented by the string CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT.
Parameters | |
---|---|
capability | int: The capability. |
Returns | |
---|---|
String | The string representation. |
describeContents
Added in API level 4intdescribeContents ()
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_DESCRIPTORbit.
Returns | |
---|---|
int | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. |
equals
Added in API level 4booleanequals (Object obj)
Indicates whether some other object is "equal to" this one.
The
equalsmethod implements an equivalence relation on non-null object references:
It is reflexive: for any non-null reference value
x,
x.equals(x)should return
true.
It is symmetric: for any non-null reference values
xand
y,
x.equals(y)should return
trueif and only if
y.equals(x)returns
true.
It is transitive: for any non-null reference values
x,
y, and
z, if
x.equals(y)returns
trueand
y.equals(z)returns
true,
then
x.equals(z)should return
true.
It is consistent: for any non-null reference values
xand
y, multiple invocations of
x.equals(y)consistently return
trueor consistently
return
false, provided no information used in
equalscomparisons on the objects is modified.
For any non-null reference value
x,
x.equals(null)should return
false.
The
equalsmethod for class
Objectimplements the most discriminating possible equivalence relation on objects; that is, for any non-null reference values
xand
y,
this method returns
trueif and only if
xand
yrefer to the same object (
x == yhas the value
true).
Note that it is generally necessary to override the
hashCodemethod whenever this method is overridden, so as to maintain the general contract for the
hashCodemethod,
which states that equal objects must have equal hash codes.
Parameters | |
---|---|
obj | Object: the reference object with which to compare. |
Returns | |
---|---|
boolean | trueif this object is the same as the objargument; falseotherwise. |
feedbackTypeToString
Added in API level 14String feedbackTypeToString (intfeedbackType)
Returns the string representation of a feedback type. For example,
FEEDBACK_SPOKENis
represented by the string FEEDBACK_SPOKEN.
Parameters | |
---|---|
feedbackType | int: The feedback type. |
Returns | |
---|---|
String | The string representation. |
flagToString
Added in API level 14String flagToString (intflag)
Returns the string representation of a flag. For example,
DEFAULTis
represented by the string DEFAULT.
Parameters | |
---|---|
flag | int: The flag. |
Returns | |
---|---|
String | The string representation. |
getCanRetrieveWindowContent
Added in API level 14booleangetCanRetrieveWindowContent ()
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
Added in API level 18intgetCapabilities ()
Returns the bit mask of capabilities this accessibility service has such as being able to retrieve the active window content, etc.
Returns | |
---|---|
int | The capabilitybit mask. |
CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT
CAPABILITY_CAN_REQUEST_TOUCH_EXPLORATION
CAPABILITY_CAN_REQUEST_ENHANCED_WEB_ACCESSIBILITY
ERROR(/#CAPABILITY_FILTER_KEY_EVENTS)
CAPABILITY_CAN_CONTROL_MAGNIFICATION
CAPABILITY_CAN_PERFORM_GESTURES
getDescription
Added in API level 14String 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
Added in API level 14String getId ()
The accessibility service id.
Generated by the system.
Returns | |
---|---|
String | The id. |
getResolveInfo
Added in API level 14ResolveInfo getResolveInfo ()
The service
ResolveInfo.
Generated by the system.
Returns | |
---|---|
ResolveInfo | The info. |
getSettingsActivityName
Added in API level 14String getSettingsActivityName ()
The settings activity name.
Statically set from
meta-data.
Returns | |
---|---|
String | The settings activity name. |
hashCode
Added in API level 4inthashCode ()
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
hashCodeis:
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 in
equalscomparisons
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 the
hashCodemethod 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 the
hashCodemethod 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
Objectdoes 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 JavaTMprogramming language.)
Returns | |
---|---|
int | a hash code value for this object. |
loadDescription
Added in API level 16String loadDescription (PackageManager packageManager)
The localized description of the accessibility service.
Statically set from
meta-data.
Parameters | |
---|---|
packageManager | PackageManager |
Returns | |
---|---|
String | The localized description. |
toString
Added in API level 4String toString ()
Returns a string representation of the object. In general, the
toStringmethod 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
toStringmethod for class
Objectreturns 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
Added in API level 4void writeToParcel (Parcel parcel,
intflagz)
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. |
相关文章推荐
- Android控件Tween动画Demo
- Android之NetworkOnMainThreadException异常
- Android 获取屏幕宽高与通过代码设置VIew宽高
- TranslateAnimation类是Android系统中的位置变化动画类
- Android学习笔记八之BroadCastReceiver
- Android AbsListView 的item动画类库 —— JazzyListView
- Android集成环信3.x出现java.lang.UnsatisfiedLinkError: com.android.tools.fd.runtime.IncrementalClassLoader
- Android 图片操作
- AndroidStudio中,把项目提交到SVN中操作方法
- 解决cordova-plugin-actionsheet导致Android丑陋的问题
- Android NavigationDrawer实现
- 【项目中】TextView设置行间距
- Android Activity/Fragment Lifecycle
- AndroidStudio 关于第三方so文件不全导致java.lang.UnsatisfiedLinkError解决办法
- Android Studio编译好的apk放在哪儿?
- Android开发虚拟机的各种分辨率
- 自定义android EditText样式及使用方式
- Android 仿美团外卖等下拉刷新效果
- 城市列表
- 自定义android EditText输入框光标样式