public class

AccessibilityServiceInfo

extends Object
implements Parcelable
java.lang.Object
   ↳ android.accessibilityservice.AccessibilityServiceInfo

Class Overview

This class describes an AccessibilityService. The system notifies an AccessibilityService for AccessibilityEvents according to the information encapsulated in this class.

Summary

Constants
int DEFAULT If an AccessibilityService is 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_GENERIC Denotes generic feedback.
int FEEDBACK_HAPTIC Denotes haptic feedback.
int FEEDBACK_SPOKEN Denotes spoken feedback.
int FEEDBACK_VISUAL Denotes visual feedback.
[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<AccessibilityServiceInfo> CREATOR
public int eventTypes The event types an AccessibilityService is interested in.
public int feedbackType The feedback type an AccessibilityService provides.
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 AccessibilityService is notified.
public String[] packageNames The package names an AccessibilityService is interested in.
Public Constructors
AccessibilityServiceInfo()
Creates a new instance.
Public Methods
int describeContents()
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
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()
Whether this service can retrieve the current window's content.
String getDescription()
Description of the accessibility service.
String getId()
The accessibility service id.
ResolveInfo getResolveInfo()
The service ResolveInfo.
String getSettingsActivityName()
The settings activity name.
String toString()
Returns a string containing a concise, human-readable description of this object.
void writeToParcel(Parcel parcel, int flagz)
Flatten this object in to a Parcel.
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Constants

public static final int DEFAULT

Since: API Level 4

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)

public static final int FEEDBACK_ALL_MASK

Since: API Level 14

Mask for all feedback types.

Constant Value: -1 (0xffffffff)

public static final int FEEDBACK_AUDIBLE

Since: API Level 4

Denotes audible (not spoken) feedback.

Constant Value: 4 (0x00000004)

public static final int FEEDBACK_GENERIC

Since: API Level 4

Denotes generic feedback.

Constant Value: 16 (0x00000010)

public static final int FEEDBACK_HAPTIC

Since: API Level 4

Denotes haptic feedback.

Constant Value: 2 (0x00000002)

public static final int FEEDBACK_SPOKEN

Since: API Level 4

Denotes spoken feedback.

Constant Value: 1 (0x00000001)

public static final int FEEDBACK_VISUAL

Since: API Level 4

Denotes visual feedback.

Constant Value: 8 (0x00000008)

Fields

public static final Creator<AccessibilityServiceInfo> CREATOR

Since: API Level 4

public int feedbackType

Since: API Level 4

The feedback type an AccessibilityService provides.

Can be dynamically set at runtime.

public int flags

Since: API Level 4

This field represents a set of flags used for configuring an AccessibilityService.

Can be dynamically set at runtime.

See Also

public long notificationTimeout

Since: API Level 4

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.

public String[] packageNames

Since: API Level 4

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 AccessibilityServiceInfo ()

Since: API Level 4

Creates a new instance.

Public Methods

public int describeContents ()

Since: API Level 4

Describe the kinds of special objects contained in this Parcelable's marshalled representation.

Returns
  • a bitmask indicating the set of special object types marshalled by the Parcelable.

public static String feedbackTypeToString (int feedbackType)

Since: API Level 14

Returns the string representation of a feedback type. For example, FEEDBACK_SPOKEN is represented by the string FEEDBACK_SPOKEN.

Parameters
feedbackType The feedback type.
Returns
  • The string representation.

public static String flagToString (int flag)

Since: API Level 14

Returns the string representation of a flag. For example, DEFAULT is represented by the string DEFAULT.

Parameters
flag The flag.
Returns
  • The string representation.

public boolean getCanRetrieveWindowContent ()

Since: API Level 14

Whether this service can retrieve the current window's content.

Statically set from meta-data.

Returns
  • True window content can be retrieved.

public String getDescription ()

Since: API Level 14

Description of the accessibility service.

Statically set from meta-data.

Returns
  • The description.

public String getId ()

Since: API Level 14

The accessibility service id.

Generated by the system.

Returns
  • The id.

public ResolveInfo getResolveInfo ()

Since: API Level 14

The service ResolveInfo.

Generated by the system.

Returns
  • The info.

public String getSettingsActivityName ()

Since: API Level 14

The settings activity name.

Statically set from meta-data.

Returns
  • The settings activity name.

public String toString ()

Since: API Level 4

Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:

   getClass().getName() + '@' + Integer.toHexString(hashCode())

See Writing a useful toString method if you intend implementing your own toString method.

Returns
  • a printable representation of this object.

public void writeToParcel (Parcel parcel, int flagz)

Since: API Level 4

Flatten this object in to a Parcel.

Parameters
parcel The Parcel in which the object should be written.
flagz Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.