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_FOCUSAction that gives input focus to the node. |
public static final int | ACTION_CLEAR_FOCUSAction that clears input focus of the node. |
public static final int | ACTION_SELECTAction that selects the node. |
public static final int | ACTION_CLEAR_SELECTIONAction that deselects the node. |
public static final int | ACTION_CLICKAction that clicks on the node info. |
public static final int | ACTION_LONG_CLICKAction that long clicks on the node. |
public static final int | ACTION_ACCESSIBILITY_FOCUSAction that gives accessibility focus to the node. |
public static final int | ACTION_CLEAR_ACCESSIBILITY_FOCUSAction that clears accessibility focus of the node. |
public static final int | ACTION_NEXT_AT_MOVEMENT_GRANULARITYAction 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_GRANULARITYAction 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_ELEMENTAction 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_ELEMENTAction 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_FORWARDAction to scroll the node content forward. |
public static final int | ACTION_SCROLL_BACKWARDAction to scroll the node content backward. |
public static final int | ACTION_COPYAction to copy the current selection to the clipboard. |
public static final int | ACTION_PASTEAction to paste the current clipboard content. |
public static final int | ACTION_CUTAction to cut the current selection and place it to the clipboard. |
public static final int | ACTION_SET_SELECTIONAction 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_EXPANDAction to expand an expandable node. |
public static final int | ACTION_COLLAPSEAction to collapse an expandable node. |
public static final int | ACTION_DISMISSAction to dismiss a dismissable node. |
public static final int | ACTION_SET_TEXTAction 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_MASKMask to see if the value is larger than the largest ACTION_ constant |
public static final String | ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INTArgument 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_STRINGArgument 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_BOOLEANArgument 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_INTArgument for specifying the selection start.
Type: int
Actions: {@link #ACTION_SET_SELECTION}
|
public static final String | ACTION_ARGUMENT_SELECTION_END_INTArgument for specifying the selection end.
Type: int
Actions: {@link #ACTION_SET_SELECTION}
|
public static final String | ACTION_ARGUMENT_SET_TEXT_CHARSEQUENCEArgument for specifying the text content to set
Type: CharSequence
Actions: {@link #ACTION_SET_TEXT}
|
public static final int | FOCUS_INPUTThe input focus. |
public static final int | FOCUS_ACCESSIBILITYThe accessibility focus. |
public static final int | MOVEMENT_GRANULARITY_CHARACTERMovement granularity bit for traversing the text of a node by character. |
public static final int | MOVEMENT_GRANULARITY_WORDMovement granularity bit for traversing the text of a node by word. |
public static final int | MOVEMENT_GRANULARITY_LINEMovement granularity bit for traversing the text of a node by line. |
public static final int | MOVEMENT_GRANULARITY_PARAGRAPHMovement granularity bit for traversing the text of a node by paragraph. |
public static final int | MOVEMENT_GRANULARITY_PAGEMovement 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_MASKBits that provide the id of a virtual descendant of a view. |
private static final int | VIRTUAL_DESCENDANT_ID_SHIFTBit 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 |
Methods Summary |
---|
public void | addAction(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.
enforceNotSealed();
if (action == null) {
return;
}
if (mActions == null) {
mActions = new ArrayList<AccessibilityAction>();
}
mActions.remove(action);
mActions.add(action);
|
public void | addAction(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.
enforceNotSealed();
if ((action & ACTION_TYPE_MASK) != 0) {
throw new IllegalArgumentException("Action is not a combination of the standard " +
"actions: " + action);
}
addLegacyStandardActions(action);
|
public void | addChild(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.
addChildInternal(child, UNDEFINED_ITEM_ID, true);
|
public void | addChild(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.
addChildInternal(root, virtualDescendantId, true);
|
private void | addChildInternal(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 void | addChildUnchecked(android.view.View child)Unchecked version of {@link #addChild(View)} that does not verify
uniqueness. For framework use only.
addChildInternal(child, UNDEFINED_ITEM_ID, false);
|
private void | addLegacyStandardActions(int actionMask)
int remainingIds = actionMask;
while (remainingIds > 0) {
final int id = 1 << Integer.numberOfTrailingZeros(remainingIds);
remainingIds &= ~id;
AccessibilityAction action = getActionSingleton(id);
addAction(action);
}
|
public boolean | canOpenPopup()Gets if this node opens a popup or a dialog.
return getBooleanProperty(BOOLEAN_PROPERTY_OPENS_POPUP);
|
private boolean | canPerformRequestOverConnection(long accessibilityNodeId)
return (mWindowId != UNDEFINED_ITEM_ID
&& getAccessibilityViewId(accessibilityNodeId) != UNDEFINED_ITEM_ID
&& mConnectionId != UNDEFINED_CONNECTION_ID);
|
private void | clear()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 int | describeContents(){@inheritDoc}
return 0;
|
protected void | enforceNotSealed()Enforces that this instance is not sealed.
if (isSealed()) {
throw new IllegalStateException("Cannot perform this "
+ "action on a sealed instance.");
}
|
protected void | enforceSealed()Enforces that this instance is sealed.
if (!isSealed()) {
throw new IllegalStateException("Cannot perform this "
+ "action on a not sealed instance.");
}
|
private void | enforceValidFocusDirection(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 void | enforceValidFocusType(int focusType)
switch (focusType) {
case FOCUS_INPUT:
case FOCUS_ACCESSIBILITY:
return;
default:
throw new IllegalArgumentException("Unknown focus type: " + focusType);
}
|
public boolean | equals(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.List | findAccessibilityNodeInfosByText(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.
enforceSealed();
if (!canPerformRequestOverConnection(mSourceNodeId)) {
return Collections.emptyList();
}
AccessibilityInteractionClient client = AccessibilityInteractionClient.getInstance();
return client.findAccessibilityNodeInfosByText(mConnectionId, mWindowId, mSourceNodeId,
text);
|
public java.util.List | findAccessibilityNodeInfosByViewId(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}.
enforceSealed();
if (!canPerformRequestOverConnection(mSourceNodeId)) {
return Collections.emptyList();
}
AccessibilityInteractionClient client = AccessibilityInteractionClient.getInstance();
return client.findAccessibilityNodeInfosByViewId(mConnectionId, mWindowId, mSourceNodeId,
viewId);
|
public android.view.accessibility.AccessibilityNodeInfo | findFocus(int focus)Find the view that has the specified focus type. The search starts from
the view represented by this node info.
enforceSealed();
enforceValidFocusType(focus);
if (!canPerformRequestOverConnection(mSourceNodeId)) {
return null;
}
return AccessibilityInteractionClient.getInstance().findFocus(mConnectionId, mWindowId,
mSourceNodeId, focus);
|
public android.view.accessibility.AccessibilityNodeInfo | focusSearch(int direction)Searches for the nearest view in the specified direction that can take
the input focus.
enforceSealed();
enforceValidFocusDirection(direction);
if (!canPerformRequestOverConnection(mSourceNodeId)) {
return null;
}
return AccessibilityInteractionClient.getInstance().focusSearch(mConnectionId, mWindowId,
mSourceNodeId, direction);
|
public static int | getAccessibilityViewId(long accessibilityNodeId)Gets the accessibility view id which identifies a View in the view three.
return (int) accessibilityNodeId;
|
public java.util.List | getActionList()Gets the actions that can be performed on the node.
if (mActions == null) {
return Collections.emptyList();
}
return mActions;
|
private static android.view.accessibility.AccessibilityNodeInfo$AccessibilityAction | getActionSingleton(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.String | getActionSymbolicName(int action)Gets the human readable action 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 int | getActions()Gets the actions that can be performed on the node.
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 boolean | getBooleanProperty(int property)Gets the value of a boolean property.
return (mBooleanProperties & property) != 0;
|
public void | getBoundsInParent(android.graphics.Rect outBounds)Gets the node bounds in parent coordinates.
outBounds.set(mBoundsInParent.left, mBoundsInParent.top,
mBoundsInParent.right, mBoundsInParent.bottom);
|
public void | getBoundsInScreen(android.graphics.Rect outBounds)Gets the node bounds in screen coordinates.
outBounds.set(mBoundsInScreen.left, mBoundsInScreen.top,
mBoundsInScreen.right, mBoundsInScreen.bottom);
|
public android.view.accessibility.AccessibilityNodeInfo | getChild(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.
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 int | getChildCount()Gets the number of children.
return mChildNodeIds == null ? 0 : mChildNodeIds.size();
|
public long | getChildId(int index)Returns the id of the child at the specified index.
if (mChildNodeIds == null) {
throw new IndexOutOfBoundsException();
}
return mChildNodeIds.get(index);
|
public android.util.LongArray | getChildNodeIds()Returns the array containing the IDs of this node's children.
return mChildNodeIds;
|
public java.lang.CharSequence | getClassName()Gets the class this node comes from.
return mClassName;
|
public android.view.accessibility.AccessibilityNodeInfo$CollectionInfo | getCollectionInfo()Gets the collection info if the node is a collection. A collection
child is always a collection item.
return mCollectionInfo;
|
public android.view.accessibility.AccessibilityNodeInfo$CollectionItemInfo | getCollectionItemInfo()Gets the collection item info if the node is a collection item. A collection
item is always a child of a collection.
return mCollectionItemInfo;
|
public java.lang.CharSequence | getContentDescription()Gets the content description of this node.
return mContentDescription;
|
public java.lang.CharSequence | getError()Gets the error text of this node.
return mError;
|
public android.os.Bundle | getExtras()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.
if (mExtras == null) {
mExtras = new Bundle();
}
return mExtras;
|
public int | getInputType()Gets the input type of the source as defined by {@link InputType}.
return mInputType;
|
public android.view.accessibility.AccessibilityNodeInfo | getLabelFor()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.
enforceSealed();
return getNodeForAccessibilityId(mLabelForId);
|
public android.view.accessibility.AccessibilityNodeInfo | getLabeledBy()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.
enforceSealed();
return getNodeForAccessibilityId(mLabeledById);
|
public int | getLiveRegion()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 mLiveRegion;
|
public int | getMaxTextLength()Returns the maximum text length for this node.
return mMaxTextLength;
|
public int | getMovementGranularities()Gets the movement granularities for traversing the text of this node.
return mMovementGranularities;
|
private static java.lang.String | getMovementGranularitySymbolicName(int granularity)Gets the human readable movement granularity 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.AccessibilityNodeInfo | getNodeForAccessibilityId(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.CharSequence | getPackageName()Gets the package this node comes from.
return mPackageName;
|
public android.view.accessibility.AccessibilityNodeInfo | getParent()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.
enforceSealed();
return getNodeForAccessibilityId(mParentNodeId);
|
public long | getParentNodeId()
return mParentNodeId;
|
public android.view.accessibility.AccessibilityNodeInfo$RangeInfo | getRangeInfo()Gets the range info if this node is a range.
return mRangeInfo;
|
public long | getSourceNodeId()Gets the id of the source node.
return mSourceNodeId;
|
public java.lang.CharSequence | getText()Gets the text of this node.
return mText;
|
public int | getTextSelectionEnd()Gets the text selection end.
return mTextSelectionEnd;
|
public int | getTextSelectionStart()Gets the text selection start.
return mTextSelectionStart;
|
public android.view.accessibility.AccessibilityNodeInfo | getTraversalAfter()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.
enforceSealed();
return getNodeForAccessibilityId(mTraversalAfter);
|
public android.view.accessibility.AccessibilityNodeInfo | getTraversalBefore()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.
enforceSealed();
return getNodeForAccessibilityId(mTraversalBefore);
|
public java.lang.String | getViewIdResourceName()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 mViewIdResourceName;
|
public static int | getVirtualDescendantId(long accessibilityNodeId)Gets the virtual descendant id which identifies an imaginary view in a
containing View.
return (int) ((accessibilityNodeId & VIRTUAL_DESCENDANT_ID_MASK)
>> VIRTUAL_DESCENDANT_ID_SHIFT);
|
public AccessibilityWindowInfo | getWindow()Gets the window to which this node belongs.
enforceSealed();
if (!canPerformRequestOverConnection(mSourceNodeId)) {
return null;
}
AccessibilityInteractionClient client = AccessibilityInteractionClient.getInstance();
return client.getWindow(mConnectionId, mWindowId);
|
public int | getWindowId()Gets the id of the window from which the info comes from.
return mWindowId;
|
public int | hashCode()
final int prime = 31;
int result = 1;
result = prime * result + getAccessibilityViewId(mSourceNodeId);
result = prime * result + getVirtualDescendantId(mSourceNodeId);
result = prime * result + mWindowId;
return result;
|
private void | init(android.view.accessibility.AccessibilityNodeInfo other)Initializes this instance from another one.
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 void | initFromParcel(android.os.Parcel parcel)Creates a new instance from a {@link Parcel}.
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 boolean | isAccessibilityFocused()Gets whether this node is accessibility focused.
return getBooleanProperty(BOOLEAN_PROPERTY_ACCESSIBILITY_FOCUSED);
|
public boolean | isCheckable()Gets whether this node is checkable.
return getBooleanProperty(BOOLEAN_PROPERTY_CHECKABLE);
|
public boolean | isChecked()Gets whether this node is checked.
return getBooleanProperty(BOOLEAN_PROPERTY_CHECKED);
|
public boolean | isClickable()Gets whether this node is clickable.
return getBooleanProperty(BOOLEAN_PROPERTY_CLICKABLE);
|
public boolean | isContentInvalid()Gets if the content of this node is invalid. For example,
a date is not well-formed.
return getBooleanProperty(BOOLEAN_PROPERTY_CONTENT_INVALID);
|
private static boolean | isDefaultLegacyStandardAction(android.view.accessibility.AccessibilityNodeInfo$AccessibilityAction action)
return (action.getId() <= LAST_LEGACY_STANDARD_ACTION
&& TextUtils.isEmpty(action.getLabel()));
|
public boolean | isDismissable()Gets if the node can be dismissed.
return getBooleanProperty(BOOLEAN_PROPERTY_DISMISSABLE);
|
public boolean | isEditable()Gets if the node is editable.
return getBooleanProperty(BOOLEAN_PROPERTY_EDITABLE);
|
public boolean | isEnabled()Gets whether this node is enabled.
return getBooleanProperty(BOOLEAN_PROPERTY_ENABLED);
|
public boolean | isFocusable()Gets whether this node is focusable.
return getBooleanProperty(BOOLEAN_PROPERTY_FOCUSABLE);
|
public boolean | isFocused()Gets whether this node is focused.
return getBooleanProperty(BOOLEAN_PROPERTY_FOCUSED);
|
public boolean | isLongClickable()Gets whether this node is long clickable.
return getBooleanProperty(BOOLEAN_PROPERTY_LONG_CLICKABLE);
|
public boolean | isMultiLine()Gets if the node is a multi line editable text.
return getBooleanProperty(BOOLEAN_PROPERTY_MULTI_LINE);
|
public boolean | isPassword()Gets whether this node is a password.
return getBooleanProperty(BOOLEAN_PROPERTY_PASSWORD);
|
public boolean | isScrollable()Gets if the node is scrollable.
return getBooleanProperty(BOOLEAN_PROPERTY_SCROLLABLE);
|
public boolean | isSealed()Gets if this instance is sealed.
return mSealed;
|
public boolean | isSelected()Gets whether this node is selected.
return getBooleanProperty(BOOLEAN_PROPERTY_SELECTED);
|
public boolean | isVisibleToUser()Sets whether this node is visible to the user.
return getBooleanProperty(BOOLEAN_PROPERTY_VISIBLE_TO_USER);
|
public static long | makeNodeId(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 .
// 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.AccessibilityNodeInfo | obtain(android.view.View source)Returns a cached instance if such is available otherwise a new one
and sets the source.
AccessibilityNodeInfo info = AccessibilityNodeInfo.obtain();
info.setSource(source);
return info;
|
public static android.view.accessibility.AccessibilityNodeInfo | obtain(android.view.View root, int virtualDescendantId)Returns a cached instance if such is available otherwise a new one
and sets the source.
AccessibilityNodeInfo info = AccessibilityNodeInfo.obtain();
info.setSource(root, virtualDescendantId);
return info;
|
public static android.view.accessibility.AccessibilityNodeInfo | obtain()Returns a cached instance if such is available otherwise a new one.
AccessibilityNodeInfo info = sPool.acquire();
return (info != null) ? info : new AccessibilityNodeInfo();
|
public static android.view.accessibility.AccessibilityNodeInfo | obtain(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 .
AccessibilityNodeInfo infoClone = AccessibilityNodeInfo.obtain();
infoClone.init(info);
return infoClone;
|
public boolean | performAction(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}.
enforceSealed();
if (!canPerformRequestOverConnection(mSourceNodeId)) {
return false;
}
AccessibilityInteractionClient client = AccessibilityInteractionClient.getInstance();
return client.performAccessibilityAction(mConnectionId, mWindowId, mSourceNodeId,
action, null);
|
public boolean | performAction(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}.
enforceSealed();
if (!canPerformRequestOverConnection(mSourceNodeId)) {
return false;
}
AccessibilityInteractionClient client = AccessibilityInteractionClient.getInstance();
return client.performAccessibilityAction(mConnectionId, mWindowId, mSourceNodeId,
action, arguments);
|
public void | recycle()Return an instance back to be reused.
Note: You must not touch the object after calling this function.
clear();
sPool.release(this);
|
public boolean | refresh(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.
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 boolean | refresh()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 refresh(false);
|
public void | removeAction(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.
enforceNotSealed();
removeAction(getActionSingleton(action));
|
public boolean | removeAction(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.
enforceNotSealed();
if (mActions == null || action == null) {
return false;
}
return mActions.remove(action);
|
public boolean | removeChild(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.
return removeChild(child, UNDEFINED_ITEM_ID);
|
public boolean | removeChild(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.
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 void | setAccessibilityFocused(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.
setBooleanProperty(BOOLEAN_PROPERTY_ACCESSIBILITY_FOCUSED, focused);
|
private void | setBooleanProperty(int property, boolean value)Sets a boolean property.
enforceNotSealed();
if (value) {
mBooleanProperties |= property;
} else {
mBooleanProperties &= ~property;
}
|
public void | setBoundsInParent(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.
enforceNotSealed();
mBoundsInParent.set(bounds.left, bounds.top, bounds.right, bounds.bottom);
|
public void | setBoundsInScreen(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.
enforceNotSealed();
mBoundsInScreen.set(bounds.left, bounds.top, bounds.right, bounds.bottom);
|
public void | setCanOpenPopup(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.
enforceNotSealed();
setBooleanProperty(BOOLEAN_PROPERTY_OPENS_POPUP, opensPopup);
|
public void | setCheckable(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.
setBooleanProperty(BOOLEAN_PROPERTY_CHECKABLE, checkable);
|
public void | setChecked(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.
setBooleanProperty(BOOLEAN_PROPERTY_CHECKED, checked);
|
public void | setClassName(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.
enforceNotSealed();
mClassName = className;
|
public void | setClickable(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.
setBooleanProperty(BOOLEAN_PROPERTY_CLICKABLE, clickable);
|
public void | setCollectionInfo(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.
enforceNotSealed();
mCollectionInfo = collectionInfo;
|
public void | setCollectionItemInfo(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 void | setConnectionId(int connectionId)Sets the unique id of the IAccessibilityServiceConnection over which
this instance can send requests to the system.
enforceNotSealed();
mConnectionId = connectionId;
|
public void | setContentDescription(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.
enforceNotSealed();
mContentDescription = contentDescription;
|
public void | setContentInvalid(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.
setBooleanProperty(BOOLEAN_PROPERTY_CONTENT_INVALID, contentInvalid);
|
public void | setDismissable(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.
setBooleanProperty(BOOLEAN_PROPERTY_DISMISSABLE, dismissable);
|
public void | setEditable(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.
setBooleanProperty(BOOLEAN_PROPERTY_EDITABLE, editable);
|
public void | setEnabled(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.
setBooleanProperty(BOOLEAN_PROPERTY_ENABLED, enabled);
|
public void | setError(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.
enforceNotSealed();
mError = error;
|
public void | setFocusable(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.
setBooleanProperty(BOOLEAN_PROPERTY_FOCUSABLE, focusable);
|
public void | setFocused(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.
setBooleanProperty(BOOLEAN_PROPERTY_FOCUSED, focused);
|
public void | setInputType(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.
enforceNotSealed();
mInputType = inputType;
|
public void | setLabelFor(android.view.View labeled)Sets the view for which the view represented by this info serves as a
label for accessibility purposes.
setLabelFor(labeled, UNDEFINED_ITEM_ID);
|
public void | setLabelFor(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.
enforceNotSealed();
final int rootAccessibilityViewId = (root != null)
? root.getAccessibilityViewId() : UNDEFINED_ITEM_ID;
mLabelForId = makeNodeId(rootAccessibilityViewId, virtualDescendantId);
|
public void | setLabeledBy(android.view.View label)Sets the view which serves as the label of the view represented by
this info for accessibility purposes.
setLabeledBy(label, UNDEFINED_ITEM_ID);
|
public void | setLabeledBy(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.
enforceNotSealed();
final int rootAccessibilityViewId = (root != null)
? root.getAccessibilityViewId() : UNDEFINED_ITEM_ID;
mLabeledById = makeNodeId(rootAccessibilityViewId, virtualDescendantId);
|
public void | setLiveRegion(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.
enforceNotSealed();
mLiveRegion = mode;
|
public void | setLongClickable(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.
setBooleanProperty(BOOLEAN_PROPERTY_LONG_CLICKABLE, longClickable);
|
public void | setMaxTextLength(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.
enforceNotSealed();
mMaxTextLength = max;
|
public void | setMovementGranularities(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.
enforceNotSealed();
mMovementGranularities = granularities;
|
public void | setMultiLine(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.
setBooleanProperty(BOOLEAN_PROPERTY_MULTI_LINE, multiLine);
|
public void | setPackageName(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.
enforceNotSealed();
mPackageName = packageName;
|
public void | setParent(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.
setParent(parent, UNDEFINED_ITEM_ID);
|
public void | setParent(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.
enforceNotSealed();
final int rootAccessibilityViewId =
(root != null) ? root.getAccessibilityViewId() : UNDEFINED_ITEM_ID;
mParentNodeId = makeNodeId(rootAccessibilityViewId, virtualDescendantId);
|
public void | setPassword(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.
setBooleanProperty(BOOLEAN_PROPERTY_PASSWORD, password);
|
public void | setRangeInfo(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.
enforceNotSealed();
mRangeInfo = rangeInfo;
|
public void | setScrollable(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.
setBooleanProperty(BOOLEAN_PROPERTY_SCROLLABLE, scrollable);
|
public void | setSealed(boolean sealed)Sets if this instance is sealed.
mSealed = sealed;
|
public void | setSelected(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.
setBooleanProperty(BOOLEAN_PROPERTY_SELECTED, selected);
|
public void | setSource(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.
setSource(source, UNDEFINED_ITEM_ID);
|
public void | setSource(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.
enforceNotSealed();
mWindowId = (root != null) ? root.getAccessibilityWindowId() : UNDEFINED_ITEM_ID;
final int rootAccessibilityViewId =
(root != null) ? root.getAccessibilityViewId() : UNDEFINED_ITEM_ID;
mSourceNodeId = makeNodeId(rootAccessibilityViewId, virtualDescendantId);
|
public void | setText(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.
enforceNotSealed();
mText = text;
|
public void | setTextSelection(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.
enforceNotSealed();
mTextSelectionStart = start;
mTextSelectionEnd = end;
|
public void | setTraversalAfter(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.
setTraversalAfter(view, UNDEFINED_ITEM_ID);
|
public void | setTraversalAfter(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.
enforceNotSealed();
final int rootAccessibilityViewId = (root != null)
? root.getAccessibilityViewId() : UNDEFINED_ITEM_ID;
mTraversalAfter = makeNodeId(rootAccessibilityViewId, virtualDescendantId);
|
public void | setTraversalBefore(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.
setTraversalBefore(view, UNDEFINED_ITEM_ID);
|
public void | setTraversalBefore(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.
enforceNotSealed();
final int rootAccessibilityViewId = (root != null)
? root.getAccessibilityViewId() : UNDEFINED_ITEM_ID;
mTraversalBefore = makeNodeId(rootAccessibilityViewId, virtualDescendantId);
|
public void | setViewIdResourceName(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.
enforceNotSealed();
mViewIdResourceName = viewIdResName;
|
public void | setVisibleToUser(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.
setBooleanProperty(BOOLEAN_PROPERTY_VISIBLE_TO_USER, visibleToUser);
|
public java.lang.String | toString()
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 void | writeToParcel(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();
|