Loading core/api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -50952,6 +50952,7 @@ package android.view.accessibility { method @Nullable public android.view.accessibility.AccessibilityNodeInfo.TouchDelegateInfo getTouchDelegateInfo(); method public android.view.accessibility.AccessibilityNodeInfo getTraversalAfter(); method public android.view.accessibility.AccessibilityNodeInfo getTraversalBefore(); method @Nullable public String getUniqueId(); method public String getViewIdResourceName(); method public android.view.accessibility.AccessibilityWindowInfo getWindow(); method public int getWindowId(); Loading Loading @@ -51046,6 +51047,7 @@ package android.view.accessibility { method public void setTraversalAfter(android.view.View, int); method public void setTraversalBefore(android.view.View); method public void setTraversalBefore(android.view.View, int); method public void setUniqueId(@Nullable String); method public void setViewIdResourceName(String); method public void setVisibleToUser(boolean); method public void writeToParcel(android.os.Parcel, int); core/java/android/view/accessibility/AccessibilityNodeInfo.java +31 −0 Original line number Diff line number Diff line Loading @@ -806,6 +806,7 @@ public class AccessibilityNodeInfo implements Parcelable { private CharSequence mContentDescription; private CharSequence mTooltipText; private String mViewIdResourceName; private String mUniqueId; private ArrayList<String> mExtraDataKeys; @UnsupportedAppUsage Loading Loading @@ -3462,6 +3463,28 @@ public class AccessibilityNodeInfo implements Parcelable { return mSourceNodeId; } /** * Sets the unique id to act as a key to identify the node. If the node instance is replaced * after refreshing the layout, calling this API to assign the same unique id to the new * alike node can help accessibility service to identify it. * * @param uniqueId The unique id that is associated with a visible node on the screen */ public void setUniqueId(@Nullable String uniqueId) { enforceNotSealed(); mUniqueId = uniqueId; } /** * Gets the unique id of the node. * * @return The unique id */ @Nullable public String getUniqueId() { return mUniqueId; } /** * Sets the token and node id of the leashed parent. * Loading Loading @@ -3764,6 +3787,10 @@ public class AccessibilityNodeInfo implements Parcelable { nonDefaultFields |= bitAt(fieldIndex); } fieldIndex++; if (!Objects.equals(mUniqueId, DEFAULT.mUniqueId)) { nonDefaultFields |= bitAt(fieldIndex); } fieldIndex++; if (mTextSelectionStart != DEFAULT.mTextSelectionStart) { nonDefaultFields |= bitAt(fieldIndex); } Loading Loading @@ -3903,6 +3930,7 @@ public class AccessibilityNodeInfo implements Parcelable { if (isBitSet(nonDefaultFields, fieldIndex++)) parcel.writeCharSequence(mTooltipText); if (isBitSet(nonDefaultFields, fieldIndex++)) parcel.writeString(mViewIdResourceName); if (isBitSet(nonDefaultFields, fieldIndex++)) parcel.writeString(mUniqueId); if (isBitSet(nonDefaultFields, fieldIndex++)) parcel.writeInt(mTextSelectionStart); if (isBitSet(nonDefaultFields, fieldIndex++)) parcel.writeInt(mTextSelectionEnd); Loading Loading @@ -3982,6 +4010,7 @@ public class AccessibilityNodeInfo implements Parcelable { mTraversalAfter = other.mTraversalAfter; mWindowId = other.mWindowId; mConnectionId = other.mConnectionId; mUniqueId = other.mUniqueId; mBoundsInParent.set(other.mBoundsInParent); mBoundsInScreen.set(other.mBoundsInScreen); mPackageName = other.mPackageName; Loading Loading @@ -4154,6 +4183,7 @@ public class AccessibilityNodeInfo implements Parcelable { if (isBitSet(nonDefaultFields, fieldIndex++)) mPaneTitle = parcel.readCharSequence(); if (isBitSet(nonDefaultFields, fieldIndex++)) mTooltipText = parcel.readCharSequence(); if (isBitSet(nonDefaultFields, fieldIndex++)) mViewIdResourceName = parcel.readString(); if (isBitSet(nonDefaultFields, fieldIndex++)) mUniqueId = parcel.readString(); if (isBitSet(nonDefaultFields, fieldIndex++)) mTextSelectionStart = parcel.readInt(); if (isBitSet(nonDefaultFields, fieldIndex++)) mTextSelectionEnd = parcel.readInt(); Loading Loading @@ -4480,6 +4510,7 @@ public class AccessibilityNodeInfo implements Parcelable { builder.append("; contentDescription: ").append(mContentDescription); builder.append("; tooltipText: ").append(mTooltipText); builder.append("; viewIdResName: ").append(mViewIdResourceName); builder.append("; uniqueId: ").append(mUniqueId); builder.append("; checkable: ").append(isCheckable()); builder.append("; checked: ").append(isChecked()); Loading core/tests/coretests/src/android/view/accessibility/AccessibilityNodeInfoTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ public class AccessibilityNodeInfoTest { // The number of fields tested in the corresponding CTS AccessibilityNodeInfoTest: // See fullyPopulateAccessibilityNodeInfo, assertEqualsAccessibilityNodeInfo, // and assertAccessibilityNodeInfoCleared in that class. private static final int NUM_MARSHALLED_PROPERTIES = 39; private static final int NUM_MARSHALLED_PROPERTIES = 40; /** * The number of properties that are purposely not marshalled Loading Loading
core/api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -50952,6 +50952,7 @@ package android.view.accessibility { method @Nullable public android.view.accessibility.AccessibilityNodeInfo.TouchDelegateInfo getTouchDelegateInfo(); method public android.view.accessibility.AccessibilityNodeInfo getTraversalAfter(); method public android.view.accessibility.AccessibilityNodeInfo getTraversalBefore(); method @Nullable public String getUniqueId(); method public String getViewIdResourceName(); method public android.view.accessibility.AccessibilityWindowInfo getWindow(); method public int getWindowId(); Loading Loading @@ -51046,6 +51047,7 @@ package android.view.accessibility { method public void setTraversalAfter(android.view.View, int); method public void setTraversalBefore(android.view.View); method public void setTraversalBefore(android.view.View, int); method public void setUniqueId(@Nullable String); method public void setViewIdResourceName(String); method public void setVisibleToUser(boolean); method public void writeToParcel(android.os.Parcel, int);
core/java/android/view/accessibility/AccessibilityNodeInfo.java +31 −0 Original line number Diff line number Diff line Loading @@ -806,6 +806,7 @@ public class AccessibilityNodeInfo implements Parcelable { private CharSequence mContentDescription; private CharSequence mTooltipText; private String mViewIdResourceName; private String mUniqueId; private ArrayList<String> mExtraDataKeys; @UnsupportedAppUsage Loading Loading @@ -3462,6 +3463,28 @@ public class AccessibilityNodeInfo implements Parcelable { return mSourceNodeId; } /** * Sets the unique id to act as a key to identify the node. If the node instance is replaced * after refreshing the layout, calling this API to assign the same unique id to the new * alike node can help accessibility service to identify it. * * @param uniqueId The unique id that is associated with a visible node on the screen */ public void setUniqueId(@Nullable String uniqueId) { enforceNotSealed(); mUniqueId = uniqueId; } /** * Gets the unique id of the node. * * @return The unique id */ @Nullable public String getUniqueId() { return mUniqueId; } /** * Sets the token and node id of the leashed parent. * Loading Loading @@ -3764,6 +3787,10 @@ public class AccessibilityNodeInfo implements Parcelable { nonDefaultFields |= bitAt(fieldIndex); } fieldIndex++; if (!Objects.equals(mUniqueId, DEFAULT.mUniqueId)) { nonDefaultFields |= bitAt(fieldIndex); } fieldIndex++; if (mTextSelectionStart != DEFAULT.mTextSelectionStart) { nonDefaultFields |= bitAt(fieldIndex); } Loading Loading @@ -3903,6 +3930,7 @@ public class AccessibilityNodeInfo implements Parcelable { if (isBitSet(nonDefaultFields, fieldIndex++)) parcel.writeCharSequence(mTooltipText); if (isBitSet(nonDefaultFields, fieldIndex++)) parcel.writeString(mViewIdResourceName); if (isBitSet(nonDefaultFields, fieldIndex++)) parcel.writeString(mUniqueId); if (isBitSet(nonDefaultFields, fieldIndex++)) parcel.writeInt(mTextSelectionStart); if (isBitSet(nonDefaultFields, fieldIndex++)) parcel.writeInt(mTextSelectionEnd); Loading Loading @@ -3982,6 +4010,7 @@ public class AccessibilityNodeInfo implements Parcelable { mTraversalAfter = other.mTraversalAfter; mWindowId = other.mWindowId; mConnectionId = other.mConnectionId; mUniqueId = other.mUniqueId; mBoundsInParent.set(other.mBoundsInParent); mBoundsInScreen.set(other.mBoundsInScreen); mPackageName = other.mPackageName; Loading Loading @@ -4154,6 +4183,7 @@ public class AccessibilityNodeInfo implements Parcelable { if (isBitSet(nonDefaultFields, fieldIndex++)) mPaneTitle = parcel.readCharSequence(); if (isBitSet(nonDefaultFields, fieldIndex++)) mTooltipText = parcel.readCharSequence(); if (isBitSet(nonDefaultFields, fieldIndex++)) mViewIdResourceName = parcel.readString(); if (isBitSet(nonDefaultFields, fieldIndex++)) mUniqueId = parcel.readString(); if (isBitSet(nonDefaultFields, fieldIndex++)) mTextSelectionStart = parcel.readInt(); if (isBitSet(nonDefaultFields, fieldIndex++)) mTextSelectionEnd = parcel.readInt(); Loading Loading @@ -4480,6 +4510,7 @@ public class AccessibilityNodeInfo implements Parcelable { builder.append("; contentDescription: ").append(mContentDescription); builder.append("; tooltipText: ").append(mTooltipText); builder.append("; viewIdResName: ").append(mViewIdResourceName); builder.append("; uniqueId: ").append(mUniqueId); builder.append("; checkable: ").append(isCheckable()); builder.append("; checked: ").append(isChecked()); Loading
core/tests/coretests/src/android/view/accessibility/AccessibilityNodeInfoTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ public class AccessibilityNodeInfoTest { // The number of fields tested in the corresponding CTS AccessibilityNodeInfoTest: // See fullyPopulateAccessibilityNodeInfo, assertEqualsAccessibilityNodeInfo, // and assertAccessibilityNodeInfoCleared in that class. private static final int NUM_MARSHALLED_PROPERTIES = 39; private static final int NUM_MARSHALLED_PROPERTIES = 40; /** * The number of properties that are purposely not marshalled Loading