FileDocCategorySizeDatePackage
AccessibilityNodeInfo.javaAPI DocAndroid 5.1 API139827Thu Mar 12 22:22:10 GMT 2015android.view.accessibility

AccessibilityNodeInfo

public class AccessibilityNodeInfo extends Object implements android.os.Parcelable
This class represents a node of the window content as well as actions that can be requested from its source. From the point of view of an {@link android.accessibilityservice.AccessibilityService} a window content is presented as tree of accessibility node info which may or may not map one-to-one to the view hierarchy. In other words, a custom view is free to report itself as a tree of accessibility node info.

Once an accessibility node info is delivered to an accessibility service it is made immutable and calling a state mutation method generates an error.

Please refer to {@link android.accessibilityservice.AccessibilityService} for details about how to obtain a handle to window content as a tree of accessibility node info as well as familiarizing with the security model.

Developer Guides

For more information about making applications accessible, read the Accessibility developer guide.

see
android.accessibilityservice.AccessibilityService
see
AccessibilityEvent
see
AccessibilityManager

Fields Summary
private static final boolean
DEBUG
public static final int
UNDEFINED_CONNECTION_ID
public static final int
UNDEFINED_SELECTION_INDEX
public static final int
UNDEFINED_ITEM_ID
public static final long
ROOT_NODE_ID
public static final int
ACTIVE_WINDOW_ID
public static final int
ANY_WINDOW_ID
public static final int
FLAG_PREFETCH_PREDECESSORS
public static final int
FLAG_PREFETCH_SIBLINGS
public static final int
FLAG_PREFETCH_DESCENDANTS
public static final int
FLAG_INCLUDE_NOT_IMPORTANT_VIEWS
public static final int
FLAG_REPORT_VIEW_IDS
public static final int
ACTION_FOCUS
Action that gives input focus to the node.
public static final int
ACTION_CLEAR_FOCUS
Action that clears input focus of the node.
public static final int
ACTION_SELECT
Action that selects the node.
public static final int
ACTION_CLEAR_SELECTION
Action that deselects the node.
public static final int
ACTION_CLICK
Action that clicks on the node info.
public static final int
ACTION_LONG_CLICK
Action that long clicks on the node.
public static final int
ACTION_ACCESSIBILITY_FOCUS
Action that gives accessibility focus to the node.
public static final int
ACTION_CLEAR_ACCESSIBILITY_FOCUS
Action that clears accessibility focus of the node.
public static final int
ACTION_NEXT_AT_MOVEMENT_GRANULARITY
Action that requests to go to the next entity in this node's text at a given movement granularity. For example, move to the next character, word, etc.

