/* * Copyright (C) 2009 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.view.accessibility; import android.annotation.IntDef; import android.annotation.NonNull; import android.compat.annotation.UnsupportedAppUsage; import android.os.Build; import android.os.Parcel; import android.os.Parcelable; import android.text.TextUtils; import android.util.Log; import android.util.Pools.SynchronizedPool; import com.android.internal.util.BitUtils; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.util.ArrayList; import java.util.List; /** *
* This class represents accessibility events that are sent by the system when * something notable happens in the user interface. For example, when a * {@link android.widget.Button} is clicked, a {@link android.view.View} is focused, etc. *
** An accessibility event is fired by an individual view which populates the event with * data for its state and requests from its parent to send the event to interested * parties. The parent can optionally modify or even block the event based on its broader * understanding of the user interface's context. *
** The main purpose of an accessibility event is to communicate changes in the UI to an * {@link android.accessibilityservice.AccessibilityService}. The service may then inspect, * if needed the user interface by examining the View hierarchy, as represented by a tree of * {@link AccessibilityNodeInfo}s (snapshot of a View state) * which can be used for exploring the window content. Note that the privilege for accessing * an event's source, thus the window content, has to be explicitly requested. For more * details refer to {@link android.accessibilityservice.AccessibilityService}. If an * accessibility service has not requested to retrieve the window content the event will * not contain reference to its source. Also for events of type * {@link #TYPE_NOTIFICATION_STATE_CHANGED} the source is never available. *
** This class represents various semantically different accessibility event * types. Each event type has an associated set of related properties. In other * words, each event type is characterized via a subset of the properties exposed * by this class. For each event type there is a corresponding constant defined * in this class. Follows a specification of the event types and their associated properties: *
*For more information about creating and processing AccessibilityEvents, read the * Accessibility * developer guide.
** VIEW TYPES *
** View clicked - represents the event of clicking on a {@link android.view.View} * like {@link android.widget.Button}, {@link android.widget.CompoundButton}, etc. * Type:{@link #TYPE_VIEW_CLICKED} * Properties: *
* View long clicked - represents the event of long clicking on a {@link android.view.View} * like {@link android.widget.Button}, {@link android.widget.CompoundButton}, etc * Type:{@link #TYPE_VIEW_LONG_CLICKED} * Properties: *
* View selected - represents the event of selecting an item usually in * the context of an {@link android.widget.AdapterView}. * Type: {@link #TYPE_VIEW_SELECTED} * Properties: *
* View focused - represents the event of focusing a * {@link android.view.View}. * Type: {@link #TYPE_VIEW_FOCUSED} * Properties: *
* View text changed - represents the event of changing the text of an * {@link android.widget.EditText}. * Type: {@link #TYPE_VIEW_TEXT_CHANGED} * Properties: *
* View text selection changed - represents the event of changing the text * selection of an {@link android.widget.EditText}. * Type: {@link #TYPE_VIEW_TEXT_SELECTION_CHANGED} * Properties: *
* View scrolled - represents the event of scrolling a view. * Type: {@link #TYPE_VIEW_SCROLLED} * Properties: *
* TRANSITION TYPES *
** Window state changed - represents the event of a change to a section of * the user interface that is visually distinct. Should be sent from either the * root view of a window or from a view that is marked as a pane * {@link android.view.View#setAccessibilityPaneTitle(CharSequence)}. Note that changes * to true windows are represented by {@link #TYPE_WINDOWS_CHANGED}. * Type: {@link #TYPE_WINDOW_STATE_CHANGED} * Properties: *
* Window content changed - represents the event of change in the * content of a window. This change can be adding/removing view, changing * a view size, etc. *
** Type: {@link #TYPE_WINDOW_CONTENT_CHANGED} * Properties: *
* Windows changed - represents a change in the windows shown on * the screen such as a window appeared, a window disappeared, a window size changed, * a window layer changed, etc. These events should only come from the system, which is responsible * for managing windows. The list of windows is available from * {@link android.accessibilityservice.AccessibilityService#getWindows()}. * For regions of the user interface that are presented as windows but are * controlled by an app's process, use {@link #TYPE_WINDOW_STATE_CHANGED}. * Type: {@link #TYPE_WINDOWS_CHANGED} * Properties: *
* NOTIFICATION TYPES *
** Notification state changed - represents the event showing a transient piece of information * to the user. This information may be a {@link android.app.Notification} or * {@link android.widget.Toast}. * Type: {@link #TYPE_NOTIFICATION_STATE_CHANGED} * Properties: *
* EXPLORATION TYPES *
** View hover enter - represents the event of beginning to hover * over a {@link android.view.View}. The hover may be generated via * exploring the screen by touch or via a pointing device. * Type: {@link #TYPE_VIEW_HOVER_ENTER} * Properties: *
* Touch interaction start - represents the event of starting a touch * interaction, which is the user starts touching the screen. * Type: {@link #TYPE_TOUCH_INTERACTION_START} * Properties: *
* Touch interaction end - represents the event of ending a touch * interaction, which is the user stops touching the screen. * Type: {@link #TYPE_TOUCH_INTERACTION_END} * Properties: *
* Touch exploration gesture start - represents the event of starting a touch * exploring gesture. * Type: {@link #TYPE_TOUCH_EXPLORATION_GESTURE_START} * Properties: *
* Touch exploration gesture end - represents the event of ending a touch * exploring gesture. * Type: {@link #TYPE_TOUCH_EXPLORATION_GESTURE_END} * Properties: *
* Touch gesture detection start - represents the event of starting a user * gesture detection. * Type: {@link #TYPE_GESTURE_DETECTION_START} * Properties: *
* Touch gesture detection end - represents the event of ending a user * gesture detection. * Type: {@link #TYPE_GESTURE_DETECTION_END} * Properties: *
* MISCELLANEOUS TYPES *
** Announcement - represents the event of an application requesting a screen reader to make * an announcement. Because the event carries no semantic meaning, this event is appropriate only * in exceptional situations where additional screen reader output is needed but other types of * accessibility services do not need to be aware of the change. * Type: {@link #TYPE_ANNOUNCEMENT} * Properties: *
* Starting in {@link android.os.Build.VERSION_CODES#R R}, this event implies the window's * region changed. It's also possible that region changed but bounds doesn't. *
*/ public static final int WINDOWS_CHANGE_BOUNDS = 0x00000008; /** * Change type for {@link #TYPE_WINDOWS_CHANGED} event: * The window's layer changed. */ public static final int WINDOWS_CHANGE_LAYER = 0x00000010; /** * Change type for {@link #TYPE_WINDOWS_CHANGED} event: * The window's {@link AccessibilityWindowInfo#isActive()} changed. */ public static final int WINDOWS_CHANGE_ACTIVE = 0x00000020; /** * Change type for {@link #TYPE_WINDOWS_CHANGED} event: * The window's {@link AccessibilityWindowInfo#isFocused()} changed. */ public static final int WINDOWS_CHANGE_FOCUSED = 0x00000040; /** * Change type for {@link #TYPE_WINDOWS_CHANGED} event: * The window's {@link AccessibilityWindowInfo#isAccessibilityFocused()} changed. */ public static final int WINDOWS_CHANGE_ACCESSIBILITY_FOCUSED = 0x00000080; /** * Change type for {@link #TYPE_WINDOWS_CHANGED} event: * The window's parent changed. */ public static final int WINDOWS_CHANGE_PARENT = 0x00000100; /** * Change type for {@link #TYPE_WINDOWS_CHANGED} event: * The window's children changed. */ public static final int WINDOWS_CHANGE_CHILDREN = 0x00000200; /** * Change type for {@link #TYPE_WINDOWS_CHANGED} event: * The window either entered or exited picture-in-picture mode. */ public static final int WINDOWS_CHANGE_PIP = 0x00000400; /** @hide */ @Retention(RetentionPolicy.SOURCE) @IntDef(flag = true, prefix = { "WINDOWS_CHANGE_" }, value = { WINDOWS_CHANGE_ADDED, WINDOWS_CHANGE_REMOVED, WINDOWS_CHANGE_TITLE, WINDOWS_CHANGE_BOUNDS, WINDOWS_CHANGE_LAYER, WINDOWS_CHANGE_ACTIVE, WINDOWS_CHANGE_FOCUSED, WINDOWS_CHANGE_ACCESSIBILITY_FOCUSED, WINDOWS_CHANGE_PARENT, WINDOWS_CHANGE_CHILDREN, WINDOWS_CHANGE_PIP }) public @interface WindowsChangeTypes {} /** @hide */ @Retention(RetentionPolicy.SOURCE) @IntDef(flag = true, prefix = { "CONTENT_CHANGE_TYPE_" }, value = { CONTENT_CHANGE_TYPE_UNDEFINED, CONTENT_CHANGE_TYPE_SUBTREE, CONTENT_CHANGE_TYPE_TEXT, CONTENT_CHANGE_TYPE_CONTENT_DESCRIPTION, CONTENT_CHANGE_TYPE_STATE_DESCRIPTION, CONTENT_CHANGE_TYPE_PANE_TITLE, CONTENT_CHANGE_TYPE_PANE_APPEARED, CONTENT_CHANGE_TYPE_PANE_DISAPPEARED, CONTENT_CHANGE_TYPE_DRAG_STARTED, CONTENT_CHANGE_TYPE_DRAG_DROPPED, CONTENT_CHANGE_TYPE_DRAG_CANCELLED }) public @interface ContentChangeTypes {} /** @hide */ @IntDef(flag = true, prefix = { "TYPE_" }, value = { TYPE_VIEW_CLICKED, TYPE_VIEW_LONG_CLICKED, TYPE_VIEW_SELECTED, TYPE_VIEW_FOCUSED, TYPE_VIEW_TEXT_CHANGED, TYPE_WINDOW_STATE_CHANGED, TYPE_NOTIFICATION_STATE_CHANGED, TYPE_VIEW_HOVER_ENTER, TYPE_VIEW_HOVER_EXIT, TYPE_TOUCH_EXPLORATION_GESTURE_START, TYPE_TOUCH_EXPLORATION_GESTURE_END, TYPE_WINDOW_CONTENT_CHANGED, TYPE_VIEW_SCROLLED, TYPE_VIEW_TEXT_SELECTION_CHANGED, TYPE_ANNOUNCEMENT, TYPE_VIEW_ACCESSIBILITY_FOCUSED, TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED, TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY, TYPE_GESTURE_DETECTION_START, TYPE_GESTURE_DETECTION_END, TYPE_TOUCH_INTERACTION_START, TYPE_TOUCH_INTERACTION_END, TYPE_WINDOWS_CHANGED, TYPE_VIEW_CONTEXT_CLICKED, TYPE_ASSIST_READING_CONTEXT }) @Retention(RetentionPolicy.SOURCE) public @interface EventType {} /** * Mask for {@link AccessibilityEvent} all types. * * @see #TYPE_VIEW_CLICKED * @see #TYPE_VIEW_LONG_CLICKED * @see #TYPE_VIEW_SELECTED * @see #TYPE_VIEW_FOCUSED * @see #TYPE_VIEW_TEXT_CHANGED * @see #TYPE_WINDOW_STATE_CHANGED * @see #TYPE_NOTIFICATION_STATE_CHANGED * @see #TYPE_VIEW_HOVER_ENTER * @see #TYPE_VIEW_HOVER_EXIT * @see #TYPE_TOUCH_EXPLORATION_GESTURE_START * @see #TYPE_TOUCH_EXPLORATION_GESTURE_END * @see #TYPE_WINDOW_CONTENT_CHANGED * @see #TYPE_VIEW_SCROLLED * @see #TYPE_VIEW_TEXT_SELECTION_CHANGED * @see #TYPE_ANNOUNCEMENT * @see #TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY * @see #TYPE_GESTURE_DETECTION_START * @see #TYPE_GESTURE_DETECTION_END * @see #TYPE_TOUCH_INTERACTION_START * @see #TYPE_TOUCH_INTERACTION_END * @see #TYPE_WINDOWS_CHANGED * @see #TYPE_VIEW_CONTEXT_CLICKED */ public static final int TYPES_ALL_MASK = 0xFFFFFFFF; private static final int MAX_POOL_SIZE = 10; private static final SynchronizedPooleventType
.
*
* @param eventType The event type.
*/
public AccessibilityEvent(int eventType) {
mEventType = eventType;
if (DEBUG_ORIGIN) originStackTrace = Thread.currentThread().getStackTrace();
}
/**
* Copy constructor. Creates a new {@link AccessibilityEvent}, and this instance is initialized
* from the given event
.
*
* @param event The other event.
*/
public AccessibilityEvent(@NonNull AccessibilityEvent event) {
init(event);
}
/**
* Initialize an event from another one.
*
* @param event The event to initialize from.
*/
void init(AccessibilityEvent event) {
super.init(event);
mEventType = event.mEventType;
mMovementGranularity = event.mMovementGranularity;
mAction = event.mAction;
mContentChangeTypes = event.mContentChangeTypes;
mWindowChangeTypes = event.mWindowChangeTypes;
mEventTime = event.mEventTime;
mPackageName = event.mPackageName;
if (event.mRecords != null) {
final int recordCount = event.mRecords.size();
mRecords = new ArrayList<>(recordCount);
for (int i = 0; i < recordCount; i++) {
final AccessibilityRecord record = event.mRecords.get(i);
final AccessibilityRecord recordClone = new AccessibilityRecord(record);
mRecords.add(recordClone);
}
}
if (DEBUG_ORIGIN) originStackTrace = event.originStackTrace;
}
/**
* Sets if this instance is sealed.
*
* @param sealed Whether is sealed.
*
* @hide
*/
@Override
public void setSealed(boolean sealed) {
super.setSealed(sealed);
final List* Valid actions are defined in {@link AccessibilityNodeInfo}: *
In most situations object pooling is not beneficial. Create a new instance using the
* constructor {@link #AccessibilityEvent(int)} instead.
*
* @param eventType The event type.
* @return An instance.
*/
public static AccessibilityEvent obtain(int eventType) {
AccessibilityEvent event = AccessibilityEvent.obtain();
event.setEventType(eventType);
return event;
}
/**
* Returns a cached instance if such is available or a new one is
* created. The returned instance is initialized from the given
* event
.
*
*
In most situations object pooling is not beneficial. Create a new instance using the * constructor {@link #AccessibilityEvent(AccessibilityEvent)} instead. * * @param event The other event. * @return An instance. */ public static AccessibilityEvent obtain(AccessibilityEvent event) { AccessibilityEvent eventClone = AccessibilityEvent.obtain(); eventClone.init(event); return eventClone; } /** * Returns a cached instance if such is available or a new one is * instantiated. * *
In most situations object pooling is not beneficial. Create a new instance using the * constructor {@link #AccessibilityEvent()} instead. * * @return An instance. */ public static AccessibilityEvent obtain() { AccessibilityEvent event = sPool.acquire(); if (event == null) event = new AccessibilityEvent(); if (DEBUG_ORIGIN) event.originStackTrace = Thread.currentThread().getStackTrace(); return event; } /** * Recycles an instance back to be reused. *
* Note: You must not touch the object after calling this function. *
* *In most situations object pooling is not beneficial, and recycling is not necessary.
*
* @throws IllegalStateException If the event is already recycled.
*/
@Override
public void recycle() {
clear();
sPool.release(this);
}
/**
* Clears the state of this instance.
*
* @hide
*/
@Override
protected void clear() {
super.clear();
mEventType = 0;
mMovementGranularity = 0;
mAction = 0;
mContentChangeTypes = 0;
mWindowChangeTypes = 0;
mPackageName = null;
mEventTime = 0;
if (mRecords != null) {
while (!mRecords.isEmpty()) {
AccessibilityRecord record = mRecords.remove(0);
record.recycle();
}
}
if (DEBUG_ORIGIN) originStackTrace = null;
}
/**
* Creates a new instance from a {@link Parcel}.
*
* @param parcel A parcel containing the state of a {@link AccessibilityEvent}.
*/
public void initFromParcel(Parcel parcel) {
mSealed = (parcel.readInt() == 1);
mEventType = parcel.readInt();
mMovementGranularity = parcel.readInt();
mAction = parcel.readInt();
mContentChangeTypes = parcel.readInt();
mWindowChangeTypes = parcel.readInt();
mPackageName = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel);
mEventTime = parcel.readLong();
mConnectionId = parcel.readInt();
readAccessibilityRecordFromParcel(this, parcel);
// Read the records.
final int recordCount = parcel.readInt();
if (recordCount > 0) {
mRecords = new ArrayList<>(recordCount);
for (int i = 0; i < recordCount; i++) {
AccessibilityRecord record = AccessibilityRecord.obtain();
readAccessibilityRecordFromParcel(record, parcel);
record.mConnectionId = mConnectionId;
mRecords.add(record);
}
}
if (DEBUG_ORIGIN) {
originStackTrace = new StackTraceElement[parcel.readInt()];
for (int i = 0; i < originStackTrace.length; i++) {
originStackTrace[i] = new StackTraceElement(
parcel.readString(),
parcel.readString(),
parcel.readString(),
parcel.readInt());
}
}
}
/**
* Reads an {@link AccessibilityRecord} from a parcel.
*
* @param record The record to initialize.
* @param parcel The parcel to read from.
*/
private void readAccessibilityRecordFromParcel(AccessibilityRecord record,
Parcel parcel) {
record.mBooleanProperties = parcel.readInt();
record.mCurrentItemIndex = parcel.readInt();
record.mItemCount = parcel.readInt();
record.mFromIndex = parcel.readInt();
record.mToIndex = parcel.readInt();
record.mScrollX = parcel.readInt();
record.mScrollY = parcel.readInt();
record.mScrollDeltaX = parcel.readInt();
record.mScrollDeltaY = parcel.readInt();
record.mMaxScrollX = parcel.readInt();
record.mMaxScrollY = parcel.readInt();
record.mAddedCount = parcel.readInt();
record.mRemovedCount = parcel.readInt();
record.mClassName = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel);
record.mContentDescription = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel);
record.mBeforeText = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel);
record.mParcelableData = parcel.readParcelable(null);
parcel.readList(record.mText, null);
record.mSourceWindowId = parcel.readInt();
record.mSourceNodeId = parcel.readLong();
record.mSealed = (parcel.readInt() == 1);
}
/**
* {@inheritDoc}
*/
public void writeToParcel(Parcel parcel, int flags) {
parcel.writeInt(isSealed() ? 1 : 0);
parcel.writeInt(mEventType);
parcel.writeInt(mMovementGranularity);
parcel.writeInt(mAction);
parcel.writeInt(mContentChangeTypes);
parcel.writeInt(mWindowChangeTypes);
TextUtils.writeToParcel(mPackageName, parcel, 0);
parcel.writeLong(mEventTime);
parcel.writeInt(mConnectionId);
writeAccessibilityRecordToParcel(this, parcel, flags);
// Write the records.
final int recordCount = getRecordCount();
parcel.writeInt(recordCount);
for (int i = 0; i < recordCount; i++) {
AccessibilityRecord record = mRecords.get(i);
writeAccessibilityRecordToParcel(record, parcel, flags);
}
if (DEBUG_ORIGIN) {
if (originStackTrace == null) originStackTrace = Thread.currentThread().getStackTrace();
parcel.writeInt(originStackTrace.length);
for (StackTraceElement element : originStackTrace) {
parcel.writeString(element.getClassName());
parcel.writeString(element.getMethodName());
parcel.writeString(element.getFileName());
parcel.writeInt(element.getLineNumber());
}
}
}
/**
* Writes an {@link AccessibilityRecord} to a parcel.
*
* @param record The record to write.
* @param parcel The parcel to which to write.
*/
private void writeAccessibilityRecordToParcel(AccessibilityRecord record, Parcel parcel,
int flags) {
parcel.writeInt(record.mBooleanProperties);
parcel.writeInt(record.mCurrentItemIndex);
parcel.writeInt(record.mItemCount);
parcel.writeInt(record.mFromIndex);
parcel.writeInt(record.mToIndex);
parcel.writeInt(record.mScrollX);
parcel.writeInt(record.mScrollY);
parcel.writeInt(record.mScrollDeltaX);
parcel.writeInt(record.mScrollDeltaY);
parcel.writeInt(record.mMaxScrollX);
parcel.writeInt(record.mMaxScrollY);
parcel.writeInt(record.mAddedCount);
parcel.writeInt(record.mRemovedCount);
TextUtils.writeToParcel(record.mClassName, parcel, flags);
TextUtils.writeToParcel(record.mContentDescription, parcel, flags);
TextUtils.writeToParcel(record.mBeforeText, parcel, flags);
parcel.writeParcelable(record.mParcelableData, flags);
parcel.writeList(record.mText);
parcel.writeInt(record.mSourceWindowId);
parcel.writeLong(record.mSourceNodeId);
parcel.writeInt(record.mSealed ? 1 : 0);
}
/**
* {@inheritDoc}
*/
public int describeContents() {
return 0;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("EventType: ").append(eventTypeToString(mEventType));
builder.append("; EventTime: ").append(mEventTime);
builder.append("; PackageName: ").append(mPackageName);
if (!DEBUG_CONCISE_TOSTRING || mMovementGranularity != 0) {
builder.append("; MovementGranularity: ").append(mMovementGranularity);
}
if (!DEBUG_CONCISE_TOSTRING || mAction != 0) {
builder.append("; Action: ").append(mAction);
}
if (!DEBUG_CONCISE_TOSTRING || mContentChangeTypes != 0) {
builder.append("; ContentChangeTypes: ").append(
contentChangeTypesToString(mContentChangeTypes));
}
if (!DEBUG_CONCISE_TOSTRING || mWindowChangeTypes != 0) {
builder.append("; WindowChangeTypes: ").append(
windowChangeTypesToString(mWindowChangeTypes));
}
super.appendTo(builder);
if (DEBUG || DEBUG_CONCISE_TOSTRING) {
if (!DEBUG_CONCISE_TOSTRING) {
builder.append("\n");
}
if (DEBUG) {
builder.append("; SourceWindowId: 0x").append(Long.toHexString(mSourceWindowId));
builder.append("; SourceNodeId: 0x").append(Long.toHexString(mSourceNodeId));
}
for (int i = 0; i < getRecordCount(); i++) {
builder.append(" Record ").append(i).append(":");
getRecord(i).appendTo(builder).append("\n");
}
} else {
builder.append("; recordCount: ").append(getRecordCount());
}
return builder.toString();
}
/**
* Returns the string representation of an event type. For example,
* {@link #TYPE_VIEW_CLICKED} is represented by the string TYPE_VIEW_CLICKED.
*
* @param eventType The event type
* @return The string representation.
*/
public static String eventTypeToString(int eventType) {
if (eventType == TYPES_ALL_MASK) {
return "TYPES_ALL_MASK";
}
StringBuilder builder = new StringBuilder();
int eventTypeCount = 0;
while (eventType != 0) {
final int eventTypeFlag = 1 << Integer.numberOfTrailingZeros(eventType);
eventType &= ~eventTypeFlag;
if (eventTypeCount > 0) {
builder.append(", ");
}
builder.append(singleEventTypeToString(eventTypeFlag));
eventTypeCount++;
}
if (eventTypeCount > 1) {
builder.insert(0, '[');
builder.append(']');
}
return builder.toString();
}
private static String singleEventTypeToString(int eventType) {
switch (eventType) {
case TYPE_VIEW_CLICKED: return "TYPE_VIEW_CLICKED";
case TYPE_VIEW_LONG_CLICKED: return "TYPE_VIEW_LONG_CLICKED";
case TYPE_VIEW_SELECTED: return "TYPE_VIEW_SELECTED";
case TYPE_VIEW_FOCUSED: return "TYPE_VIEW_FOCUSED";
case TYPE_VIEW_TEXT_CHANGED: return "TYPE_VIEW_TEXT_CHANGED";
case TYPE_WINDOW_STATE_CHANGED: return "TYPE_WINDOW_STATE_CHANGED";
case TYPE_VIEW_HOVER_ENTER: return "TYPE_VIEW_HOVER_ENTER";
case TYPE_VIEW_HOVER_EXIT: return "TYPE_VIEW_HOVER_EXIT";
case TYPE_NOTIFICATION_STATE_CHANGED: return "TYPE_NOTIFICATION_STATE_CHANGED";
case TYPE_TOUCH_EXPLORATION_GESTURE_START: {
return "TYPE_TOUCH_EXPLORATION_GESTURE_START";
}
case TYPE_TOUCH_EXPLORATION_GESTURE_END: return "TYPE_TOUCH_EXPLORATION_GESTURE_END";
case TYPE_WINDOW_CONTENT_CHANGED: return "TYPE_WINDOW_CONTENT_CHANGED";
case TYPE_VIEW_TEXT_SELECTION_CHANGED: return "TYPE_VIEW_TEXT_SELECTION_CHANGED";
case TYPE_VIEW_SCROLLED: return "TYPE_VIEW_SCROLLED";
case TYPE_ANNOUNCEMENT: return "TYPE_ANNOUNCEMENT";
case TYPE_VIEW_ACCESSIBILITY_FOCUSED: return "TYPE_VIEW_ACCESSIBILITY_FOCUSED";
case TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED: {
return "TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED";
}
case TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY: {
return "TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY";
}
case TYPE_GESTURE_DETECTION_START: return "TYPE_GESTURE_DETECTION_START";
case TYPE_GESTURE_DETECTION_END: return "TYPE_GESTURE_DETECTION_END";
case TYPE_TOUCH_INTERACTION_START: return "TYPE_TOUCH_INTERACTION_START";
case TYPE_TOUCH_INTERACTION_END: return "TYPE_TOUCH_INTERACTION_END";
case TYPE_WINDOWS_CHANGED: return "TYPE_WINDOWS_CHANGED";
case TYPE_VIEW_CONTEXT_CLICKED: return "TYPE_VIEW_CONTEXT_CLICKED";
case TYPE_ASSIST_READING_CONTEXT: return "TYPE_ASSIST_READING_CONTEXT";
default: return Integer.toHexString(eventType);
}
}
/**
* @see Parcelable.Creator
*/
public static final @android.annotation.NonNull Parcelable.Creator