AccessibilityServiceInfo
open class AccessibilityServiceInfo : Parcelable
kotlin.Any | |
↳ | android.accessibilityservice.AccessibilityServiceInfo |
This class describes an AccessibilityService
. The system notifies an AccessibilityService
for android.view.accessibility.AccessibilityEvent
s according to the information encapsulated in this class.
Summary
XML attributes | |
---|---|
android:accessibilityEventTypes |
The event types this service would like to receive as specified in android. |
android:accessibilityFeedbackType |
The feedback types this service provides as specified in android. |
android:accessibilityFlags |
Additional flags as specified in android. |
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:canTakeScreenshot |
Attribute whether the accessibility service wants to be able to take screenshot. |
android:description |
Description of the accessibility service usage, availability, or limitations (e.g. isn't supported by all apps). |
android:interactiveUiTimeout |
A recommended timeout in milliseconds used in android. |
android:intro |
Detailed intro of the accessibility service purpose or behavior. |
android:nonInteractiveUiTimeout |
A recommended timeout in milliseconds used in android. |
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 |
Fully qualified class 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. |
android:tileService |
Fully qualified class name of android. |
Constants | |
---|---|
static Int |
Capability: This accessibility service can control display magnification. |
static Int |
Capability: This accessibility service can perform gestures. |
static Int | |
static Int |
Capability: This accessibility service can request to filter the key event stream. |
static Int |
Capability: This accessibility service can capture gestures from the fingerprint sensor |
static Int |
Capability: This accessibility service can request touch exploration mode in which touched items are spoken aloud and the UI can be explored via gestures. |
static Int |
Capability: This accessibility service can retrieve the active window content. |
static Int |
Capability: This accessibility service can take screenshot. |
static Int |
If an |
static Int |
Mask for all feedback types. |
static Int |
Denotes audible (not spoken) feedback. |
static Int |
Denotes braille feedback. |
static Int |
Denotes generic feedback. |
static Int |
Denotes haptic feedback. |
static Int |
Denotes spoken feedback. |
static Int |
Denotes visual feedback. |
static Int |
This flag requests that all audio tracks system-wide with |
static Int |
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. |
static Int |
This flag makes the AccessibilityService an input method editor with a subset of input method editor capabilities: get the |
static Int |
This flag requests that the |
static Int |
This flag requests that when when |
static Int |
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. |
static Int | |
static Int |
This flag requests from the system to filter key events. |
static Int |
This flag requests that all fingerprint gestures be sent to the accessibility service. |
static Int |
This flag requests that when when |
static Int |
This flag requests that accessibility shortcut warning dialog has spoken feedback when dialog is shown. |
static Int |
This flag requests that the system gets into touch exploration mode. |
static Int |
This flag indicates to the system that the accessibility service wants to access content of all interactive windows. |
static Int |
This flag requests that when when |
static Int |
This flag requests that when |
Inherited constants | |
---|---|
Public constructors | |
---|---|
Creates a new instance. |
Public methods | |
---|---|
open static String! |
capabilityToString(capability: Int) Returns the string representation of a capability. |
open Int |
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
open Boolean |
Indicates whether some other object is "equal to" this one. |
open static String! |
feedbackTypeToString(feedbackType: Int) Returns the string representation of a feedback type. |
open static String! |
flagToString(flag: Int) Returns the string representation of a flag. |
open Boolean |
Whether this service can retrieve the current window's content. |
open Int |
Returns the bit mask of capabilities this accessibility service has such as being able to retrieve the active window content, etc. |
open String! |
Gets the non-localized description of the accessibility service. |
open String! |
getId() The accessibility service id. |
open Int |
Get the recommended timeout for interactive controls. |
open Int |
Returns the bit mask of |
open Int |
Get the recommended timeout for non-interactive controls. |
open ResolveInfo! |
The service |
open String! |
The settings activity name. |
open String? |
Gets the name of |
open Int |
hashCode() |
open Boolean |
Indicates if the service is used to assist users with disabilities. |
open String! |
loadDescription(packageManager: PackageManager!) The localized description of the accessibility service. |
open CharSequence? |
loadIntro(packageManager: PackageManager) The localized intro of the accessibility service. |
open CharSequence! |
loadSummary(packageManager: PackageManager!) The localized summary of the accessibility service. |
open Unit |
setInteractiveUiTimeoutMillis(timeout: Int) Set the recommended time that interactive controls need to remain on the screen to support the user. |
open Unit |
setMotionEventSources(motionEventSources: Int) Sets the bit mask of |
open Unit |
setNonInteractiveUiTimeoutMillis(timeout: Int) Set the recommended time that non-interactive controls need to remain on the screen to support the user. |
open String |
toString() |
open Unit |
writeToParcel(parcel: Parcel, flagz: Int) |
Properties | |
---|---|
static Parcelable.Creator<AccessibilityServiceInfo!> | |
Int |
The event types an |
Int |
The feedback type an |
Int |
This field represents a set of flags used for configuring an |
Long |
The timeout, in milliseconds, after the most recent event of a given type before an |
Array<String!>! |
The package names an |
XML attributes
android:accessibilityEventTypes
android:accessibilityEventTypes
android.view.accessibility.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.
android:accessibilityFeedbackType
android:accessibilityFeedbackType
android.accessibilityservice.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 android.accessibilityservice.AccessibilityServiceInfo#FEEDBACK_ALL_MASK feedback. |
feedbackAudible | 4 | Provides android.accessibilityservice.AccessibilityServiceInfo#FEEDBACK_AUDIBLE feedback. |
feedbackGeneric | 10 | Provides android.accessibilityservice.AccessibilityServiceInfo#FEEDBACK_GENERIC feedback. |
feedbackHaptic | 2 | Provides android.accessibilityservice.AccessibilityServiceInfo#FEEDBACK_HAPTIC feedback. |
feedbackSpoken | 1 | Provides android.accessibilityservice.AccessibilityServiceInfo#FEEDBACK_SPOKEN feedback. |
feedbackVisual | 8 | Provides android.accessibilityservice.AccessibilityServiceInfo#FEEDBACK_VISUAL feedback. |
android:accessibilityFlags
android:accessibilityFlags
android.accessibilityservice.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.
android:canRequestFilterKeyEvents
android:canRequestFilterKeyEvents
Required to allow setting the #AccessibilityServiceInfo#FLAG_REQUEST_FILTER_KEY_EVENTS
flag.
May be a boolean value, such as "true
" or "false
".
android:canRequestTouchExplorationMode
android:canRequestTouchExplorationMode
Required to allow setting the #AccessibilityServiceInfo#FLAG_REQUEST_TOUCH_EXPLORATION_MODE
flag.
May be a boolean value, such as "true
" or "false
".
android:canRetrieveWindowContent
android:canRetrieveWindowContent
Required to allow setting the #AccessibilityServiceInfo#FLAG_RETRIEVE_INTERACTIVE_WINDOWS
flag.
May be a boolean value, such as "true
" or "false
".
android:canTakeScreenshot
android:canTakeScreenshot
May be a boolean value, such as "true
" or "false
".
android:description
android:description
May be a reference to another resource, in the form "@[+][package:]type/name
" or a theme attribute in the form "?[package:]type/name
".
android:interactiveUiTimeout
android:interactiveUiTimeout
android.view.accessibility.AccessibilityManager.getRecommendedTimeoutMillis(int, int)
to return a suitable value for interactive controls. 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:intro
android:intro
May be a reference to another resource, in the form "@[+][package:]type/name
" or a theme attribute in the form "?[package:]type/name
".
android:nonInteractiveUiTimeout
android:nonInteractiveUiTimeout
android.view.accessibility.AccessibilityManager.getRecommendedTimeoutMillis(int, int)
to return a suitable value for UIs that do not include interactive controls. 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:notificationTimeout
android:notificationTimeout
android.accessibilityservice.AccessibilityService.setServiceInfo(android.accessibilityservice.AccessibilityServiceInfo)
.
May be an integer value, such as "100
".
android:packageNames
android:packageNames
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
android:settingsActivity
May be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character;
android:summary
android:summary
May be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character;
android:tileService
android:tileService
android.service.quicksettings.TileService
is associated with this accessibility service for one to one mapping. It is used by system settings to remind users this accessibility service has a android.service.quicksettings.TileService
.
May be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character;
Constants
CAPABILITY_CAN_CONTROL_MAGNIFICATION
static val CAPABILITY_CAN_CONTROL_MAGNIFICATION: Int
Capability: This accessibility service can control display magnification.
Value: 16
CAPABILITY_CAN_PERFORM_GESTURES
static val CAPABILITY_CAN_PERFORM_GESTURES: Int
Capability: This accessibility service can perform gestures.
Value: 32
CAPABILITY_CAN_REQUEST_ENHANCED_WEB_ACCESSIBILITY
static valCAPABILITY_CAN_REQUEST_ENHANCED_WEB_ACCESSIBILITY: Int
Deprecated: No longer used
Value: 4
CAPABILITY_CAN_REQUEST_FILTER_KEY_EVENTS
static val CAPABILITY_CAN_REQUEST_FILTER_KEY_EVENTS: Int
Capability: This accessibility service can request to filter the key event stream.
Value: 8
CAPABILITY_CAN_REQUEST_FINGERPRINT_GESTURES
static val CAPABILITY_CAN_REQUEST_FINGERPRINT_GESTURES: Int
Capability: This accessibility service can capture gestures from the fingerprint sensor
Value: 64
CAPABILITY_CAN_REQUEST_TOUCH_EXPLORATION
static val CAPABILITY_CAN_REQUEST_TOUCH_EXPLORATION: Int
Capability: This accessibility service can request touch exploration mode in which touched items are spoken aloud and the UI can be explored via gestures.
Value: 2
CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT
static val CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT: Int
Capability: This accessibility service can retrieve the active window content.
Value: 1
CAPABILITY_CAN_TAKE_SCREENSHOT
static val CAPABILITY_CAN_TAKE_SCREENSHOT: Int
Capability: This accessibility service can take screenshot.
Value: 128
DEFAULT
static val DEFAULT: Int
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.
Value: 1
FEEDBACK_ALL_MASK
static val FEEDBACK_ALL_MASK: Int
Mask for all feedback types.
Value: -1
FEEDBACK_AUDIBLE
static val FEEDBACK_AUDIBLE: Int
Denotes audible (not spoken) feedback.
Value: 4
FEEDBACK_BRAILLE
static val FEEDBACK_BRAILLE: Int
Denotes braille feedback.
Value: 32
FEEDBACK_GENERIC
static val FEEDBACK_GENERIC: Int
Denotes generic feedback.
Value: 16
FEEDBACK_HAPTIC
static val FEEDBACK_HAPTIC: Int
Denotes haptic feedback.
Value: 2
FEEDBACK_SPOKEN
static val FEEDBACK_SPOKEN: Int
Denotes spoken feedback.
Value: 1
FEEDBACK_VISUAL
static val FEEDBACK_VISUAL: Int
Denotes visual feedback.
Value: 8
FLAG_ENABLE_ACCESSIBILITY_VOLUME
static val FLAG_ENABLE_ACCESSIBILITY_VOLUME: Int
This flag requests that all audio tracks system-wide with android.media.AudioAttributes#USAGE_ASSISTANCE_ACCESSIBILITY
be controlled by the android.media.AudioManager#STREAM_ACCESSIBILITY
volume.
Value: 128
FLAG_INCLUDE_NOT_IMPORTANT_VIEWS
static val FLAG_INCLUDE_NOT_IMPORTANT_VIEWS: Int
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 View#IMPORTANT_FOR_ACCESSIBILITY_NO
or View#IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS
and views that are marked as potentially important for accessibility via View#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 Android 4.1 (API level 16) 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 Android 4.0.4 (API level 15) or lower, 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 managers used to achieve the grid configuration are not important; rather it is important that there are nine evenly distributed elements.
Value: 2
FLAG_INPUT_METHOD_EDITOR
static val FLAG_INPUT_METHOD_EDITOR: Int
This flag makes the AccessibilityService an input method editor with a subset of input method editor capabilities: get the android.view.inputmethod.InputConnection
and get text selection change notifications.
Value: 32768
FLAG_REPORT_VIEW_IDS
static val FLAG_REPORT_VIEW_IDS: Int
This flag requests that the AccessibilityNodeInfo
s 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.
Value: 16
FLAG_REQUEST_2_FINGER_PASSTHROUGH
static val FLAG_REQUEST_2_FINGER_PASSTHROUGH: Int
This flag requests that when when FLAG_REQUEST_MULTI_FINGER_GESTURES
is enabled, two-finger passthrough gestures are re-enabled. Two-finger swipe gestures are not detected, but instead passed through as one-finger gestures. In addition, three-finger swipes from the bottom of the screen are not detected, and instead are passed through unchanged. If FLAG_REQUEST_MULTI_FINGER_GESTURES
is disabled this flag has no effect.
Value: 8192
See Also
FLAG_REQUEST_ACCESSIBILITY_BUTTON
static val FLAG_REQUEST_ACCESSIBILITY_BUTTON: Int
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.
Note: For accessibility services targeting APIs greater than API 29
, this flag must be specified in the accessibility service metadata file. Otherwise, it will be ignored.
Value: 256
FLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY
static valFLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY: Int
Deprecated: No longer used
Value: 8
FLAG_REQUEST_FILTER_KEY_EVENTS
static val FLAG_REQUEST_FILTER_KEY_EVENTS: Int
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 {@value android.accessibilityservice.AccessibilityService#SERVICE_META_DATA AccessibilityService#SERVICE_META_DATA}.
Value: 32
FLAG_REQUEST_FINGERPRINT_GESTURES
static val FLAG_REQUEST_FINGERPRINT_GESTURES: Int
This flag requests that all fingerprint gestures be sent to the accessibility service.
Services that want to set this flag have to declare the capability to retrieve window content in their meta-data by setting the attribute android.R.attr#canRequestFingerprintGestures
to true, otherwise this flag will be ignored. For how to declare the meta-data of a service refer to {@value android.accessibilityservice.AccessibilityService#SERVICE_META_DATA AccessibilityService#SERVICE_META_DATA}.
Value: 512
FLAG_REQUEST_MULTI_FINGER_GESTURES
static val FLAG_REQUEST_MULTI_FINGER_GESTURES: Int
This flag requests that when when FLAG_REQUEST_TOUCH_EXPLORATION_MODE
is enabled, multi-finger gestures are also enabled. As a consequence, two-finger bypass gestures will be disabled. If FLAG_REQUEST_TOUCH_EXPLORATION_MODE
is disabled this flag has no effect.
Value: 4096
See Also
FLAG_REQUEST_SHORTCUT_WARNING_DIALOG_SPOKEN_FEEDBACK
static val FLAG_REQUEST_SHORTCUT_WARNING_DIALOG_SPOKEN_FEEDBACK: Int
This flag requests that accessibility shortcut warning dialog has spoken feedback when dialog is shown.
Value: 1024
FLAG_REQUEST_TOUCH_EXPLORATION_MODE
static val FLAG_REQUEST_TOUCH_EXPLORATION_MODE: Int
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 Android 4.3 (API level 18) or higher 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 {@value android.accessibilityservice.AccessibilityService#SERVICE_META_DATA AccessibilityService#SERVICE_META_DATA}.
Services targeting Android 4.2.2 (API level 17) or lower will work normally. In other words, the first time they are run, if this flag is specified, a dialog is shown to the user to confirm enabling explore by touch.
Value: 4
FLAG_RETRIEVE_INTERACTIVE_WINDOWS
static val FLAG_RETRIEVE_INTERACTIVE_WINDOWS: Int
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 android.view.accessibility.AccessibilityEvent#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 {@value android.accessibilityservice.AccessibilityService#SERVICE_META_DATA AccessibilityService#SERVICE_META_DATA}.
Value: 64
FLAG_SEND_MOTION_EVENTS
static val FLAG_SEND_MOTION_EVENTS: Int
This flag requests that when when FLAG_REQUEST_TOUCH_EXPLORATION_MODE
is enabled, a service will receive the motion events for each successfully-detected gesture. The service will also receive an AccessibilityGestureEvent of type GESTURE_INVALID for each cancelled gesture along with its motion events. A service will receive a gesture of type GESTURE_PASSTHROUGH and accompanying motion events for every passthrough gesture that does not start gesture detection. This information can be used to collect instances of improper gesture detection behavior and relay that information to framework developers. If FLAG_REQUEST_TOUCH_EXPLORATION_MODE
is disabled this flag has no effect.
Value: 16384
See Also
FLAG_SERVICE_HANDLES_DOUBLE_TAP
static val FLAG_SERVICE_HANDLES_DOUBLE_TAP: Int
This flag requests that when FLAG_REQUEST_TOUCH_EXPLORATION_MODE
is enabled, double tap and double tap and hold gestures are dispatched to the service rather than being handled by the framework. If FLAG_REQUEST_TOUCH_EXPLORATION_MODE
is disabled this flag has no effect.
Value: 2048
See Also
Public constructors
Public methods
capabilityToString
open static fun capabilityToString(capability: Int): String!
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. |
Return | |
---|---|
String! |
The string representation. |
describeContents
open fun describeContents(): Int
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(android.os.Parcel,int)
, the return value of this method must include the CONTENTS_FILE_DESCRIPTOR
bit.
Return | |
---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR |
equals
open fun equals(other: Any?): Boolean
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
x
andy
,x.equals(y)
should returntrue
if and only ify.equals(x)
returnstrue
. - It is transitive: for any non-null reference values
x
,y
, andz
, ifx.equals(y)
returnstrue
andy.equals(z)
returnstrue
, thenx.equals(z)
should returntrue
. - It is consistent: for any non-null reference values
x
andy
, multiple invocations ofx.equals(y)
consistently returntrue
or consistently returnfalse
, provided no information used inequals
comparisons on the objects is modified. - For any non-null reference value
x
,x.equals(null)
should returnfalse
.
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
Parameters | |
---|---|
obj |
This value may be null . |
Return | |
---|---|
Boolean |
true if this object is the same as the obj argument; false otherwise. |
feedbackTypeToString
open static fun feedbackTypeToString(feedbackType: Int): String!
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. |
Return | |
---|---|
String! |
The string representation. |
flagToString
open static fun flagToString(flag: Int): String!
Returns the string representation of a flag. For example, DEFAULT
is represented by the string DEFAULT.
Parameters | |
---|---|
flag |
Int: The flag. |
Return | |
---|---|
String! |
The string representation. |
getCanRetrieveWindowContent
open fungetCanRetrieveWindowContent(): Boolean
Deprecated: Use getCapabilities()
.
Whether this service can retrieve the current window's content.
Statically set from meta-data
.
Return | |
---|---|
Boolean |
True if window content can be retrieved. |
getCapabilities
open fun getCapabilities(): Int
Returns the bit mask of capabilities this accessibility service has such as being able to retrieve the active window content, etc.
Return | |
---|---|
Int |
The capability bit mask. |
getDescription
open fungetDescription(): String!
Deprecated: Use loadDescription(android.content.pm.PackageManager)
.
Gets the non-localized description of the accessibility service.
Statically set from meta-data
.
Return | |
---|---|
String! |
The description. |
getId
open fun getId(): String!
The accessibility service id.
Generated by the system.
Return | |
---|---|
String! |
The id (or null if the component is not set yet). |
getInteractiveUiTimeoutMillis
open fun getInteractiveUiTimeoutMillis(): Int
Get the recommended timeout for interactive controls.
Return | |
---|---|
Int |
The timeout in milliseconds. |
See Also
getMotionEventSources
open fun getMotionEventSources(): Int
Returns the bit mask of android.view.InputDevice
sources that the accessibility service wants to listen to for generic android.view.MotionEvent
s.
getNonInteractiveUiTimeoutMillis
open fun getNonInteractiveUiTimeoutMillis(): Int
Get the recommended timeout for non-interactive controls.
Return | |
---|---|
Int |
The timeout in milliseconds. |
getResolveInfo
open fun getResolveInfo(): ResolveInfo!
The service ResolveInfo
.
Generated by the system.
Return | |
---|---|
ResolveInfo! |
The info. |
getSettingsActivityName
open fun getSettingsActivityName(): String!
The settings activity name.
Statically set from meta-data
.
Return | |
---|---|
String! |
The settings activity name. |
getTileServiceName
open fun getTileServiceName(): String?
Gets the name of android.service.quicksettings.TileService
is associated with this accessibility service.
Return | |
---|---|
String? |
The name of android.service.quicksettings.TileService . This value may be null . |
hashCode
open fun hashCode(): Int
Return | |
---|---|
Int |
a hash code value for this object. |
isAccessibilityTool
open fun isAccessibilityTool(): Boolean
Indicates if the service is used to assist users with disabilities.
Return | |
---|---|
Boolean |
true if the property is set to true. |
loadDescription
open fun loadDescription(packageManager: PackageManager!): String!
The localized description of the accessibility service.
Statically set from meta-data
.
Return | |
---|---|
String! |
The localized description. |
loadIntro
open fun loadIntro(packageManager: PackageManager): CharSequence?
The localized intro of the accessibility service.
Statically set from meta-data
.
Parameters | |
---|---|
packageManager |
PackageManager: This value cannot be null . |
Return | |
---|---|
CharSequence? |
The localized intro if available, and null if a intro has not been provided. |
loadSummary
open fun loadSummary(packageManager: PackageManager!): CharSequence!
The localized summary of the accessibility service.
Statically set from meta-data
.
Return | |
---|---|
CharSequence! |
The localized summary if available, and null if a summary has not been provided. |
setInteractiveUiTimeoutMillis
open fun setInteractiveUiTimeoutMillis(timeout: Int): Unit
Set the recommended time that interactive controls need to remain on the screen to support the user.
This value can be dynamically set at runtime by AccessibilityService#setServiceInfo(AccessibilityServiceInfo)
.
Parameters | |
---|---|
timeout |
Int: The timeout in milliseconds. Value is 0 or greater |
setMotionEventSources
open fun setMotionEventSources(motionEventSources: Int): Unit
Sets the bit mask of android.view.InputDevice
sources that the accessibility service wants to listen to for generic android.view.MotionEvent
s.
Including an android.view.InputDevice
source that does not send android.view.MotionEvent
s is effectively a no-op for that source, since you will not receive any events from that source.
See android.view.InputDevice
for complete source definitions. Many input devices send android.view.InputEvent
s from more than one type of source so you may need to include multiple android.view.MotionEvent
sources here, in addition to using AccessibilityService#onKeyEvent
to listen to android.view.KeyEvent
s.
Note: android.view.InputDevice
sources contain source class bits that complicate bitwise flag removal operations. To remove a specific source you should rebuild the entire value using bitwise OR operations on the individual source constants.
setNonInteractiveUiTimeoutMillis
open fun setNonInteractiveUiTimeoutMillis(timeout: Int): Unit
Set the recommended time that non-interactive controls need to remain on the screen to support the user.
This value can be dynamically set at runtime by AccessibilityService#setServiceInfo(AccessibilityServiceInfo)
.
Parameters | |
---|---|
timeout |
Int: The timeout in milliseconds. Value is 0 or greater |
toString
open fun toString(): String
Return | |
---|---|
String |
a string representation of the object. |
writeToParcel
open fun writeToParcel(
parcel: Parcel,
flagz: Int
): Unit
Parameters | |
---|---|
dest |
The Parcel in which the object should be written. This value cannot be null . |
flags |
Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE . Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE , and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |
Properties
CREATOR
static val CREATOR: Parcelable.Creator<AccessibilityServiceInfo!>
See Also
eventTypes
var eventTypes: Int
The event types an AccessibilityService
is interested in.
Can be dynamically set at runtime.
See Also
android.view.accessibility.AccessibilityEvent#TYPE_VIEW_CLICKED
android.view.accessibility.AccessibilityEvent#TYPE_VIEW_LONG_CLICKED
android.view.accessibility.AccessibilityEvent#TYPE_VIEW_FOCUSED
android.view.accessibility.AccessibilityEvent#TYPE_VIEW_SELECTED
android.view.accessibility.AccessibilityEvent#TYPE_VIEW_TEXT_CHANGED
android.view.accessibility.AccessibilityEvent#TYPE_WINDOW_STATE_CHANGED
android.view.accessibility.AccessibilityEvent#TYPE_NOTIFICATION_STATE_CHANGED
android.view.accessibility.AccessibilityEvent#TYPE_TOUCH_EXPLORATION_GESTURE_START
android.view.accessibility.AccessibilityEvent#TYPE_TOUCH_EXPLORATION_GESTURE_END
android.view.accessibility.AccessibilityEvent#TYPE_VIEW_HOVER_ENTER
android.view.accessibility.AccessibilityEvent#TYPE_VIEW_HOVER_EXIT
android.view.accessibility.AccessibilityEvent#TYPE_VIEW_SCROLLED
android.view.accessibility.AccessibilityEvent#TYPE_VIEW_TEXT_SELECTION_CHANGED
android.view.accessibility.AccessibilityEvent#TYPE_WINDOW_CONTENT_CHANGED
android.view.accessibility.AccessibilityEvent#TYPE_TOUCH_INTERACTION_START
android.view.accessibility.AccessibilityEvent#TYPE_TOUCH_INTERACTION_END
android.view.accessibility.AccessibilityEvent#TYPE_ANNOUNCEMENT
android.view.accessibility.AccessibilityEvent#TYPE_GESTURE_DETECTION_START
android.view.accessibility.AccessibilityEvent#TYPE_GESTURE_DETECTION_END
android.view.accessibility.AccessibilityEvent#TYPE_VIEW_ACCESSIBILITY_FOCUSED
android.view.accessibility.AccessibilityEvent#TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED
android.view.accessibility.AccessibilityEvent#TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY
android.view.accessibility.AccessibilityEvent#TYPE_WINDOWS_CHANGED
feedbackType
var feedbackType: Int
The feedback type an AccessibilityService
provides.
Can be dynamically set at runtime.
Value is either
0
or a combination of android.accessibilityservice.AccessibilityServiceInfo#FEEDBACK_AUDIBLE
, android.accessibilityservice.AccessibilityServiceInfo#FEEDBACK_GENERIC
, android.accessibilityservice.AccessibilityServiceInfo#FEEDBACK_HAPTIC
, android.accessibilityservice.AccessibilityServiceInfo#FEEDBACK_SPOKEN
, android.accessibilityservice.AccessibilityServiceInfo#FEEDBACK_VISUAL
, and android.accessibilityservice.AccessibilityServiceInfo#FEEDBACK_BRAILLE
flags
var flags: Int
This field represents a set of flags used for configuring an AccessibilityService
.
Can be dynamically set at runtime.
Note: Accessibility services with targetSdkVersion greater than API 29
cannot dynamically set the FLAG_REQUEST_ACCESSIBILITY_BUTTON
at runtime. It must be specified in the accessibility service metadata file.
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
#FLAG_ENABLE_ACCESSIBILITY_VOLUME
#FLAG_REQUEST_ACCESSIBILITY_BUTTON
#FLAG_REQUEST_SHORTCUT_WARNING_DIALOG_SPOKEN_FEEDBACK
#FLAG_INPUT_METHOD_EDITOR
notificationTimeout
var notificationTimeout: Long
The timeout, in milliseconds, 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
var packageNames: Array<String!>!
The package names an AccessibilityService
is interested in. Setting to null
is equivalent to all packages.
Can be dynamically set at runtime.