Arguments: {@link #ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT}<, {@link #ACTION_ARGUMENT_EXTEND_SELECTION_BOOLEAN}
Example: Move to the previous character and do not extend selection.

Bundle arguments = new Bundle(); arguments.putInt(AccessibilityNodeInfo.ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT, AccessibilityNodeInfo.MOVEMENT_GRANULARITY_CHARACTER); arguments.putBoolean(AccessibilityNodeInfo.ACTION_ARGUMENT_EXTEND_SELECTION_BOOLEAN, false); info.performAction(AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY, arguments);

public static final int
ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY
Action that requests to go to the previous entity in this node's text at a given movement granularity. For example, move to the next character, word, etc.

Arguments: {@link #ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT}<, {@link #ACTION_ARGUMENT_EXTEND_SELECTION_BOOLEAN}
Example: Move to the next character and do not extend selection.

Bundle arguments = new Bundle(); arguments.putInt(AccessibilityNodeInfo.ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT, AccessibilityNodeInfo.MOVEMENT_GRANULARITY_CHARACTER); arguments.putBoolean(AccessibilityNodeInfo.ACTION_ARGUMENT_EXTEND_SELECTION_BOOLEAN, false); info.performAction(AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY, arguments);

public static final int
ACTION_NEXT_HTML_ELEMENT
Action to move to the next HTML element of a given type. For example, move to the BUTTON, INPUT, TABLE, etc.

Arguments: {@link #ACTION_ARGUMENT_HTML_ELEMENT_STRING}
Example:

Bundle arguments = new Bundle(); arguments.putString(AccessibilityNodeInfo.ACTION_ARGUMENT_HTML_ELEMENT_STRING, "BUTTON"); info.performAction(AccessibilityNodeInfo.ACTION_NEXT_HTML_ELEMENT, arguments);

public static final int
ACTION_PREVIOUS_HTML_ELEMENT
Action to move to the previous HTML element of a given type. For example, move to the BUTTON, INPUT, TABLE, etc.

Arguments: {@link #ACTION_ARGUMENT_HTML_ELEMENT_STRING}
Example:

Bundle arguments = new Bundle(); arguments.putString(AccessibilityNodeInfo.ACTION_ARGUMENT_HTML_ELEMENT_STRING, "BUTTON"); info.performAction(AccessibilityNodeInfo.ACTION_PREVIOUS_HTML_ELEMENT, arguments);

public static final int
ACTION_SCROLL_FORWARD
Action to scroll the node content forward.
public static final int
ACTION_SCROLL_BACKWARD
Action to scroll the node content backward.
public static final int
ACTION_COPY
Action to copy the current selection to the clipboard.
public static final int
ACTION_PASTE
Action to paste the current clipboard content.
public static final int
ACTION_CUT
Action to cut the current selection and place it to the clipboard.
public static final int
ACTION_SET_SELECTION
Action to set the selection. Performing this action with no arguments clears the selection.

Arguments: {@link #ACTION_ARGUMENT_SELECTION_START_INT}, {@link #ACTION_ARGUMENT_SELECTION_END_INT}
Example:

Bundle arguments = new Bundle(); arguments.putInt(AccessibilityNodeInfo.ACTION_ARGUMENT_SELECTION_START_INT, 1); arguments.putInt(AccessibilityNodeInfo.ACTION_ARGUMENT_SELECTION_END_INT, 2); info.performAction(AccessibilityNodeInfo.ACTION_SET_SELECTION, arguments);

public static final int
ACTION_EXPAND
Action to expand an expandable node.
public static final int
ACTION_COLLAPSE
Action to collapse an expandable node.
public static final int
ACTION_DISMISS
Action to dismiss a dismissable node.
public static final int
ACTION_SET_TEXT
Action that sets the text of the node. Performing the action without argument, using null or empty {@link CharSequence} will clear the text. This action will also put the cursor at the end of text.

Arguments: {@link #ACTION_ARGUMENT_SET_TEXT_CHARSEQUENCE}
Example:

Bundle arguments = new Bundle(); arguments.putCharSequence(AccessibilityNodeInfo.ACTION_ARGUMENT_SET_TEXT_CHARSEQUENCE, "android"); info.performAction(AccessibilityNodeInfo.ACTION_SET_TEXT, arguments);

private static final int
LAST_LEGACY_STANDARD_ACTION
private static final int
ACTION_TYPE_MASK
Mask to see if the value is larger than the largest ACTION_ constant
public static final String
ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT
Argument for which movement granularity to be used when traversing the node text.

Type: int
Actions: {@link #ACTION_NEXT_AT_MOVEMENT_GRANULARITY}, {@link #ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY}

public static final String
ACTION_ARGUMENT_HTML_ELEMENT_STRING
Argument for which HTML element to get moving to the next/previous HTML element.

Type: String
Actions: {@link #ACTION_NEXT_HTML_ELEMENT}, {@link #ACTION_PREVIOUS_HTML_ELEMENT}

public static final String
ACTION_ARGUMENT_EXTEND_SELECTION_BOOLEAN
Argument for whether when moving at granularity to extend the selection or to move it otherwise.

Type: boolean
Actions: {@link #ACTION_NEXT_AT_MOVEMENT_GRANULARITY}, {@link #ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY}

public static final String
ACTION_ARGUMENT_SELECTION_START_INT
Argument for specifying the selection start.

Type: int
Actions: {@link #ACTION_SET_SELECTION}

public static final String
ACTION_ARGUMENT_SELECTION_END_INT
Argument for specifying the selection end.

Type: int
Actions: {@link #ACTION_SET_SELECTION}

public static final String
ACTION_ARGUMENT_SET_TEXT_CHARSEQUENCE
Argument for specifying the text content to set

Type: CharSequence
Actions: {@link #ACTION_SET_TEXT}

public static final int
FOCUS_INPUT
The input focus.
public static final int
FOCUS_ACCESSIBILITY
The accessibility focus.
public static final int
MOVEMENT_GRANULARITY_CHARACTER
Movement granularity bit for traversing the text of a node by character.
public static final int
MOVEMENT_GRANULARITY_WORD
Movement granularity bit for traversing the text of a node by word.
public static final int
MOVEMENT_GRANULARITY_LINE
Movement granularity bit for traversing the text of a node by line.
public static final int
MOVEMENT_GRANULARITY_PARAGRAPH
Movement granularity bit for traversing the text of a node by paragraph.
public static final int
MOVEMENT_GRANULARITY_PAGE
Movement granularity bit for traversing the text of a node by page.
private static final int
BOOLEAN_PROPERTY_CHECKABLE
private static final int
BOOLEAN_PROPERTY_CHECKED
private static final int
BOOLEAN_PROPERTY_FOCUSABLE
private static final int
BOOLEAN_PROPERTY_FOCUSED
private static final int
BOOLEAN_PROPERTY_SELECTED
private static final int
BOOLEAN_PROPERTY_CLICKABLE
private static final int
BOOLEAN_PROPERTY_LONG_CLICKABLE
private static final int
BOOLEAN_PROPERTY_ENABLED
private static final int
BOOLEAN_PROPERTY_PASSWORD
private static final int
BOOLEAN_PROPERTY_SCROLLABLE
private static final int
BOOLEAN_PROPERTY_ACCESSIBILITY_FOCUSED
private static final int
BOOLEAN_PROPERTY_VISIBLE_TO_USER
private static final int
BOOLEAN_PROPERTY_EDITABLE
private static final int
BOOLEAN_PROPERTY_OPENS_POPUP
private static final int
BOOLEAN_PROPERTY_DISMISSABLE
private static final int
BOOLEAN_PROPERTY_MULTI_LINE
private static final int
BOOLEAN_PROPERTY_CONTENT_INVALID
private static final long
VIRTUAL_DESCENDANT_ID_MASK
Bits that provide the id of a virtual descendant of a view.
private static final int
VIRTUAL_DESCENDANT_ID_SHIFT
Bit shift of {@link #VIRTUAL_DESCENDANT_ID_MASK} to get to the id for a virtual descendant of a view. Such a descendant does not exist in the view hierarchy and is only reported via the accessibility APIs.
private static final int
MAX_POOL_SIZE
private static final android.util.Pools.SynchronizedPool
sPool
private boolean
mSealed
private int
mWindowId
private long
mSourceNodeId
private long
mParentNodeId
private long
mLabelForId
private long
mLabeledById
private long
mTraversalBefore
private long
mTraversalAfter
private int
mBooleanProperties
private final android.graphics.Rect
mBoundsInParent
private final android.graphics.Rect
mBoundsInScreen
private CharSequence
mPackageName
private CharSequence
mClassName
private CharSequence
mText
private CharSequence
mError
private CharSequence
mContentDescription
private String
mViewIdResourceName
private android.util.LongArray
mChildNodeIds
private ArrayList
mActions
private int
mMaxTextLength
private int
mMovementGranularities
private int
mTextSelectionStart
private int
mTextSelectionEnd
private int
mInputType
private int
mLiveRegion
private android.os.Bundle
mExtras
private int
mConnectionId
private RangeInfo
mRangeInfo
private CollectionInfo
mCollectionInfo
private CollectionItemInfo
mCollectionItemInfo
public static final Parcelable.Creator
CREATOR
Constructors Summary
private AccessibilityNodeInfo()
Hide constructor from clients.


             
      
        /* do nothing */
    
Methods Summary
public voidaddAction(android.view.accessibility.AccessibilityNodeInfo$AccessibilityAction action)
Adds an action that can be performed on the node.

To add a standard action use the static constants on {@link AccessibilityAction}. To add a custom action create a new {@link AccessibilityAction} by passing in a resource id from your application as the action id and an optional label that describes the action. To override one of the standard actions use as the action id of a standard action id such as {@link #ACTION_CLICK} and an optional label that describes the action.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
action The action.
throws
IllegalStateException If called from an AccessibilityService.

        enforceNotSealed();

        if (action == null) {
            return;
        }

        if (mActions == null) {
            mActions = new ArrayList<AccessibilityAction>();
        }

        mActions.remove(action);
        mActions.add(action);
    
public voidaddAction(int action)
Adds an action that can be performed on the node.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
action The action.
throws
IllegalStateException If called from an AccessibilityService.
throws
IllegalArgumentException If the argument is not one of the standard actions.
deprecated
This has been deprecated for {@link #addAction(AccessibilityAction)}

        enforceNotSealed();

        if ((action & ACTION_TYPE_MASK) != 0) {
            throw new IllegalArgumentException("Action is not a combination of the standard " +
                    "actions: " + action);
        }

        addLegacyStandardActions(action);
    
public voidaddChild(android.view.View child)
Adds a child.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
child The child.
throws
IllegalStateException If called from an AccessibilityService.

        addChildInternal(child, UNDEFINED_ITEM_ID, true);
    
public voidaddChild(android.view.View root, int virtualDescendantId)
Adds a virtual child which is a descendant of the given root. If virtualDescendantId is {@link View#NO_ID} the root is added as a child.

A virtual descendant is an imaginary View that is reported as a part of the view hierarchy for accessibility purposes. This enables custom views that draw complex content to report them selves as a tree of virtual views, thus conveying their logical structure.

param
root The root of the virtual subtree.
param
virtualDescendantId The id of the virtual child.

        addChildInternal(root, virtualDescendantId, true);
    
private voidaddChildInternal(android.view.View root, int virtualDescendantId, boolean checked)

        enforceNotSealed();
        if (mChildNodeIds == null) {
            mChildNodeIds = new LongArray();
        }
        final int rootAccessibilityViewId =
            (root != null) ? root.getAccessibilityViewId() : UNDEFINED_ITEM_ID;
        final long childNodeId = makeNodeId(rootAccessibilityViewId, virtualDescendantId);
        // If we're checking uniqueness and the ID already exists, abort.
        if (checked && mChildNodeIds.indexOf(childNodeId) >= 0) {
            return;
        }
        mChildNodeIds.add(childNodeId);
    
public voidaddChildUnchecked(android.view.View child)
Unchecked version of {@link #addChild(View)} that does not verify uniqueness. For framework use only.

hide

        addChildInternal(child, UNDEFINED_ITEM_ID, false);
    
private voidaddLegacyStandardActions(int actionMask)

        int remainingIds = actionMask;
        while (remainingIds > 0) {
            final int id = 1 << Integer.numberOfTrailingZeros(remainingIds);
            remainingIds &= ~id;
            AccessibilityAction action = getActionSingleton(id);
            addAction(action);
        }
    
public booleancanOpenPopup()
Gets if this node opens a popup or a dialog.

return
If the the node opens a popup.

        return getBooleanProperty(BOOLEAN_PROPERTY_OPENS_POPUP);
    
private booleancanPerformRequestOverConnection(long accessibilityNodeId)

        return (mWindowId != UNDEFINED_ITEM_ID
                && getAccessibilityViewId(accessibilityNodeId) != UNDEFINED_ITEM_ID
                && mConnectionId != UNDEFINED_CONNECTION_ID);
    
private voidclear()
Clears the state of this instance.

        mSealed = false;
        mSourceNodeId = ROOT_NODE_ID;
        mParentNodeId = ROOT_NODE_ID;
        mLabelForId = ROOT_NODE_ID;
        mLabeledById = ROOT_NODE_ID;
        mTraversalBefore = ROOT_NODE_ID;
        mTraversalAfter = ROOT_NODE_ID;
        mWindowId = UNDEFINED_ITEM_ID;
        mConnectionId = UNDEFINED_CONNECTION_ID;
        mMaxTextLength = -1;
        mMovementGranularities = 0;
        if (mChildNodeIds != null) {
            mChildNodeIds.clear();
        }
        mBoundsInParent.set(0, 0, 0, 0);
        mBoundsInScreen.set(0, 0, 0, 0);
        mBooleanProperties = 0;
        mPackageName = null;
        mClassName = null;
        mText = null;
        mError = null;
        mContentDescription = null;
        mViewIdResourceName = null;
        if (mActions != null) {
            mActions.clear();
        }
        mTextSelectionStart = UNDEFINED_SELECTION_INDEX;
        mTextSelectionEnd = UNDEFINED_SELECTION_INDEX;
        mInputType = InputType.TYPE_NULL;
        mLiveRegion = View.ACCESSIBILITY_LIVE_REGION_NONE;
        if (mExtras != null) {
            mExtras.clear();
        }
        if (mRangeInfo != null) {
            mRangeInfo.recycle();
            mRangeInfo = null;
        }
        if (mCollectionInfo != null) {
            mCollectionInfo.recycle();
            mCollectionInfo = null;
        }
        if (mCollectionItemInfo != null) {
            mCollectionItemInfo.recycle();
            mCollectionItemInfo = null;
        }
    
public intdescribeContents()
{@inheritDoc}

        return 0;
    
protected voidenforceNotSealed()
Enforces that this instance is not sealed.

throws
IllegalStateException If this instance is sealed.
hide

        if (isSealed()) {
            throw new IllegalStateException("Cannot perform this "
                    + "action on a sealed instance.");
        }
    
protected voidenforceSealed()
Enforces that this instance is sealed.

throws
IllegalStateException If this instance is not sealed.
hide

        if (!isSealed()) {
            throw new IllegalStateException("Cannot perform this "
                    + "action on a not sealed instance.");
        }
    
private voidenforceValidFocusDirection(int direction)

        switch (direction) {
            case View.FOCUS_DOWN:
            case View.FOCUS_UP:
            case View.FOCUS_LEFT:
            case View.FOCUS_RIGHT:
            case View.FOCUS_FORWARD:
            case View.FOCUS_BACKWARD:
                return;
            default:
                throw new IllegalArgumentException("Unknown direction: " + direction);
        }
    
private voidenforceValidFocusType(int focusType)

        switch (focusType) {
            case FOCUS_INPUT:
            case FOCUS_ACCESSIBILITY:
                return;
            default:
                throw new IllegalArgumentException("Unknown focus type: " + focusType);
        }
    
public booleanequals(java.lang.Object object)

        if (this == object) {
            return true;
        }
        if (object == null) {
            return false;
        }
        if (getClass() != object.getClass()) {
            return false;
        }
        AccessibilityNodeInfo other = (AccessibilityNodeInfo) object;
        if (mSourceNodeId != other.mSourceNodeId) {
            return false;
        }
        if (mWindowId != other.mWindowId) {
            return false;
        }
        return true;
    
public java.util.ListfindAccessibilityNodeInfosByText(java.lang.String text)
Finds {@link AccessibilityNodeInfo}s by text. The match is case insensitive containment. The search is relative to this info i.e. this info is the root of the traversed tree.

Note: It is a client responsibility to recycle the received info by calling {@link AccessibilityNodeInfo#recycle()} to avoid creating of multiple instances.

param
text The searched text.
return
A list of node info.

        enforceSealed();
        if (!canPerformRequestOverConnection(mSourceNodeId)) {
            return Collections.emptyList();
        }
        AccessibilityInteractionClient client = AccessibilityInteractionClient.getInstance();
        return client.findAccessibilityNodeInfosByText(mConnectionId, mWindowId, mSourceNodeId,
                text);
    
public java.util.ListfindAccessibilityNodeInfosByViewId(java.lang.String viewId)
Finds {@link AccessibilityNodeInfo}s by the fully qualified view id's resource name where a fully qualified id is of the from "package:id/id_resource_name". For example, if the target application's package is "foo.bar" and the id resource name is "baz", the fully qualified resource id is "foo.bar:id/baz".

Note: It is a client responsibility to recycle the received info by calling {@link AccessibilityNodeInfo#recycle()} to avoid creating of multiple instances.

Note: The primary usage of this API is for UI test automation and in order to report the fully qualified view id if an {@link AccessibilityNodeInfo} the client has to set the {@link AccessibilityServiceInfo#FLAG_REPORT_VIEW_IDS} flag when configuring his {@link android.accessibilityservice.AccessibilityService}.

param
viewId The fully qualified resource name of the view id to find.
return
A list of node info.

        enforceSealed();
        if (!canPerformRequestOverConnection(mSourceNodeId)) {
            return Collections.emptyList();
        }
        AccessibilityInteractionClient client = AccessibilityInteractionClient.getInstance();
        return client.findAccessibilityNodeInfosByViewId(mConnectionId, mWindowId, mSourceNodeId,
                viewId);
    
public android.view.accessibility.AccessibilityNodeInfofindFocus(int focus)
Find the view that has the specified focus type. The search starts from the view represented by this node info.

param
focus The focus to find. One of {@link #FOCUS_INPUT} or {@link #FOCUS_ACCESSIBILITY}.
return
The node info of the focused view or null.
see
#FOCUS_INPUT
see
#FOCUS_ACCESSIBILITY

        enforceSealed();
        enforceValidFocusType(focus);
        if (!canPerformRequestOverConnection(mSourceNodeId)) {
            return null;
        }
        return AccessibilityInteractionClient.getInstance().findFocus(mConnectionId, mWindowId,
                mSourceNodeId, focus);
    
public android.view.accessibility.AccessibilityNodeInfofocusSearch(int direction)
Searches for the nearest view in the specified direction that can take the input focus.

param
direction The direction. Can be one of: {@link View#FOCUS_DOWN}, {@link View#FOCUS_UP}, {@link View#FOCUS_LEFT}, {@link View#FOCUS_RIGHT}, {@link View#FOCUS_FORWARD}, {@link View#FOCUS_BACKWARD}.
return
The node info for the view that can take accessibility focus.

        enforceSealed();
        enforceValidFocusDirection(direction);
        if (!canPerformRequestOverConnection(mSourceNodeId)) {
            return null;
        }
        return AccessibilityInteractionClient.getInstance().focusSearch(mConnectionId, mWindowId,
                mSourceNodeId, direction);
    
public static intgetAccessibilityViewId(long accessibilityNodeId)
Gets the accessibility view id which identifies a View in the view three.

param
accessibilityNodeId The id of an {@link AccessibilityNodeInfo}.
return
The accessibility view id part of the node id.
hide


                                         
         
        return (int) accessibilityNodeId;
    
public java.util.ListgetActionList()
Gets the actions that can be performed on the node.

        if (mActions == null) {
            return Collections.emptyList();
        }

        return mActions;
    
private static android.view.accessibility.AccessibilityNodeInfo$AccessibilityActiongetActionSingleton(int actionId)

        final int actions = AccessibilityAction.sStandardActions.size();
        for (int i = 0; i < actions; i++) {
            AccessibilityAction currentAction = AccessibilityAction.sStandardActions.valueAt(i);
            if (actionId == currentAction.getId()) {
                return currentAction;
            }
        }

        return null;
    
private static java.lang.StringgetActionSymbolicName(int action)
Gets the human readable action symbolic name.

param
action The action.
return
The symbolic name.

        switch (action) {
            case ACTION_FOCUS:
                return "ACTION_FOCUS";
            case ACTION_CLEAR_FOCUS:
                return "ACTION_CLEAR_FOCUS";
            case ACTION_SELECT:
                return "ACTION_SELECT";
            case ACTION_CLEAR_SELECTION:
                return "ACTION_CLEAR_SELECTION";
            case ACTION_CLICK:
                return "ACTION_CLICK";
            case ACTION_LONG_CLICK:
                return "ACTION_LONG_CLICK";
            case ACTION_ACCESSIBILITY_FOCUS:
                return "ACTION_ACCESSIBILITY_FOCUS";
            case ACTION_CLEAR_ACCESSIBILITY_FOCUS:
                return "ACTION_CLEAR_ACCESSIBILITY_FOCUS";
            case ACTION_NEXT_AT_MOVEMENT_GRANULARITY:
                return "ACTION_NEXT_AT_MOVEMENT_GRANULARITY";
            case ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY:
                return "ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY";
            case ACTION_NEXT_HTML_ELEMENT:
                return "ACTION_NEXT_HTML_ELEMENT";
            case ACTION_PREVIOUS_HTML_ELEMENT:
                return "ACTION_PREVIOUS_HTML_ELEMENT";
            case ACTION_SCROLL_FORWARD:
                return "ACTION_SCROLL_FORWARD";
            case ACTION_SCROLL_BACKWARD:
                return "ACTION_SCROLL_BACKWARD";
            case ACTION_CUT:
                return "ACTION_CUT";
            case ACTION_COPY:
                return "ACTION_COPY";
            case ACTION_PASTE:
                return "ACTION_PASTE";
            case ACTION_SET_SELECTION:
                return "ACTION_SET_SELECTION";
            default:
                return"ACTION_UNKNOWN";
        }
    
public intgetActions()
Gets the actions that can be performed on the node.

return
The bit mask of with actions.
see
AccessibilityNodeInfo#ACTION_FOCUS
see
AccessibilityNodeInfo#ACTION_CLEAR_FOCUS
see
AccessibilityNodeInfo#ACTION_SELECT
see
AccessibilityNodeInfo#ACTION_CLEAR_SELECTION
see
AccessibilityNodeInfo#ACTION_ACCESSIBILITY_FOCUS
see
AccessibilityNodeInfo#ACTION_CLEAR_ACCESSIBILITY_FOCUS
see
AccessibilityNodeInfo#ACTION_CLICK
see
AccessibilityNodeInfo#ACTION_LONG_CLICK
see
AccessibilityNodeInfo#ACTION_NEXT_AT_MOVEMENT_GRANULARITY
see
AccessibilityNodeInfo#ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY
see
AccessibilityNodeInfo#ACTION_NEXT_HTML_ELEMENT
see
AccessibilityNodeInfo#ACTION_PREVIOUS_HTML_ELEMENT
see
AccessibilityNodeInfo#ACTION_SCROLL_FORWARD
see
AccessibilityNodeInfo#ACTION_SCROLL_BACKWARD
deprecated
Use {@link #getActionList()}.

        int returnValue = 0;

        if (mActions == null) {
            return returnValue;
        }

        final int actionSize = mActions.size();
        for (int i = 0; i < actionSize; i++) {
            int actionId = mActions.get(i).getId();
            if (actionId <= LAST_LEGACY_STANDARD_ACTION) {
                returnValue |= actionId;
            }
        }

        return returnValue;
    
private booleangetBooleanProperty(int property)
Gets the value of a boolean property.

param
property The property.
return
The value.

        return (mBooleanProperties & property) != 0;
    
public voidgetBoundsInParent(android.graphics.Rect outBounds)
Gets the node bounds in parent coordinates.

param
outBounds The output node bounds.

        outBounds.set(mBoundsInParent.left, mBoundsInParent.top,
                mBoundsInParent.right, mBoundsInParent.bottom);
    
public voidgetBoundsInScreen(android.graphics.Rect outBounds)
Gets the node bounds in screen coordinates.

param
outBounds The output node bounds.

        outBounds.set(mBoundsInScreen.left, mBoundsInScreen.top,
                mBoundsInScreen.right, mBoundsInScreen.bottom);
    
public android.view.accessibility.AccessibilityNodeInfogetChild(int index)
Get the child at given index.

Note: It is a client responsibility to recycle the received info by calling {@link AccessibilityNodeInfo#recycle()} to avoid creating of multiple instances.

param
index The child index.
return
The child node.
throws
IllegalStateException If called outside of an AccessibilityService.

        enforceSealed();
        if (mChildNodeIds == null) {
            return null;
        }
        if (!canPerformRequestOverConnection(mSourceNodeId)) {
            return null;
        }
        final long childId = mChildNodeIds.get(index);
        AccessibilityInteractionClient client = AccessibilityInteractionClient.getInstance();
        return client.findAccessibilityNodeInfoByAccessibilityId(mConnectionId, mWindowId,
                childId, false, FLAG_PREFETCH_DESCENDANTS);
    
public intgetChildCount()
Gets the number of children.

return
The child count.

        return mChildNodeIds == null ? 0 : mChildNodeIds.size();
    
public longgetChildId(int index)
Returns the id of the child at the specified index.

throws
IndexOutOfBoundsException when index < 0 || index >= getChildCount()
hide

        if (mChildNodeIds == null) {
            throw new IndexOutOfBoundsException();
        }
        return mChildNodeIds.get(index);
    
public android.util.LongArraygetChildNodeIds()
Returns the array containing the IDs of this node's children.

hide

        return mChildNodeIds;
    
public java.lang.CharSequencegetClassName()
Gets the class this node comes from.

return
The class name.

        return mClassName;
    
public android.view.accessibility.AccessibilityNodeInfo$CollectionInfogetCollectionInfo()
Gets the collection info if the node is a collection. A collection child is always a collection item.

return
The collection info.

        return mCollectionInfo;
    
public android.view.accessibility.AccessibilityNodeInfo$CollectionItemInfogetCollectionItemInfo()
Gets the collection item info if the node is a collection item. A collection item is always a child of a collection.

return
The collection item info.

        return mCollectionItemInfo;
    
public java.lang.CharSequencegetContentDescription()
Gets the content description of this node.

return
The content description.

        return mContentDescription;
    
public java.lang.CharSequencegetError()
Gets the error text of this node.

return
The error text.

        return mError;
    
public android.os.BundlegetExtras()
Gets an optional bundle with extra data. The bundle is lazily created and never null.

Note: It is recommended to use the package name of your application as a prefix for the keys to avoid collisions which may confuse an accessibility service if the same key has different meaning when emitted from different applications.

return
The bundle.

        if (mExtras == null) {
            mExtras = new Bundle();
        }
        return mExtras;
    
public intgetInputType()
Gets the input type of the source as defined by {@link InputType}.

return
The input type.

        return mInputType;
    
public android.view.accessibility.AccessibilityNodeInfogetLabelFor()
Gets the node info for which the view represented by this info serves as a label for accessibility purposes.

Note: It is a client responsibility to recycle the received info by calling {@link AccessibilityNodeInfo#recycle()} to avoid creating of multiple instances.

return
The labeled info.

        enforceSealed();
        return getNodeForAccessibilityId(mLabelForId);
    
public android.view.accessibility.AccessibilityNodeInfogetLabeledBy()
Gets the node info which serves as the label of the view represented by this info for accessibility purposes.

Note: It is a client responsibility to recycle the received info by calling {@link AccessibilityNodeInfo#recycle()} to avoid creating of multiple instances.

return
The label.

        enforceSealed();
        return getNodeForAccessibilityId(mLabeledById);
    
public intgetLiveRegion()
Gets the node's live region mode.

A live region is a node that contains information that is important for the user and when it changes the user should be notified. For example, in a login screen with a TextView that displays an "incorrect password" notification, that view should be marked as a live region with mode {@link View#ACCESSIBILITY_LIVE_REGION_POLITE}.

It is the responsibility of the accessibility service to monitor {@link AccessibilityEvent#TYPE_WINDOW_CONTENT_CHANGED} events indicating changes to live region nodes and their children.

return
The live region mode, or {@link View#ACCESSIBILITY_LIVE_REGION_NONE} if the view is not a live region.
see
android.view.View#getAccessibilityLiveRegion()

        return mLiveRegion;
    
public intgetMaxTextLength()
Returns the maximum text length for this node.

return
The maximum text length, or -1 for no limit.
see
#setMaxTextLength(int)

        return mMaxTextLength;
    
public intgetMovementGranularities()
Gets the movement granularities for traversing the text of this node.

return
The bit mask with granularities.

        return mMovementGranularities;
    
private static java.lang.StringgetMovementGranularitySymbolicName(int granularity)
Gets the human readable movement granularity symbolic name.

param
granularity The granularity.
return
The symbolic name.

        switch (granularity) {
            case MOVEMENT_GRANULARITY_CHARACTER:
                return "MOVEMENT_GRANULARITY_CHARACTER";
            case MOVEMENT_GRANULARITY_WORD:
                return "MOVEMENT_GRANULARITY_WORD";
            case MOVEMENT_GRANULARITY_LINE:
                return "MOVEMENT_GRANULARITY_LINE";
            case MOVEMENT_GRANULARITY_PARAGRAPH:
                return "MOVEMENT_GRANULARITY_PARAGRAPH";
            case MOVEMENT_GRANULARITY_PAGE:
                return "MOVEMENT_GRANULARITY_PAGE";
            default:
                throw new IllegalArgumentException("Unknown movement granularity: " + granularity);
        }
    
private android.view.accessibility.AccessibilityNodeInfogetNodeForAccessibilityId(long accessibilityId)

        if (!canPerformRequestOverConnection(accessibilityId)) {
            return null;
        }
        AccessibilityInteractionClient client = AccessibilityInteractionClient.getInstance();
        return client.findAccessibilityNodeInfoByAccessibilityId(mConnectionId,
                mWindowId, accessibilityId, false, FLAG_PREFETCH_PREDECESSORS
                        | FLAG_PREFETCH_DESCENDANTS | FLAG_PREFETCH_SIBLINGS);
    
public java.lang.CharSequencegetPackageName()
Gets the package this node comes from.

return
The package name.

        return mPackageName;
    
public android.view.accessibility.AccessibilityNodeInfogetParent()
Gets the parent.

Note: It is a client responsibility to recycle the received info by calling {@link AccessibilityNodeInfo#recycle()} to avoid creating of multiple instances.

return
The parent.

        enforceSealed();
        return getNodeForAccessibilityId(mParentNodeId);
    
public longgetParentNodeId()

return
The parent node id.
hide

        return mParentNodeId;
    
public android.view.accessibility.AccessibilityNodeInfo$RangeInfogetRangeInfo()
Gets the range info if this node is a range.

return
The range.

        return mRangeInfo;
    
public longgetSourceNodeId()
Gets the id of the source node.

return
The id.
hide

        return mSourceNodeId;
    
public java.lang.CharSequencegetText()
Gets the text of this node.

return
The text.

        return mText;
    
public intgetTextSelectionEnd()
Gets the text selection end.

return
The text selection end if there is selection or -1.

        return mTextSelectionEnd;
    
public intgetTextSelectionStart()
Gets the text selection start.

return
The text selection start if there is selection or -1.

        return mTextSelectionStart;
    
public android.view.accessibility.AccessibilityNodeInfogetTraversalAfter()
Gets the node after which this one is visited in accessibility traversal. A screen-reader must visit the content of the other node before the content of this one.

return
The succeeding node if such or null.
see
#setTraversalAfter(android.view.View)
see
#setTraversalAfter(android.view.View, int)

        enforceSealed();
        return getNodeForAccessibilityId(mTraversalAfter);
    
public android.view.accessibility.AccessibilityNodeInfogetTraversalBefore()
Gets the node before which this one is visited during traversal. A screen-reader must visit the content of this node before the content of the one it precedes.

return
The succeeding node if such or null.
see
#setTraversalBefore(android.view.View)
see
#setTraversalBefore(android.view.View, int)

        enforceSealed();
        return getNodeForAccessibilityId(mTraversalBefore);
    
public java.lang.StringgetViewIdResourceName()
Gets the fully qualified resource name of the source view's id.

Note: The primary usage of this API is for UI test automation and in order to report the source view id of an {@link AccessibilityNodeInfo} the client has to set the {@link AccessibilityServiceInfo#FLAG_REPORT_VIEW_IDS} flag when configuring his {@link android.accessibilityservice.AccessibilityService}.

return
The id resource name.

        return mViewIdResourceName;
    
public static intgetVirtualDescendantId(long accessibilityNodeId)
Gets the virtual descendant id which identifies an imaginary view in a containing View.

param
accessibilityNodeId The id of an {@link AccessibilityNodeInfo}.
return
The virtual view id part of the node id.
hide

        return (int) ((accessibilityNodeId & VIRTUAL_DESCENDANT_ID_MASK)
                >> VIRTUAL_DESCENDANT_ID_SHIFT);
    
public AccessibilityWindowInfogetWindow()
Gets the window to which this node belongs.

return
The window.
see
android.accessibilityservice.AccessibilityService#getWindows()

        enforceSealed();
        if (!canPerformRequestOverConnection(mSourceNodeId)) {
            return null;
        }
        AccessibilityInteractionClient client = AccessibilityInteractionClient.getInstance();
        return client.getWindow(mConnectionId, mWindowId);
    
public intgetWindowId()
Gets the id of the window from which the info comes from.

return
The window id.

        return mWindowId;
    
public inthashCode()

        final int prime = 31;
        int result = 1;
        result = prime * result + getAccessibilityViewId(mSourceNodeId);
        result = prime * result + getVirtualDescendantId(mSourceNodeId);
        result = prime * result + mWindowId;
        return result;
    
private voidinit(android.view.accessibility.AccessibilityNodeInfo other)
Initializes this instance from another one.

param
other The other instance.

        mSealed = other.mSealed;
        mSourceNodeId = other.mSourceNodeId;
        mParentNodeId = other.mParentNodeId;
        mLabelForId = other.mLabelForId;
        mLabeledById = other.mLabeledById;
        mTraversalBefore = other.mTraversalBefore;
        mTraversalAfter = other.mTraversalAfter;
        mWindowId = other.mWindowId;
        mConnectionId = other.mConnectionId;
        mBoundsInParent.set(other.mBoundsInParent);
        mBoundsInScreen.set(other.mBoundsInScreen);
        mPackageName = other.mPackageName;
        mClassName = other.mClassName;
        mText = other.mText;
        mError = other.mError;
        mContentDescription = other.mContentDescription;
        mViewIdResourceName = other.mViewIdResourceName;

        final ArrayList<AccessibilityAction> otherActions = other.mActions;
        if (otherActions != null && otherActions.size() > 0) {
            if (mActions == null) {
                mActions = new ArrayList(otherActions);
            } else {
                mActions.clear();
                mActions.addAll(other.mActions);
            }
        }

        mBooleanProperties = other.mBooleanProperties;
        mMaxTextLength = other.mMaxTextLength;
        mMovementGranularities = other.mMovementGranularities;

        final LongArray otherChildNodeIds = other.mChildNodeIds;
        if (otherChildNodeIds != null && otherChildNodeIds.size() > 0) {
            if (mChildNodeIds == null) {
                mChildNodeIds = otherChildNodeIds.clone();
            } else {
                mChildNodeIds.clear();
                mChildNodeIds.addAll(otherChildNodeIds);
            }
        }

        mTextSelectionStart = other.mTextSelectionStart;
        mTextSelectionEnd = other.mTextSelectionEnd;
        mInputType = other.mInputType;
        mLiveRegion = other.mLiveRegion;
        if (other.mExtras != null && !other.mExtras.isEmpty()) {
            getExtras().putAll(other.mExtras);
        }
        mRangeInfo = (other.mRangeInfo != null)
                ? RangeInfo.obtain(other.mRangeInfo) : null;
        mCollectionInfo = (other.mCollectionInfo != null)
                ? CollectionInfo.obtain(other.mCollectionInfo) : null;
        mCollectionItemInfo =  (other.mCollectionItemInfo != null)
                ? CollectionItemInfo.obtain(other.mCollectionItemInfo) : null;
    
private voidinitFromParcel(android.os.Parcel parcel)
Creates a new instance from a {@link Parcel}.

param
parcel A parcel containing the state of a {@link AccessibilityNodeInfo}.

        mSealed = (parcel.readInt()  == 1);
        mSourceNodeId = parcel.readLong();
        mWindowId = parcel.readInt();
        mParentNodeId = parcel.readLong();
        mLabelForId = parcel.readLong();
        mLabeledById = parcel.readLong();
        mTraversalBefore = parcel.readLong();
        mTraversalAfter = parcel.readLong();

        mConnectionId = parcel.readInt();

        final int childrenSize = parcel.readInt();
        if (childrenSize <= 0) {
            mChildNodeIds = null;
        } else {
            mChildNodeIds = new LongArray(childrenSize);
            for (int i = 0; i < childrenSize; i++) {
                final long childId = parcel.readLong();
                mChildNodeIds.add(childId);
            }
        }

        mBoundsInParent.top = parcel.readInt();
        mBoundsInParent.bottom = parcel.readInt();
        mBoundsInParent.left = parcel.readInt();
        mBoundsInParent.right = parcel.readInt();

        mBoundsInScreen.top = parcel.readInt();
        mBoundsInScreen.bottom = parcel.readInt();
        mBoundsInScreen.left = parcel.readInt();
        mBoundsInScreen.right = parcel.readInt();

        final int actionCount = parcel.readInt();
        if (actionCount > 0) {
            final int legacyStandardActions = parcel.readInt();
            addLegacyStandardActions(legacyStandardActions);
            final int nonLegacyActionCount = actionCount - Integer.bitCount(legacyStandardActions);
            for (int i = 0; i < nonLegacyActionCount; i++) {
                AccessibilityAction action = new AccessibilityAction(
                        parcel.readInt(), parcel.readCharSequence());
                addAction(action);
            }
        }

        mMaxTextLength = parcel.readInt();
        mMovementGranularities = parcel.readInt();
        mBooleanProperties = parcel.readInt();

        mPackageName = parcel.readCharSequence();
        mClassName = parcel.readCharSequence();
        mText = parcel.readCharSequence();
        mError = parcel.readCharSequence();
        mContentDescription = parcel.readCharSequence();
        mViewIdResourceName = parcel.readString();

        mTextSelectionStart = parcel.readInt();
        mTextSelectionEnd = parcel.readInt();

        mInputType = parcel.readInt();
        mLiveRegion = parcel.readInt();

        if (parcel.readInt() == 1) {
            getExtras().putAll(parcel.readBundle());
        }

        if (parcel.readInt() == 1) {
            mRangeInfo = RangeInfo.obtain(
                    parcel.readInt(),
                    parcel.readFloat(),
                    parcel.readFloat(),
                    parcel.readFloat());
        }

        if (parcel.readInt() == 1) {
            mCollectionInfo = CollectionInfo.obtain(
                    parcel.readInt(),
                    parcel.readInt(),
                    parcel.readInt() == 1,
                    parcel.readInt());
        }

        if (parcel.readInt() == 1) {
            mCollectionItemInfo = CollectionItemInfo.obtain(
                    parcel.readInt(),
                    parcel.readInt(),
                    parcel.readInt(),
                    parcel.readInt(),
                    parcel.readInt() == 1,
                    parcel.readInt() == 1);
        }
    
public booleanisAccessibilityFocused()
Gets whether this node is accessibility focused.

return
True if the node is accessibility focused.

        return getBooleanProperty(BOOLEAN_PROPERTY_ACCESSIBILITY_FOCUSED);
    
public booleanisCheckable()
Gets whether this node is checkable.

return
True if the node is checkable.

        return getBooleanProperty(BOOLEAN_PROPERTY_CHECKABLE);
    
public booleanisChecked()
Gets whether this node is checked.

return
True if the node is checked.

        return getBooleanProperty(BOOLEAN_PROPERTY_CHECKED);
    
public booleanisClickable()
Gets whether this node is clickable.

return
True if the node is clickable.

        return getBooleanProperty(BOOLEAN_PROPERTY_CLICKABLE);
    
public booleanisContentInvalid()
Gets if the content of this node is invalid. For example, a date is not well-formed.

return
If the node content is invalid.

        return getBooleanProperty(BOOLEAN_PROPERTY_CONTENT_INVALID);
    
private static booleanisDefaultLegacyStandardAction(android.view.accessibility.AccessibilityNodeInfo$AccessibilityAction action)

        return (action.getId() <= LAST_LEGACY_STANDARD_ACTION
                && TextUtils.isEmpty(action.getLabel()));
    
public booleanisDismissable()
Gets if the node can be dismissed.

return
If the node can be dismissed.

        return getBooleanProperty(BOOLEAN_PROPERTY_DISMISSABLE);
    
public booleanisEditable()
Gets if the node is editable.

return
True if the node is editable, false otherwise.

        return getBooleanProperty(BOOLEAN_PROPERTY_EDITABLE);
    
public booleanisEnabled()
Gets whether this node is enabled.

return
True if the node is enabled.

        return getBooleanProperty(BOOLEAN_PROPERTY_ENABLED);
    
public booleanisFocusable()
Gets whether this node is focusable.

return
True if the node is focusable.

        return getBooleanProperty(BOOLEAN_PROPERTY_FOCUSABLE);
    
public booleanisFocused()
Gets whether this node is focused.

return
True if the node is focused.

        return getBooleanProperty(BOOLEAN_PROPERTY_FOCUSED);
    
public booleanisLongClickable()
Gets whether this node is long clickable.

return
True if the node is long clickable.

        return getBooleanProperty(BOOLEAN_PROPERTY_LONG_CLICKABLE);
    
public booleanisMultiLine()
Gets if the node is a multi line editable text.

return
True if the node is multi line.

        return getBooleanProperty(BOOLEAN_PROPERTY_MULTI_LINE);
    
public booleanisPassword()
Gets whether this node is a password.

return
True if the node is a password.

        return getBooleanProperty(BOOLEAN_PROPERTY_PASSWORD);
    
public booleanisScrollable()
Gets if the node is scrollable.

return
True if the node is scrollable, false otherwise.

        return getBooleanProperty(BOOLEAN_PROPERTY_SCROLLABLE);
    
public booleanisSealed()
Gets if this instance is sealed.

return
Whether is sealed.
hide

        return mSealed;
    
public booleanisSelected()
Gets whether this node is selected.

return
True if the node is selected.

        return getBooleanProperty(BOOLEAN_PROPERTY_SELECTED);
    
public booleanisVisibleToUser()
Sets whether this node is visible to the user.

return
Whether the node is visible to the user.

        return getBooleanProperty(BOOLEAN_PROPERTY_VISIBLE_TO_USER);
    
public static longmakeNodeId(int accessibilityViewId, int virtualDescendantId)
Makes a node id by shifting the virtualDescendantId by {@link #VIRTUAL_DESCENDANT_ID_SHIFT} and taking the bitwise or with the accessibilityViewId.

param
accessibilityViewId A View accessibility id.
param
virtualDescendantId A virtual descendant id.
return
The node id.
hide

        // We changed the value for undefined node to positive due to wrong
        // global id composition (two 32-bin ints into one 64-bit long) but
        // the value used for the host node provider view has id -1 so we
        // remap it here.
        if (virtualDescendantId == AccessibilityNodeProvider.HOST_VIEW_ID) {
            virtualDescendantId = UNDEFINED_ITEM_ID;
        }
        return (((long) virtualDescendantId) << VIRTUAL_DESCENDANT_ID_SHIFT) | accessibilityViewId;
    
public static android.view.accessibility.AccessibilityNodeInfoobtain(android.view.View source)
Returns a cached instance if such is available otherwise a new one and sets the source.

param
source The source view.
return
An instance.
see
#setSource(View)

        AccessibilityNodeInfo info = AccessibilityNodeInfo.obtain();
        info.setSource(source);
        return info;
    
public static android.view.accessibility.AccessibilityNodeInfoobtain(android.view.View root, int virtualDescendantId)
Returns a cached instance if such is available otherwise a new one and sets the source.

param
root The root of the virtual subtree.
param
virtualDescendantId The id of the virtual descendant.
return
An instance.
see
#setSource(View, int)

        AccessibilityNodeInfo info = AccessibilityNodeInfo.obtain();
        info.setSource(root, virtualDescendantId);
        return info;
    
public static android.view.accessibility.AccessibilityNodeInfoobtain()
Returns a cached instance if such is available otherwise a new one.

return
An instance.

        AccessibilityNodeInfo info = sPool.acquire();
        return (info != null) ? info : new AccessibilityNodeInfo();
    
public static android.view.accessibility.AccessibilityNodeInfoobtain(android.view.accessibility.AccessibilityNodeInfo info)
Returns a cached instance if such is available or a new one is create. The returned instance is initialized from the given info.

param
info The other info.
return
An instance.

        AccessibilityNodeInfo infoClone = AccessibilityNodeInfo.obtain();
        infoClone.init(info);
        return infoClone;
    
public booleanperformAction(int action)
Performs an action on the node.

Note: An action can be performed only if the request is made from an {@link android.accessibilityservice.AccessibilityService}.

param
action The action to perform.
return
True if the action was performed.
throws
IllegalStateException If called outside of an AccessibilityService.

        enforceSealed();
        if (!canPerformRequestOverConnection(mSourceNodeId)) {
            return false;
        }
        AccessibilityInteractionClient client = AccessibilityInteractionClient.getInstance();
        return client.performAccessibilityAction(mConnectionId, mWindowId, mSourceNodeId,
                action, null);
    
public booleanperformAction(int action, android.os.Bundle arguments)
Performs an action on the node.

Note: An action can be performed only if the request is made from an {@link android.accessibilityservice.AccessibilityService}.

param
action The action to perform.
param
arguments A bundle with additional arguments.
return
True if the action was performed.
throws
IllegalStateException If called outside of an AccessibilityService.

        enforceSealed();
        if (!canPerformRequestOverConnection(mSourceNodeId)) {
            return false;
        }
        AccessibilityInteractionClient client = AccessibilityInteractionClient.getInstance();
        return client.performAccessibilityAction(mConnectionId, mWindowId, mSourceNodeId,
                action, arguments);
    
public voidrecycle()
Return an instance back to be reused.

Note: You must not touch the object after calling this function.

throws
IllegalStateException If the info is already recycled.

        clear();
        sPool.release(this);
    
public booleanrefresh(boolean bypassCache)
Refreshes this info with the latest state of the view it represents.

Note: If this method returns false this info is obsolete since it represents a view that is no longer in the view tree and should be recycled.

param
bypassCache Whether to bypass the cache.
return
Whether the refresh succeeded.
hide

        enforceSealed();
        if (!canPerformRequestOverConnection(mSourceNodeId)) {
            return false;
        }
        AccessibilityInteractionClient client = AccessibilityInteractionClient.getInstance();
        AccessibilityNodeInfo refreshedInfo = client.findAccessibilityNodeInfoByAccessibilityId(
                mConnectionId, mWindowId, mSourceNodeId, bypassCache, 0);
        if (refreshedInfo == null) {
            return false;
        }
        init(refreshedInfo);
        refreshedInfo.recycle();
        return true;
    
public booleanrefresh()
Refreshes this info with the latest state of the view it represents.

Note: If this method returns false this info is obsolete since it represents a view that is no longer in the view tree and should be recycled.

return
Whether the refresh succeeded.

        return refresh(false);
    
public voidremoveAction(int action)
Removes an action that can be performed on the node. If the action was not already added to the node, calling this method has no effect.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
action The action to be removed.
throws
IllegalStateException If called from an AccessibilityService.
deprecated
Use {@link #removeAction(AccessibilityAction)}

        enforceNotSealed();

        removeAction(getActionSingleton(action));
    
public booleanremoveAction(android.view.accessibility.AccessibilityNodeInfo$AccessibilityAction action)
Removes an action that can be performed on the node. If the action was not already added to the node, calling this method has no effect.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
action The action to be removed.
return
The action removed from the list of actions.
throws
IllegalStateException If called from an AccessibilityService.

        enforceNotSealed();

        if (mActions == null || action == null) {
            return false;
        }

        return mActions.remove(action);
    
public booleanremoveChild(android.view.View child)
Removes a child. If the child was not previously added to the node, calling this method has no effect.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
child The child.
return
true if the child was present
throws
IllegalStateException If called from an AccessibilityService.

        return removeChild(child, UNDEFINED_ITEM_ID);
    
public booleanremoveChild(android.view.View root, int virtualDescendantId)
Removes a virtual child which is a descendant of the given root. If the child was not previously added to the node, calling this method has no effect.

param
root The root of the virtual subtree.
param
virtualDescendantId The id of the virtual child.
return
true if the child was present
see
#addChild(View, int)

        enforceNotSealed();
        final LongArray childIds = mChildNodeIds;
        if (childIds == null) {
            return false;
        }
        final int rootAccessibilityViewId =
                (root != null) ? root.getAccessibilityViewId() : UNDEFINED_ITEM_ID;
        final long childNodeId = makeNodeId(rootAccessibilityViewId, virtualDescendantId);
        final int index = childIds.indexOf(childNodeId);
        if (index < 0) {
            return false;
        }
        childIds.remove(index);
        return true;
    
public voidsetAccessibilityFocused(boolean focused)
Sets whether this node is accessibility focused.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
focused True if the node is accessibility focused.
throws
IllegalStateException If called from an AccessibilityService.

        setBooleanProperty(BOOLEAN_PROPERTY_ACCESSIBILITY_FOCUSED, focused);
    
private voidsetBooleanProperty(int property, boolean value)
Sets a boolean property.

param
property The property.
param
value The value.
throws
IllegalStateException If called from an AccessibilityService.

        enforceNotSealed();
        if (value) {
            mBooleanProperties |= property;
        } else {
            mBooleanProperties &= ~property;
        }
    
public voidsetBoundsInParent(android.graphics.Rect bounds)
Sets the node bounds in parent coordinates.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
bounds The node bounds.
throws
IllegalStateException If called from an AccessibilityService.

        enforceNotSealed();
        mBoundsInParent.set(bounds.left, bounds.top, bounds.right, bounds.bottom);
    
public voidsetBoundsInScreen(android.graphics.Rect bounds)
Sets the node bounds in screen coordinates.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
bounds The node bounds.
throws
IllegalStateException If called from an AccessibilityService.

        enforceNotSealed();
        mBoundsInScreen.set(bounds.left, bounds.top, bounds.right, bounds.bottom);
    
public voidsetCanOpenPopup(boolean opensPopup)
Sets if this node opens a popup or a dialog.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
opensPopup If the the node opens a popup.

        enforceNotSealed();
        setBooleanProperty(BOOLEAN_PROPERTY_OPENS_POPUP, opensPopup);
    
public voidsetCheckable(boolean checkable)
Sets whether this node is checkable.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
checkable True if the node is checkable.
throws
IllegalStateException If called from an AccessibilityService.

        setBooleanProperty(BOOLEAN_PROPERTY_CHECKABLE, checkable);
    
public voidsetChecked(boolean checked)
Sets whether this node is checked.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
checked True if the node is checked.
throws
IllegalStateException If called from an AccessibilityService.

        setBooleanProperty(BOOLEAN_PROPERTY_CHECKED, checked);
    
public voidsetClassName(java.lang.CharSequence className)
Sets the class this node comes from.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
className The class name.
throws
IllegalStateException If called from an AccessibilityService.

        enforceNotSealed();
        mClassName = className;
    
public voidsetClickable(boolean clickable)
Sets whether this node is clickable.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
clickable True if the node is clickable.
throws
IllegalStateException If called from an AccessibilityService.

        setBooleanProperty(BOOLEAN_PROPERTY_CLICKABLE, clickable);
    
public voidsetCollectionInfo(android.view.accessibility.AccessibilityNodeInfo$CollectionInfo collectionInfo)
Sets the collection info if the node is a collection. A collection child is always a collection item.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
collectionInfo The collection info.

        enforceNotSealed();
        mCollectionInfo = collectionInfo;
    
public voidsetCollectionItemInfo(android.view.accessibility.AccessibilityNodeInfo$CollectionItemInfo collectionItemInfo)
Sets the collection item info if the node is a collection item. A collection item is always a child of a collection.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

        enforceNotSealed();
        mCollectionItemInfo = collectionItemInfo;
    
public voidsetConnectionId(int connectionId)
Sets the unique id of the IAccessibilityServiceConnection over which this instance can send requests to the system.

param
connectionId The connection id.
hide

        enforceNotSealed();
        mConnectionId = connectionId;
    
public voidsetContentDescription(java.lang.CharSequence contentDescription)
Sets the content description of this node.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
contentDescription The content description.
throws
IllegalStateException If called from an AccessibilityService.

        enforceNotSealed();
        mContentDescription = contentDescription;
    
public voidsetContentInvalid(boolean contentInvalid)
Sets if the content of this node is invalid. For example, a date is not well-formed.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
contentInvalid If the node content is invalid.

        setBooleanProperty(BOOLEAN_PROPERTY_CONTENT_INVALID, contentInvalid);
    
public voidsetDismissable(boolean dismissable)
Sets if the node can be dismissed.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
dismissable If the node can be dismissed.

        setBooleanProperty(BOOLEAN_PROPERTY_DISMISSABLE, dismissable);
    
public voidsetEditable(boolean editable)
Sets whether this node is editable.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
editable True if the node is editable.
throws
IllegalStateException If called from an AccessibilityService.

        setBooleanProperty(BOOLEAN_PROPERTY_EDITABLE, editable);
    
public voidsetEnabled(boolean enabled)
Sets whether this node is enabled.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
enabled True if the node is enabled.
throws
IllegalStateException If called from an AccessibilityService.

        setBooleanProperty(BOOLEAN_PROPERTY_ENABLED, enabled);
    
public voidsetError(java.lang.CharSequence error)
Sets the error text of this node.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
error The error text.
throws
IllegalStateException If called from an AccessibilityService.

        enforceNotSealed();
        mError = error;
    
public voidsetFocusable(boolean focusable)
Sets whether this node is focusable.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
focusable True if the node is focusable.
throws
IllegalStateException If called from an AccessibilityService.

        setBooleanProperty(BOOLEAN_PROPERTY_FOCUSABLE, focusable);
    
public voidsetFocused(boolean focused)
Sets whether this node is focused.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
focused True if the node is focused.
throws
IllegalStateException If called from an AccessibilityService.

        setBooleanProperty(BOOLEAN_PROPERTY_FOCUSED, focused);
    
public voidsetInputType(int inputType)
Sets the input type of the source as defined by {@link InputType}.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
inputType The input type.
throws
IllegalStateException If called from an AccessibilityService.

        enforceNotSealed();
        mInputType = inputType;
    
public voidsetLabelFor(android.view.View labeled)
Sets the view for which the view represented by this info serves as a label for accessibility purposes.

param
labeled The view for which this info serves as a label.

        setLabelFor(labeled, UNDEFINED_ITEM_ID);
    
public voidsetLabelFor(android.view.View root, int virtualDescendantId)
Sets the view for which the view represented by this info serves as a label for accessibility purposes. If virtualDescendantId is {@link View#NO_ID} the root is set as the labeled.

A virtual descendant is an imaginary View that is reported as a part of the view hierarchy for accessibility purposes. This enables custom views that draw complex content to report themselves as a tree of virtual views, thus conveying their logical structure.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
root The root whose virtual descendant serves as a label.
param
virtualDescendantId The id of the virtual descendant.

        enforceNotSealed();
        final int rootAccessibilityViewId = (root != null)
                ? root.getAccessibilityViewId() : UNDEFINED_ITEM_ID;
        mLabelForId = makeNodeId(rootAccessibilityViewId, virtualDescendantId);
    
public voidsetLabeledBy(android.view.View label)
Sets the view which serves as the label of the view represented by this info for accessibility purposes.

param
label The view that labels this node's source.

        setLabeledBy(label, UNDEFINED_ITEM_ID);
    
public voidsetLabeledBy(android.view.View root, int virtualDescendantId)
Sets the view which serves as the label of the view represented by this info for accessibility purposes. If virtualDescendantId is {@link View#NO_ID} the root is set as the label.

A virtual descendant is an imaginary View that is reported as a part of the view hierarchy for accessibility purposes. This enables custom views that draw complex content to report themselves as a tree of virtual views, thus conveying their logical structure.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
root The root whose virtual descendant labels this node's source.
param
virtualDescendantId The id of the virtual descendant.

        enforceNotSealed();
        final int rootAccessibilityViewId = (root != null)
                ? root.getAccessibilityViewId() : UNDEFINED_ITEM_ID;
        mLabeledById = makeNodeId(rootAccessibilityViewId, virtualDescendantId);
    
public voidsetLiveRegion(int mode)
Sets the node's live region mode.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
mode The live region mode, or {@link View#ACCESSIBILITY_LIVE_REGION_NONE} if the view is not a live region.
see
android.view.View#setAccessibilityLiveRegion(int)

        enforceNotSealed();
        mLiveRegion = mode;
    
public voidsetLongClickable(boolean longClickable)
Sets whether this node is long clickable.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
longClickable True if the node is long clickable.
throws
IllegalStateException If called from an AccessibilityService.

        setBooleanProperty(BOOLEAN_PROPERTY_LONG_CLICKABLE, longClickable);
    
public voidsetMaxTextLength(int max)
Sets the maximum text length, or -1 for no limit.

Typically used to indicate that an editable text field has a limit on the number of characters entered.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
max The maximum text length.
see
#getMaxTextLength()
throws
IllegalStateException If called from an AccessibilityService.

        enforceNotSealed();
        mMaxTextLength = max;
    
public voidsetMovementGranularities(int granularities)
Sets the movement granularities for traversing the text of this node.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
granularities The bit mask with granularities.
throws
IllegalStateException If called from an AccessibilityService.

        enforceNotSealed();
        mMovementGranularities = granularities;
    
public voidsetMultiLine(boolean multiLine)
Sets if the node is a multi line editable text.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
multiLine True if the node is multi line.

        setBooleanProperty(BOOLEAN_PROPERTY_MULTI_LINE, multiLine);
    
public voidsetPackageName(java.lang.CharSequence packageName)
Sets the package this node comes from.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
packageName The package name.
throws
IllegalStateException If called from an AccessibilityService.

        enforceNotSealed();
        mPackageName = packageName;
    
public voidsetParent(android.view.View parent)
Sets the parent.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
parent The parent.
throws
IllegalStateException If called from an AccessibilityService.

        setParent(parent, UNDEFINED_ITEM_ID);
    
public voidsetParent(android.view.View root, int virtualDescendantId)
Sets the parent to be a virtual descendant of the given root. If virtualDescendantId equals to {@link View#NO_ID} the root is set as the parent.

A virtual descendant is an imaginary View that is reported as a part of the view hierarchy for accessibility purposes. This enables custom views that draw complex content to report them selves as a tree of virtual views, thus conveying their logical structure.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
root The root of the virtual subtree.
param
virtualDescendantId The id of the virtual descendant.

        enforceNotSealed();
        final int rootAccessibilityViewId =
            (root != null) ? root.getAccessibilityViewId() : UNDEFINED_ITEM_ID;
        mParentNodeId = makeNodeId(rootAccessibilityViewId, virtualDescendantId);
    
public voidsetPassword(boolean password)
Sets whether this node is a password.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
password True if the node is a password.
throws
IllegalStateException If called from an AccessibilityService.

        setBooleanProperty(BOOLEAN_PROPERTY_PASSWORD, password);
    
public voidsetRangeInfo(android.view.accessibility.AccessibilityNodeInfo$RangeInfo rangeInfo)
Sets the range info if this node is a range.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
rangeInfo The range info.

        enforceNotSealed();
        mRangeInfo = rangeInfo;
    
public voidsetScrollable(boolean scrollable)
Sets if the node is scrollable.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
scrollable True if the node is scrollable, false otherwise.
throws
IllegalStateException If called from an AccessibilityService.

        setBooleanProperty(BOOLEAN_PROPERTY_SCROLLABLE, scrollable);
    
public voidsetSealed(boolean sealed)
Sets if this instance is sealed.

param
sealed Whether is sealed.
hide

        mSealed = sealed;
    
public voidsetSelected(boolean selected)
Sets whether this node is selected.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
selected True if the node is selected.
throws
IllegalStateException If called from an AccessibilityService.

        setBooleanProperty(BOOLEAN_PROPERTY_SELECTED, selected);
    
public voidsetSource(android.view.View source)
Sets the source.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
source The info source.

        setSource(source, UNDEFINED_ITEM_ID);
    
public voidsetSource(android.view.View root, int virtualDescendantId)
Sets the source to be a virtual descendant of the given root. If virtualDescendantId is {@link View#NO_ID} the root is set as the source.

A virtual descendant is an imaginary View that is reported as a part of the view hierarchy for accessibility purposes. This enables custom views that draw complex content to report themselves as a tree of virtual views, thus conveying their logical structure.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
root The root of the virtual subtree.
param
virtualDescendantId The id of the virtual descendant.

        enforceNotSealed();
        mWindowId = (root != null) ? root.getAccessibilityWindowId() : UNDEFINED_ITEM_ID;
        final int rootAccessibilityViewId =
            (root != null) ? root.getAccessibilityViewId() : UNDEFINED_ITEM_ID;
        mSourceNodeId = makeNodeId(rootAccessibilityViewId, virtualDescendantId);
    
public voidsetText(java.lang.CharSequence text)
Sets the text of this node.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
text The text.
throws
IllegalStateException If called from an AccessibilityService.

        enforceNotSealed();
        mText = text;
    
public voidsetTextSelection(int start, int end)
Sets the text selection start and end.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
start The text selection start.
param
end The text selection end.
throws
IllegalStateException If called from an AccessibilityService.

        enforceNotSealed();
        mTextSelectionStart = start;
        mTextSelectionEnd = end;
    
public voidsetTraversalAfter(android.view.View view)
Sets the view whose node is visited after this one in accessibility traversal. A screen-reader must visit the content of the other node before the content of this one.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
view The previous view.
see
#getTraversalAfter()

        setTraversalAfter(view, UNDEFINED_ITEM_ID);
    
public voidsetTraversalAfter(android.view.View root, int virtualDescendantId)
Sets the node after which this one is visited in accessibility traversal. A screen-reader must visit the content of the other node before the content of this one. If virtualDescendantId equals to {@link View#NO_ID} the root is set as the predecessor.

A virtual descendant is an imaginary View that is reported as a part of the view hierarchy for accessibility purposes. This enables custom views that draw complex content to report them selves as a tree of virtual views, thus conveying their logical structure.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
root The root of the virtual subtree.
param
virtualDescendantId The id of the virtual descendant.

        enforceNotSealed();
        final int rootAccessibilityViewId = (root != null)
                ? root.getAccessibilityViewId() : UNDEFINED_ITEM_ID;
        mTraversalAfter = makeNodeId(rootAccessibilityViewId, virtualDescendantId);
    
public voidsetTraversalBefore(android.view.View view)
Sets the view before whose node this one should be visited during traversal. A screen-reader must visit the content of this node before the content of the one it precedes.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
view The view providing the preceding node.
see
#getTraversalBefore()

        setTraversalBefore(view, UNDEFINED_ITEM_ID);
    
public voidsetTraversalBefore(android.view.View root, int virtualDescendantId)
Sets the node before which this one is visited during traversal. A screen-reader must visit the content of this node before the content of the one it precedes. The successor is a virtual descendant of the given root. If virtualDescendantId equals to {@link View#NO_ID} the root is set as the successor.

A virtual descendant is an imaginary View that is reported as a part of the view hierarchy for accessibility purposes. This enables custom views that draw complex content to report them selves as a tree of virtual views, thus conveying their logical structure.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
root The root of the virtual subtree.
param
virtualDescendantId The id of the virtual descendant.

        enforceNotSealed();
        final int rootAccessibilityViewId = (root != null)
                ? root.getAccessibilityViewId() : UNDEFINED_ITEM_ID;
        mTraversalBefore = makeNodeId(rootAccessibilityViewId, virtualDescendantId);
    
public voidsetViewIdResourceName(java.lang.String viewIdResName)
Sets the fully qualified resource name of the source view's id.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
viewIdResName The id resource name.

        enforceNotSealed();
        mViewIdResourceName = viewIdResName;
    
public voidsetVisibleToUser(boolean visibleToUser)
Sets whether this node is visible to the user.

Note: Cannot be called from an {@link android.accessibilityservice.AccessibilityService}. This class is made immutable before being delivered to an AccessibilityService.

param
visibleToUser Whether the node is visible to the user.
throws
IllegalStateException If called from an AccessibilityService.

        setBooleanProperty(BOOLEAN_PROPERTY_VISIBLE_TO_USER, visibleToUser);
    
public java.lang.StringtoString()

        StringBuilder builder = new StringBuilder();
        builder.append(super.toString());

        if (DEBUG) {
            builder.append("; sourceNodeId: " + mSourceNodeId);
            builder.append("; accessibilityViewId: " + getAccessibilityViewId(mSourceNodeId));
            builder.append("; virtualDescendantId: " + getVirtualDescendantId(mSourceNodeId));
            builder.append("; mParentNodeId: " + mParentNodeId);
            builder.append("; traversalBefore: ").append(mTraversalBefore);
            builder.append("; traversalAfter: ").append(mTraversalAfter);

            int granularities = mMovementGranularities;
            builder.append("; MovementGranularities: [");
            while (granularities != 0) {
                final int granularity = 1 << Integer.numberOfTrailingZeros(granularities);
                granularities &= ~granularity;
                builder.append(getMovementGranularitySymbolicName(granularity));
                if (granularities != 0) {
                    builder.append(", ");
                }
            }
            builder.append("]");

            builder.append("; childAccessibilityIds: [");
            final LongArray childIds = mChildNodeIds;
            if (childIds != null) {
                for (int i = 0, count = childIds.size(); i < count; i++) {
                    builder.append(childIds.get(i));
                    if (i < count - 1) {
                        builder.append(", ");
                    }
                }
            }
            builder.append("]");
        }

        builder.append("; boundsInParent: " + mBoundsInParent);
        builder.append("; boundsInScreen: " + mBoundsInScreen);

        builder.append("; packageName: ").append(mPackageName);
        builder.append("; className: ").append(mClassName);
        builder.append("; text: ").append(mText);
        builder.append("; error: ").append(mError);
        builder.append("; maxTextLength: ").append(mMaxTextLength);
        builder.append("; contentDescription: ").append(mContentDescription);
        builder.append("; viewIdResName: ").append(mViewIdResourceName);

        builder.append("; checkable: ").append(isCheckable());
        builder.append("; checked: ").append(isChecked());
        builder.append("; focusable: ").append(isFocusable());
        builder.append("; focused: ").append(isFocused());
        builder.append("; selected: ").append(isSelected());
        builder.append("; clickable: ").append(isClickable());
        builder.append("; longClickable: ").append(isLongClickable());
        builder.append("; enabled: ").append(isEnabled());
        builder.append("; password: ").append(isPassword());
        builder.append("; scrollable: ").append(isScrollable());
        builder.append("; actions: ").append(mActions);

        return builder.toString();
    
public voidwriteToParcel(android.os.Parcel parcel, int flags)
{@inheritDoc}

Note: After the instance is written to a parcel it is recycled. You must not touch the object after calling this function.

        parcel.writeInt(isSealed() ? 1 : 0);
        parcel.writeLong(mSourceNodeId);
        parcel.writeInt(mWindowId);
        parcel.writeLong(mParentNodeId);
        parcel.writeLong(mLabelForId);
        parcel.writeLong(mLabeledById);
        parcel.writeLong(mTraversalBefore);
        parcel.writeLong(mTraversalAfter);

        parcel.writeInt(mConnectionId);

        final LongArray childIds = mChildNodeIds;
        if (childIds == null) {
            parcel.writeInt(0);
        } else {
            final int childIdsSize = childIds.size();
            parcel.writeInt(childIdsSize);
            for (int i = 0; i < childIdsSize; i++) {
                parcel.writeLong(childIds.get(i));
            }
        }

        parcel.writeInt(mBoundsInParent.top);
        parcel.writeInt(mBoundsInParent.bottom);
        parcel.writeInt(mBoundsInParent.left);
        parcel.writeInt(mBoundsInParent.right);

        parcel.writeInt(mBoundsInScreen.top);
        parcel.writeInt(mBoundsInScreen.bottom);
        parcel.writeInt(mBoundsInScreen.left);
        parcel.writeInt(mBoundsInScreen.right);

        if (mActions != null && !mActions.isEmpty()) {
            final int actionCount = mActions.size();
            parcel.writeInt(actionCount);

            int defaultLegacyStandardActions = 0;
            for (int i = 0; i < actionCount; i++) {
                AccessibilityAction action = mActions.get(i);
                if (isDefaultLegacyStandardAction(action)) {
                    defaultLegacyStandardActions |= action.getId();
                }
            }
            parcel.writeInt(defaultLegacyStandardActions);

            for (int i = 0; i < actionCount; i++) {
                AccessibilityAction action = mActions.get(i);
                if (!isDefaultLegacyStandardAction(action)) {
                    parcel.writeInt(action.getId());
                    parcel.writeCharSequence(action.getLabel());
                }
            }
        } else {
            parcel.writeInt(0);
        }

        parcel.writeInt(mMaxTextLength);
        parcel.writeInt(mMovementGranularities);
        parcel.writeInt(mBooleanProperties);

        parcel.writeCharSequence(mPackageName);
        parcel.writeCharSequence(mClassName);
        parcel.writeCharSequence(mText);
        parcel.writeCharSequence(mError);
        parcel.writeCharSequence(mContentDescription);
        parcel.writeString(mViewIdResourceName);

        parcel.writeInt(mTextSelectionStart);
        parcel.writeInt(mTextSelectionEnd);
        parcel.writeInt(mInputType);
        parcel.writeInt(mLiveRegion);

        if (mExtras != null) {
            parcel.writeInt(1);
            parcel.writeBundle(mExtras);
        } else {
            parcel.writeInt(0);
        }

        if (mRangeInfo != null) {
            parcel.writeInt(1);
            parcel.writeInt(mRangeInfo.getType());
            parcel.writeFloat(mRangeInfo.getMin());
            parcel.writeFloat(mRangeInfo.getMax());
            parcel.writeFloat(mRangeInfo.getCurrent());
        } else {
            parcel.writeInt(0);
        }

        if (mCollectionInfo != null) {
            parcel.writeInt(1);
            parcel.writeInt(mCollectionInfo.getRowCount());
            parcel.writeInt(mCollectionInfo.getColumnCount());
            parcel.writeInt(mCollectionInfo.isHierarchical() ? 1 : 0);
            parcel.writeInt(mCollectionInfo.getSelectionMode());
        } else {
            parcel.writeInt(0);
        }

        if (mCollectionItemInfo != null) {
            parcel.writeInt(1);
            parcel.writeInt(mCollectionItemInfo.getColumnIndex());
            parcel.writeInt(mCollectionItemInfo.getColumnSpan());
            parcel.writeInt(mCollectionItemInfo.getRowIndex());
            parcel.writeInt(mCollectionItemInfo.getRowSpan());
            parcel.writeInt(mCollectionItemInfo.isHeading() ? 1 : 0);
            parcel.writeInt(mCollectionItemInfo.isSelected() ? 1 : 0);
        } else {
            parcel.writeInt(0);
        }

        // Since instances of this class are fetched via synchronous i.e. blocking
        // calls in IPCs we always recycle as soon as the instance is marshaled.
        recycle();