Loading api/current.txt +13 −13 Original line number Diff line number Diff line Loading @@ -25092,7 +25092,7 @@ package android.view.accessibility { method public static java.lang.String eventTypeToString(int); method public long getEventTime(); method public int getEventType(); method public int getGranularity(); method public int getMovementGranularity(); method public java.lang.CharSequence getPackageName(); method public android.view.accessibility.AccessibilityRecord getRecord(int); method public int getRecordCount(); Loading @@ -25102,7 +25102,7 @@ package android.view.accessibility { method public static android.view.accessibility.AccessibilityEvent obtain(); method public void setEventTime(long); method public void setEventType(int); method public void setGranularity(int); method public void setMovementGranularity(int); method public void setPackageName(java.lang.CharSequence); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator CREATOR; Loading @@ -25124,7 +25124,7 @@ package android.view.accessibility { field public static final int TYPE_VIEW_SELECTED = 4; // 0x4 field public static final int TYPE_VIEW_TEXT_CHANGED = 16; // 0x10 field public static final int TYPE_VIEW_TEXT_SELECTION_CHANGED = 8192; // 0x2000 field public static final int TYPE_VIEW_TEXT_TRAVERSED_AT_GRANULARITY = 131072; // 0x20000 field public static final int TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY = 131072; // 0x20000 field public static final int TYPE_WINDOW_CONTENT_CHANGED = 2048; // 0x800 field public static final int TYPE_WINDOW_STATE_CHANGED = 32; // 0x20 } Loading Loading @@ -25165,7 +25165,7 @@ package android.view.accessibility { method public int getChildCount(); method public java.lang.CharSequence getClassName(); method public java.lang.CharSequence getContentDescription(); method public int getGranularities(); method public int getMovementGranularities(); method public java.lang.CharSequence getPackageName(); method public android.view.accessibility.AccessibilityNodeInfo getParent(); method public java.lang.CharSequence getText(); Loading Loading @@ -25199,8 +25199,8 @@ package android.view.accessibility { method public void setEnabled(boolean); method public void setFocusable(boolean); method public void setFocused(boolean); method public void setGranularities(int); method public void setLongClickable(boolean); method public void setMovementGranularities(int); method public void setPackageName(java.lang.CharSequence); method public void setParent(android.view.View); method public void setParent(android.view.View, int); Loading @@ -25212,27 +25212,27 @@ package android.view.accessibility { method public void setText(java.lang.CharSequence); method public void writeToParcel(android.os.Parcel, int); field public static final int ACTION_ACCESSIBILITY_FOCUS = 64; // 0x40 field public static final java.lang.String ACTION_ARGUMENT_GRANULARITY_INT = "ACTION_ARGUMENT_GRANULARITY_INT"; field public static final java.lang.String ACTION_ARGUMENT_HTML_ELEMENT_STRING = "ACTION_ARGUMENT_HTML_ELEMENT_STRING"; field public static final java.lang.String ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT = "ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT"; field public static final int ACTION_CLEAR_ACCESSIBILITY_FOCUS = 128; // 0x80 field public static final int ACTION_CLEAR_FOCUS = 2; // 0x2 field public static final int ACTION_CLEAR_SELECTION = 8; // 0x8 field public static final int ACTION_CLICK = 16; // 0x10 field public static final int ACTION_FOCUS = 1; // 0x1 field public static final int ACTION_LONG_CLICK = 32; // 0x20 field public static final int ACTION_NEXT_AT_GRANULARITY = 256; // 0x100 field public static final int ACTION_NEXT_AT_MOVEMENT_GRANULARITY = 256; // 0x100 field public static final int ACTION_NEXT_HTML_ELEMENT = 1024; // 0x400 field public static final int ACTION_PREVIOUS_AT_GRANULARITY = 512; // 0x200 field public static final int ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY = 512; // 0x200 field public static final int ACTION_PREVIOUS_HTML_ELEMENT = 2048; // 0x800 field public static final int ACTION_SELECT = 4; // 0x4 field public static final android.os.Parcelable.Creator CREATOR; field public static final int FOCUS_ACCESSIBILITY = 2; // 0x2 field public static final int FOCUS_INPUT = 1; // 0x1 field public static final int GRANULARITY_CHARACTER = 1; // 0x1 field public static final int GRANULARITY_LINE = 4; // 0x4 field public static final int GRANULARITY_PAGE = 16; // 0x10 field public static final int GRANULARITY_PARAGRAPH = 8; // 0x8 field public static final int GRANULARITY_WORD = 2; // 0x2 field public static final int MOVEMENT_GRANULARITY_CHARACTER = 1; // 0x1 field public static final int MOVEMENT_GRANULARITY_LINE = 4; // 0x4 field public static final int MOVEMENT_GRANULARITY_PAGE = 16; // 0x10 field public static final int MOVEMENT_GRANULARITY_PARAGRAPH = 8; // 0x8 field public static final int MOVEMENT_GRANULARITY_WORD = 2; // 0x2 } public abstract class AccessibilityNodeProvider { core/java/android/view/View.java +4 −4 Original line number Diff line number Diff line Loading @@ -4715,10 +4715,10 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal } if (getContentDescription() != null) { info.addAction(AccessibilityNodeInfo.ACTION_NEXT_AT_GRANULARITY); info.addAction(AccessibilityNodeInfo.ACTION_PREVIOUS_AT_GRANULARITY); info.setGranularities(AccessibilityNodeInfo.GRANULARITY_CHARACTER | AccessibilityNodeInfo.GRANULARITY_WORD); info.addAction(AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY); info.addAction(AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY); info.setMovementGranularities(AccessibilityNodeInfo.MOVEMENT_GRANULARITY_CHARACTER | AccessibilityNodeInfo.MOVEMENT_GRANULARITY_WORD); } } Loading core/java/android/view/accessibility/AccessibilityEvent.java +22 −21 Original line number Diff line number Diff line Loading @@ -226,9 +226,9 @@ import java.util.List; * <li>{@link #getContentDescription()} - The content description of the source.</li> * </ul> * </p> * <b>View text traversed at granularity</b> - represents the event of traversing the * <b>View text traversed at movement granularity</b> - represents the event of traversing the * text of a view at a given granularity. For example, moving to the next word.</br> * <em>Type:</em> {@link #TYPE_VIEW_TEXT_TRAVERSED_AT_GRANULARITY} </br> * <em>Type:</em> {@link #TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY} </br> * <em>Properties:</em></br> * <ul> * <li>{@link #getEventType()} - The type of the event.</li> Loading @@ -236,11 +236,12 @@ import java.util.List; * <li>{@link #getClassName()} - The class name of the source.</li> * <li>{@link #getPackageName()} - The package name of the source.</li> * <li>{@link #getEventTime()} - The event time.</li> * <li>{@link #getText()} - The text of the current text at the granularity.</li> * <li>{@link #getText()} - The text of the current text at the movement granularity.</li> * <li>{@link #isPassword()} - Whether the source is password.</li> * <li>{@link #isEnabled()} - Whether the source is enabled.</li> * <li>{@link #getContentDescription()} - The content description of the source.</li> * <li>{@link #getGranularity()} - Sets the granularity at which a view's text was traversed.</li> * <li>{@link #getMovementGranularity()} - Sets the granularity at which a view's text * was traversed.</li> * </ul> * </p> * <p> Loading Loading @@ -597,9 +598,9 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par public static final int TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED = 0x00010000; /** * Represents the event of traversing the text of a view at a given granularity. * Represents the event of traversing the text of a view at a given movement granularity. */ public static final int TYPE_VIEW_TEXT_TRAVERSED_AT_GRANULARITY = 0x00020000; public static final int TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY = 0x00020000; /** * Mask for {@link AccessibilityEvent} all types. Loading @@ -619,7 +620,7 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par * @see #TYPE_VIEW_SCROLLED * @see #TYPE_VIEW_TEXT_SELECTION_CHANGED * @see #TYPE_ANNOUNCEMENT * @see #TYPE_VIEW_TEXT_TRAVERSED_AT_GRANULARITY * @see #TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY */ public static final int TYPES_ALL_MASK = 0xFFFFFFFF; Loading @@ -633,7 +634,7 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par private int mEventType; private CharSequence mPackageName; private long mEventTime; int mGranularity; int mMovementGranularity; private final ArrayList<AccessibilityRecord> mRecords = new ArrayList<AccessibilityRecord>(); Loading @@ -651,7 +652,7 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par void init(AccessibilityEvent event) { super.init(event); mEventType = event.mEventType; mGranularity = event.mGranularity; mMovementGranularity = event.mMovementGranularity; mEventTime = event.mEventTime; mPackageName = event.mPackageName; } Loading Loading @@ -769,24 +770,24 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par } /** * Sets the text granularity that was traversed. * Sets the movement granularity that was traversed. * * @param granularity The granularity. * * @throws IllegalStateException If called from an AccessibilityService. */ public void setGranularity(int granularity) { public void setMovementGranularity(int granularity) { enforceNotSealed(); mGranularity = granularity; mMovementGranularity = granularity; } /** * Gets the text granularity that was traversed. * Gets the movement granularity that was traversed. * * @return The granularity. */ public int getGranularity() { return mGranularity; public int getMovementGranularity() { return mMovementGranularity; } /** Loading Loading @@ -877,7 +878,7 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par protected void clear() { super.clear(); mEventType = 0; mGranularity = 0; mMovementGranularity = 0; mPackageName = null; mEventTime = 0; while (!mRecords.isEmpty()) { Loading @@ -894,7 +895,7 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par public void initFromParcel(Parcel parcel) { mSealed = (parcel.readInt() == 1); mEventType = parcel.readInt(); mGranularity = parcel.readInt(); mMovementGranularity = parcel.readInt(); mPackageName = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel); mEventTime = parcel.readLong(); mConnectionId = parcel.readInt(); Loading Loading @@ -945,7 +946,7 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par public void writeToParcel(Parcel parcel, int flags) { parcel.writeInt(isSealed() ? 1 : 0); parcel.writeInt(mEventType); parcel.writeInt(mGranularity); parcel.writeInt(mMovementGranularity); TextUtils.writeToParcel(mPackageName, parcel, 0); parcel.writeLong(mEventTime); parcel.writeInt(mConnectionId); Loading Loading @@ -1002,7 +1003,7 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par builder.append("EventType: ").append(eventTypeToString(mEventType)); builder.append("; EventTime: ").append(mEventTime); builder.append("; PackageName: ").append(mPackageName); builder.append("; Granularity: ").append(mGranularity); builder.append("; MovementGranularity: ").append(mMovementGranularity); builder.append(super.toString()); if (DEBUG) { builder.append("\n"); Loading Loading @@ -1083,8 +1084,8 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par return "TYPE_VIEW_ACCESSIBILITY_FOCUSED"; case TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED: return "TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED"; case TYPE_VIEW_TEXT_TRAVERSED_AT_GRANULARITY: return "TYPE_CURRENT_AT_GRANULARITY_CHANGED"; case TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY: return "TYPE_CURRENT_AT_GRANULARITY_MOVEMENT_CHANGED"; default: return null; } Loading core/java/android/view/accessibility/AccessibilityNodeInfo.java +77 −73 Original line number Diff line number Diff line Loading @@ -123,53 +123,56 @@ public class AccessibilityNodeInfo implements Parcelable { /** * Action that requests to go to the next entity in this node's text * at a given granularity. For example, move to the next character, word, etc. * at a given movement granularity. For example, move to the next character, * word, etc. * <p> * <strong>Arguments:</strong> {@link #ACTION_ARGUMENT_GRANULARITY_INT}<br> * <strong>Arguments:</strong> {@link #ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT}<br> * <strong>Example:</strong> * <code><pre><p> * Bundle arguments = new Bundle(); * arguments.putInt(AccessibilityNodeInfo.ACTION_ARGUMENT_GRANULARITY_INT, * AccessibilityNodeInfo.GRANULARITY_CHARACTER); * info.performAction(AccessibilityNodeInfo.ACTION_NEXT_AT_GRANULARITY, arguments); * arguments.putInt(AccessibilityNodeInfo.ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT, * AccessibilityNodeInfo.MOVEMENT_GRANULARITY_CHARACTER); * info.performAction(AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY, arguments); * </code></pre></p> * </p> * * @see #setGranularities(int) * @see #getGranularities() * @see #setMovementGranularities(int) * @see #getMovementGranularities() * * @see #GRANULARITY_CHARACTER * @see #GRANULARITY_WORD * @see #GRANULARITY_LINE * @see #GRANULARITY_PARAGRAPH * @see #GRANULARITY_PAGE * @see #MOVEMENT_GRANULARITY_CHARACTER * @see #MOVEMENT_GRANULARITY_WORD * @see #MOVEMENT_GRANULARITY_LINE * @see #MOVEMENT_GRANULARITY_PARAGRAPH * @see #MOVEMENT_GRANULARITY_PAGE */ public static final int ACTION_NEXT_AT_GRANULARITY = 0x00000100; public static final int ACTION_NEXT_AT_MOVEMENT_GRANULARITY = 0x00000100; /** * Action that requests to go to the previous entity in this node's text * at a given granularity. For example, move to the next character, word, etc. * at a given movement granularity. For example, move to the next character, * word, etc. * <p> * <strong>Arguments:</strong> {@link #ACTION_ARGUMENT_GRANULARITY_INT}<br> * <strong>Arguments:</strong> {@link #ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT}<br> * <strong>Example:</strong> * <code><pre><p> * Bundle arguments = new Bundle(); * arguments.putInt(AccessibilityNodeInfo.ACTION_ARGUMENT_GRANULARITY_INT, * AccessibilityNodeInfo.GRANULARITY_CHARACTER); * info.performAction(AccessibilityNodeInfo.ACTION_PREVIOUS_AT_GRANULARITY, arguments); * arguments.putInt(AccessibilityNodeInfo.ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT, * AccessibilityNodeInfo.MOVEMENT_GRANULARITY_CHARACTER); * info.performAction(AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY, * arguments); * </code></pre></p> * </p> * * @see #setGranularities(int) * @see #getGranularities() * @see #setMovementGranularities(int) * @see #getMovementGranularities() * * @see #GRANULARITY_CHARACTER * @see #GRANULARITY_WORD * @see #GRANULARITY_LINE * @see #GRANULARITY_PARAGRAPH * @see #GRANULARITY_PAGE * @see #MOVEMENT_GRANULARITY_CHARACTER * @see #MOVEMENT_GRANULARITY_WORD * @see #MOVEMENT_GRANULARITY_LINE * @see #MOVEMENT_GRANULARITY_PARAGRAPH * @see #MOVEMENT_GRANULARITY_PAGE */ public static final int ACTION_PREVIOUS_AT_GRANULARITY = 0x00000200; public static final int ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY = 0x00000200; /** * Action to move to the next HTML element of a given type. For example, move Loading Loading @@ -202,14 +205,15 @@ public class AccessibilityNodeInfo implements Parcelable { public static final int ACTION_PREVIOUS_HTML_ELEMENT = 0x00000800; /** * Argument for which text granularity to be used when traversing the node text. * Argument for which movement granularity to be used when traversing the node text. * <p> * <strong>Type:</strong> int<br> * <strong>Actions:</strong> {@link #ACTION_NEXT_AT_GRANULARITY}, * {@link #ACTION_PREVIOUS_AT_GRANULARITY} * <strong>Actions:</strong> {@link #ACTION_NEXT_AT_MOVEMENT_GRANULARITY}, * {@link #ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY} * </p> */ public static final String ACTION_ARGUMENT_GRANULARITY_INT = "ACTION_ARGUMENT_GRANULARITY_INT"; public static final String ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT = "ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT"; /** * Argument for which HTML element to get moving to the next/previous HTML element. Loading @@ -232,32 +236,32 @@ public class AccessibilityNodeInfo implements Parcelable { */ public static final int FOCUS_ACCESSIBILITY = 2; // Granularities // Movement granularities /** * Granularity bit for traversing the text of a node by character. * Movement granularity bit for traversing the text of a node by character. */ public static final int GRANULARITY_CHARACTER = 0x00000001; public static final int MOVEMENT_GRANULARITY_CHARACTER = 0x00000001; /** * Granularity bit for traversing the text of a node by word. * Movement granularity bit for traversing the text of a node by word. */ public static final int GRANULARITY_WORD = 0x00000002; public static final int MOVEMENT_GRANULARITY_WORD = 0x00000002; /** * Granularity bit for traversing the text of a node by line. * Movement granularity bit for traversing the text of a node by line. */ public static final int GRANULARITY_LINE = 0x00000004; public static final int MOVEMENT_GRANULARITY_LINE = 0x00000004; /** * Granularity bit for traversing the text of a node by paragraph. * Movement granularity bit for traversing the text of a node by paragraph. */ public static final int GRANULARITY_PARAGRAPH = 0x00000008; public static final int MOVEMENT_GRANULARITY_PARAGRAPH = 0x00000008; /** * Granularity bit for traversing the text of a node by page. * Movement granularity bit for traversing the text of a node by page. */ public static final int GRANULARITY_PAGE = 0x00000010; public static final int MOVEMENT_GRANULARITY_PAGE = 0x00000010; // Boolean attributes. Loading Loading @@ -362,7 +366,7 @@ public class AccessibilityNodeInfo implements Parcelable { private final SparseLongArray mChildNodeIds = new SparseLongArray(); private int mActions; private int mGranularities; private int mMovementGranularities; private int mConnectionId = UNDEFINED; Loading Loading @@ -586,7 +590,7 @@ public class AccessibilityNodeInfo implements Parcelable { } /** * Sets the text granularities for traversing the text of this node. * Sets the movement granularities for traversing the text of this node. * <p> * <strong>Note:</strong> Cannot be called from an * {@link android.accessibilityservice.AccessibilityService}. Loading @@ -597,18 +601,18 @@ public class AccessibilityNodeInfo implements Parcelable { * * @throws IllegalStateException If called from an AccessibilityService. */ public void setGranularities(int granularities) { public void setMovementGranularities(int granularities) { enforceNotSealed(); mGranularities = granularities; mMovementGranularities = granularities; } /** * Gets the granularities for traversing the text of this node. * Gets the movement granularities for traversing the text of this node. * * @return The bit mask with granularities. */ public int getGranularities() { return mGranularities; public int getMovementGranularities() { return mMovementGranularities; } /** Loading Loading @@ -1412,7 +1416,7 @@ public class AccessibilityNodeInfo implements Parcelable { parcel.writeInt(mActions); parcel.writeInt(mGranularities); parcel.writeInt(mMovementGranularities); parcel.writeInt(mBooleanProperties); Loading Loading @@ -1446,7 +1450,7 @@ public class AccessibilityNodeInfo implements Parcelable { mContentDescription = other.mContentDescription; mActions= other.mActions; mBooleanProperties = other.mBooleanProperties; mGranularities = other.mGranularities; mMovementGranularities = other.mMovementGranularities; final int otherChildIdCount = other.mChildNodeIds.size(); for (int i = 0; i < otherChildIdCount; i++) { mChildNodeIds.put(i, other.mChildNodeIds.valueAt(i)); Loading Loading @@ -1484,7 +1488,7 @@ public class AccessibilityNodeInfo implements Parcelable { mActions = parcel.readInt(); mGranularities = parcel.readInt(); mMovementGranularities = parcel.readInt(); mBooleanProperties = parcel.readInt(); Loading @@ -1503,7 +1507,7 @@ public class AccessibilityNodeInfo implements Parcelable { mParentNodeId = ROOT_NODE_ID; mWindowId = UNDEFINED; mConnectionId = UNDEFINED; mGranularities = 0; mMovementGranularities = 0; mChildNodeIds.clear(); mBoundsInParent.set(0, 0, 0, 0); mBoundsInScreen.set(0, 0, 0, 0); Loading Loading @@ -1539,10 +1543,10 @@ public class AccessibilityNodeInfo implements Parcelable { return "ACTION_ACCESSIBILITY_FOCUS"; case ACTION_CLEAR_ACCESSIBILITY_FOCUS: return "ACTION_CLEAR_ACCESSIBILITY_FOCUS"; case ACTION_NEXT_AT_GRANULARITY: return "ACTION_NEXT_AT_GRANULARITY"; case ACTION_PREVIOUS_AT_GRANULARITY: return "ACTION_PREVIOUS_AT_GRANULARITY"; 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: Loading @@ -1553,25 +1557,25 @@ public class AccessibilityNodeInfo implements Parcelable { } /** * Gets the human readable granularity symbolic name. * Gets the human readable movement granularity symbolic name. * * @param granularity The action. * @param granularity The granularity. * @return The symbolic name. */ private static String getGranularitySymbolicName(int granularity) { private static String getMovementGranularitySymbolicName(int granularity) { switch (granularity) { case GRANULARITY_CHARACTER: return "GRANULARITY_CHARACTER"; case GRANULARITY_WORD: return "GRANULARITY_WORD"; case GRANULARITY_LINE: return "GRANULARITY_LINE"; case GRANULARITY_PARAGRAPH: return "GRANULARITY_PARAGRAPH"; case GRANULARITY_PAGE: return "GRANULARITY_PAGE"; 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 granularity: " + granularity); throw new IllegalArgumentException("Unknown movement granularity: " + granularity); } } Loading Loading @@ -1622,12 +1626,12 @@ public class AccessibilityNodeInfo implements Parcelable { builder.append("; virtualDescendantId: " + getVirtualDescendantId(mSourceNodeId)); builder.append("; mParentNodeId: " + mParentNodeId); int granularities = mGranularities; builder.append("; granularities: ["); int granularities = mMovementGranularities; builder.append("; MovementGranularities: ["); while (granularities != 0) { final int granularity = 1 << Integer.numberOfTrailingZeros(granularities); granularities &= ~granularity; builder.append(getGranularitySymbolicName(granularity)); builder.append(getMovementGranularitySymbolicName(granularity)); if (granularities != 0) { builder.append(", "); } Loading services/java/com/android/server/accessibility/AccessibilityManagerService.java +7 −7 Original line number Diff line number Diff line Loading @@ -1701,17 +1701,17 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub | AccessibilityNodeInfo.ACTION_CLEAR_SELECTION | AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS | AccessibilityNodeInfo.ACTION_CLEAR_ACCESSIBILITY_FOCUS | AccessibilityNodeInfo.ACTION_NEXT_AT_GRANULARITY | AccessibilityNodeInfo.ACTION_PREVIOUS_AT_GRANULARITY | AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY | AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY | AccessibilityNodeInfo.ACTION_NEXT_HTML_ELEMENT | AccessibilityNodeInfo.ACTION_PREVIOUS_HTML_ELEMENT; private static final int VALID_GRANULARITIES = AccessibilityNodeInfo.GRANULARITY_CHARACTER | AccessibilityNodeInfo.GRANULARITY_WORD | AccessibilityNodeInfo.GRANULARITY_LINE | AccessibilityNodeInfo.GRANULARITY_PARAGRAPH | AccessibilityNodeInfo.GRANULARITY_PAGE; AccessibilityNodeInfo.MOVEMENT_GRANULARITY_CHARACTER | AccessibilityNodeInfo.MOVEMENT_GRANULARITY_WORD | AccessibilityNodeInfo.MOVEMENT_GRANULARITY_LINE | AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PARAGRAPH | AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE; private static final int RETRIEVAL_ALLOWING_EVENT_TYPES = AccessibilityEvent.TYPE_VIEW_CLICKED Loading Loading
api/current.txt +13 −13 Original line number Diff line number Diff line Loading @@ -25092,7 +25092,7 @@ package android.view.accessibility { method public static java.lang.String eventTypeToString(int); method public long getEventTime(); method public int getEventType(); method public int getGranularity(); method public int getMovementGranularity(); method public java.lang.CharSequence getPackageName(); method public android.view.accessibility.AccessibilityRecord getRecord(int); method public int getRecordCount(); Loading @@ -25102,7 +25102,7 @@ package android.view.accessibility { method public static android.view.accessibility.AccessibilityEvent obtain(); method public void setEventTime(long); method public void setEventType(int); method public void setGranularity(int); method public void setMovementGranularity(int); method public void setPackageName(java.lang.CharSequence); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator CREATOR; Loading @@ -25124,7 +25124,7 @@ package android.view.accessibility { field public static final int TYPE_VIEW_SELECTED = 4; // 0x4 field public static final int TYPE_VIEW_TEXT_CHANGED = 16; // 0x10 field public static final int TYPE_VIEW_TEXT_SELECTION_CHANGED = 8192; // 0x2000 field public static final int TYPE_VIEW_TEXT_TRAVERSED_AT_GRANULARITY = 131072; // 0x20000 field public static final int TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY = 131072; // 0x20000 field public static final int TYPE_WINDOW_CONTENT_CHANGED = 2048; // 0x800 field public static final int TYPE_WINDOW_STATE_CHANGED = 32; // 0x20 } Loading Loading @@ -25165,7 +25165,7 @@ package android.view.accessibility { method public int getChildCount(); method public java.lang.CharSequence getClassName(); method public java.lang.CharSequence getContentDescription(); method public int getGranularities(); method public int getMovementGranularities(); method public java.lang.CharSequence getPackageName(); method public android.view.accessibility.AccessibilityNodeInfo getParent(); method public java.lang.CharSequence getText(); Loading Loading @@ -25199,8 +25199,8 @@ package android.view.accessibility { method public void setEnabled(boolean); method public void setFocusable(boolean); method public void setFocused(boolean); method public void setGranularities(int); method public void setLongClickable(boolean); method public void setMovementGranularities(int); method public void setPackageName(java.lang.CharSequence); method public void setParent(android.view.View); method public void setParent(android.view.View, int); Loading @@ -25212,27 +25212,27 @@ package android.view.accessibility { method public void setText(java.lang.CharSequence); method public void writeToParcel(android.os.Parcel, int); field public static final int ACTION_ACCESSIBILITY_FOCUS = 64; // 0x40 field public static final java.lang.String ACTION_ARGUMENT_GRANULARITY_INT = "ACTION_ARGUMENT_GRANULARITY_INT"; field public static final java.lang.String ACTION_ARGUMENT_HTML_ELEMENT_STRING = "ACTION_ARGUMENT_HTML_ELEMENT_STRING"; field public static final java.lang.String ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT = "ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT"; field public static final int ACTION_CLEAR_ACCESSIBILITY_FOCUS = 128; // 0x80 field public static final int ACTION_CLEAR_FOCUS = 2; // 0x2 field public static final int ACTION_CLEAR_SELECTION = 8; // 0x8 field public static final int ACTION_CLICK = 16; // 0x10 field public static final int ACTION_FOCUS = 1; // 0x1 field public static final int ACTION_LONG_CLICK = 32; // 0x20 field public static final int ACTION_NEXT_AT_GRANULARITY = 256; // 0x100 field public static final int ACTION_NEXT_AT_MOVEMENT_GRANULARITY = 256; // 0x100 field public static final int ACTION_NEXT_HTML_ELEMENT = 1024; // 0x400 field public static final int ACTION_PREVIOUS_AT_GRANULARITY = 512; // 0x200 field public static final int ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY = 512; // 0x200 field public static final int ACTION_PREVIOUS_HTML_ELEMENT = 2048; // 0x800 field public static final int ACTION_SELECT = 4; // 0x4 field public static final android.os.Parcelable.Creator CREATOR; field public static final int FOCUS_ACCESSIBILITY = 2; // 0x2 field public static final int FOCUS_INPUT = 1; // 0x1 field public static final int GRANULARITY_CHARACTER = 1; // 0x1 field public static final int GRANULARITY_LINE = 4; // 0x4 field public static final int GRANULARITY_PAGE = 16; // 0x10 field public static final int GRANULARITY_PARAGRAPH = 8; // 0x8 field public static final int GRANULARITY_WORD = 2; // 0x2 field public static final int MOVEMENT_GRANULARITY_CHARACTER = 1; // 0x1 field public static final int MOVEMENT_GRANULARITY_LINE = 4; // 0x4 field public static final int MOVEMENT_GRANULARITY_PAGE = 16; // 0x10 field public static final int MOVEMENT_GRANULARITY_PARAGRAPH = 8; // 0x8 field public static final int MOVEMENT_GRANULARITY_WORD = 2; // 0x2 } public abstract class AccessibilityNodeProvider {
core/java/android/view/View.java +4 −4 Original line number Diff line number Diff line Loading @@ -4715,10 +4715,10 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal } if (getContentDescription() != null) { info.addAction(AccessibilityNodeInfo.ACTION_NEXT_AT_GRANULARITY); info.addAction(AccessibilityNodeInfo.ACTION_PREVIOUS_AT_GRANULARITY); info.setGranularities(AccessibilityNodeInfo.GRANULARITY_CHARACTER | AccessibilityNodeInfo.GRANULARITY_WORD); info.addAction(AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY); info.addAction(AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY); info.setMovementGranularities(AccessibilityNodeInfo.MOVEMENT_GRANULARITY_CHARACTER | AccessibilityNodeInfo.MOVEMENT_GRANULARITY_WORD); } } Loading
core/java/android/view/accessibility/AccessibilityEvent.java +22 −21 Original line number Diff line number Diff line Loading @@ -226,9 +226,9 @@ import java.util.List; * <li>{@link #getContentDescription()} - The content description of the source.</li> * </ul> * </p> * <b>View text traversed at granularity</b> - represents the event of traversing the * <b>View text traversed at movement granularity</b> - represents the event of traversing the * text of a view at a given granularity. For example, moving to the next word.</br> * <em>Type:</em> {@link #TYPE_VIEW_TEXT_TRAVERSED_AT_GRANULARITY} </br> * <em>Type:</em> {@link #TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY} </br> * <em>Properties:</em></br> * <ul> * <li>{@link #getEventType()} - The type of the event.</li> Loading @@ -236,11 +236,12 @@ import java.util.List; * <li>{@link #getClassName()} - The class name of the source.</li> * <li>{@link #getPackageName()} - The package name of the source.</li> * <li>{@link #getEventTime()} - The event time.</li> * <li>{@link #getText()} - The text of the current text at the granularity.</li> * <li>{@link #getText()} - The text of the current text at the movement granularity.</li> * <li>{@link #isPassword()} - Whether the source is password.</li> * <li>{@link #isEnabled()} - Whether the source is enabled.</li> * <li>{@link #getContentDescription()} - The content description of the source.</li> * <li>{@link #getGranularity()} - Sets the granularity at which a view's text was traversed.</li> * <li>{@link #getMovementGranularity()} - Sets the granularity at which a view's text * was traversed.</li> * </ul> * </p> * <p> Loading Loading @@ -597,9 +598,9 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par public static final int TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED = 0x00010000; /** * Represents the event of traversing the text of a view at a given granularity. * Represents the event of traversing the text of a view at a given movement granularity. */ public static final int TYPE_VIEW_TEXT_TRAVERSED_AT_GRANULARITY = 0x00020000; public static final int TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY = 0x00020000; /** * Mask for {@link AccessibilityEvent} all types. Loading @@ -619,7 +620,7 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par * @see #TYPE_VIEW_SCROLLED * @see #TYPE_VIEW_TEXT_SELECTION_CHANGED * @see #TYPE_ANNOUNCEMENT * @see #TYPE_VIEW_TEXT_TRAVERSED_AT_GRANULARITY * @see #TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY */ public static final int TYPES_ALL_MASK = 0xFFFFFFFF; Loading @@ -633,7 +634,7 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par private int mEventType; private CharSequence mPackageName; private long mEventTime; int mGranularity; int mMovementGranularity; private final ArrayList<AccessibilityRecord> mRecords = new ArrayList<AccessibilityRecord>(); Loading @@ -651,7 +652,7 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par void init(AccessibilityEvent event) { super.init(event); mEventType = event.mEventType; mGranularity = event.mGranularity; mMovementGranularity = event.mMovementGranularity; mEventTime = event.mEventTime; mPackageName = event.mPackageName; } Loading Loading @@ -769,24 +770,24 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par } /** * Sets the text granularity that was traversed. * Sets the movement granularity that was traversed. * * @param granularity The granularity. * * @throws IllegalStateException If called from an AccessibilityService. */ public void setGranularity(int granularity) { public void setMovementGranularity(int granularity) { enforceNotSealed(); mGranularity = granularity; mMovementGranularity = granularity; } /** * Gets the text granularity that was traversed. * Gets the movement granularity that was traversed. * * @return The granularity. */ public int getGranularity() { return mGranularity; public int getMovementGranularity() { return mMovementGranularity; } /** Loading Loading @@ -877,7 +878,7 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par protected void clear() { super.clear(); mEventType = 0; mGranularity = 0; mMovementGranularity = 0; mPackageName = null; mEventTime = 0; while (!mRecords.isEmpty()) { Loading @@ -894,7 +895,7 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par public void initFromParcel(Parcel parcel) { mSealed = (parcel.readInt() == 1); mEventType = parcel.readInt(); mGranularity = parcel.readInt(); mMovementGranularity = parcel.readInt(); mPackageName = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel); mEventTime = parcel.readLong(); mConnectionId = parcel.readInt(); Loading Loading @@ -945,7 +946,7 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par public void writeToParcel(Parcel parcel, int flags) { parcel.writeInt(isSealed() ? 1 : 0); parcel.writeInt(mEventType); parcel.writeInt(mGranularity); parcel.writeInt(mMovementGranularity); TextUtils.writeToParcel(mPackageName, parcel, 0); parcel.writeLong(mEventTime); parcel.writeInt(mConnectionId); Loading Loading @@ -1002,7 +1003,7 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par builder.append("EventType: ").append(eventTypeToString(mEventType)); builder.append("; EventTime: ").append(mEventTime); builder.append("; PackageName: ").append(mPackageName); builder.append("; Granularity: ").append(mGranularity); builder.append("; MovementGranularity: ").append(mMovementGranularity); builder.append(super.toString()); if (DEBUG) { builder.append("\n"); Loading Loading @@ -1083,8 +1084,8 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par return "TYPE_VIEW_ACCESSIBILITY_FOCUSED"; case TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED: return "TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED"; case TYPE_VIEW_TEXT_TRAVERSED_AT_GRANULARITY: return "TYPE_CURRENT_AT_GRANULARITY_CHANGED"; case TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY: return "TYPE_CURRENT_AT_GRANULARITY_MOVEMENT_CHANGED"; default: return null; } Loading
core/java/android/view/accessibility/AccessibilityNodeInfo.java +77 −73 Original line number Diff line number Diff line Loading @@ -123,53 +123,56 @@ public class AccessibilityNodeInfo implements Parcelable { /** * Action that requests to go to the next entity in this node's text * at a given granularity. For example, move to the next character, word, etc. * at a given movement granularity. For example, move to the next character, * word, etc. * <p> * <strong>Arguments:</strong> {@link #ACTION_ARGUMENT_GRANULARITY_INT}<br> * <strong>Arguments:</strong> {@link #ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT}<br> * <strong>Example:</strong> * <code><pre><p> * Bundle arguments = new Bundle(); * arguments.putInt(AccessibilityNodeInfo.ACTION_ARGUMENT_GRANULARITY_INT, * AccessibilityNodeInfo.GRANULARITY_CHARACTER); * info.performAction(AccessibilityNodeInfo.ACTION_NEXT_AT_GRANULARITY, arguments); * arguments.putInt(AccessibilityNodeInfo.ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT, * AccessibilityNodeInfo.MOVEMENT_GRANULARITY_CHARACTER); * info.performAction(AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY, arguments); * </code></pre></p> * </p> * * @see #setGranularities(int) * @see #getGranularities() * @see #setMovementGranularities(int) * @see #getMovementGranularities() * * @see #GRANULARITY_CHARACTER * @see #GRANULARITY_WORD * @see #GRANULARITY_LINE * @see #GRANULARITY_PARAGRAPH * @see #GRANULARITY_PAGE * @see #MOVEMENT_GRANULARITY_CHARACTER * @see #MOVEMENT_GRANULARITY_WORD * @see #MOVEMENT_GRANULARITY_LINE * @see #MOVEMENT_GRANULARITY_PARAGRAPH * @see #MOVEMENT_GRANULARITY_PAGE */ public static final int ACTION_NEXT_AT_GRANULARITY = 0x00000100; public static final int ACTION_NEXT_AT_MOVEMENT_GRANULARITY = 0x00000100; /** * Action that requests to go to the previous entity in this node's text * at a given granularity. For example, move to the next character, word, etc. * at a given movement granularity. For example, move to the next character, * word, etc. * <p> * <strong>Arguments:</strong> {@link #ACTION_ARGUMENT_GRANULARITY_INT}<br> * <strong>Arguments:</strong> {@link #ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT}<br> * <strong>Example:</strong> * <code><pre><p> * Bundle arguments = new Bundle(); * arguments.putInt(AccessibilityNodeInfo.ACTION_ARGUMENT_GRANULARITY_INT, * AccessibilityNodeInfo.GRANULARITY_CHARACTER); * info.performAction(AccessibilityNodeInfo.ACTION_PREVIOUS_AT_GRANULARITY, arguments); * arguments.putInt(AccessibilityNodeInfo.ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT, * AccessibilityNodeInfo.MOVEMENT_GRANULARITY_CHARACTER); * info.performAction(AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY, * arguments); * </code></pre></p> * </p> * * @see #setGranularities(int) * @see #getGranularities() * @see #setMovementGranularities(int) * @see #getMovementGranularities() * * @see #GRANULARITY_CHARACTER * @see #GRANULARITY_WORD * @see #GRANULARITY_LINE * @see #GRANULARITY_PARAGRAPH * @see #GRANULARITY_PAGE * @see #MOVEMENT_GRANULARITY_CHARACTER * @see #MOVEMENT_GRANULARITY_WORD * @see #MOVEMENT_GRANULARITY_LINE * @see #MOVEMENT_GRANULARITY_PARAGRAPH * @see #MOVEMENT_GRANULARITY_PAGE */ public static final int ACTION_PREVIOUS_AT_GRANULARITY = 0x00000200; public static final int ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY = 0x00000200; /** * Action to move to the next HTML element of a given type. For example, move Loading Loading @@ -202,14 +205,15 @@ public class AccessibilityNodeInfo implements Parcelable { public static final int ACTION_PREVIOUS_HTML_ELEMENT = 0x00000800; /** * Argument for which text granularity to be used when traversing the node text. * Argument for which movement granularity to be used when traversing the node text. * <p> * <strong>Type:</strong> int<br> * <strong>Actions:</strong> {@link #ACTION_NEXT_AT_GRANULARITY}, * {@link #ACTION_PREVIOUS_AT_GRANULARITY} * <strong>Actions:</strong> {@link #ACTION_NEXT_AT_MOVEMENT_GRANULARITY}, * {@link #ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY} * </p> */ public static final String ACTION_ARGUMENT_GRANULARITY_INT = "ACTION_ARGUMENT_GRANULARITY_INT"; public static final String ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT = "ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT"; /** * Argument for which HTML element to get moving to the next/previous HTML element. Loading @@ -232,32 +236,32 @@ public class AccessibilityNodeInfo implements Parcelable { */ public static final int FOCUS_ACCESSIBILITY = 2; // Granularities // Movement granularities /** * Granularity bit for traversing the text of a node by character. * Movement granularity bit for traversing the text of a node by character. */ public static final int GRANULARITY_CHARACTER = 0x00000001; public static final int MOVEMENT_GRANULARITY_CHARACTER = 0x00000001; /** * Granularity bit for traversing the text of a node by word. * Movement granularity bit for traversing the text of a node by word. */ public static final int GRANULARITY_WORD = 0x00000002; public static final int MOVEMENT_GRANULARITY_WORD = 0x00000002; /** * Granularity bit for traversing the text of a node by line. * Movement granularity bit for traversing the text of a node by line. */ public static final int GRANULARITY_LINE = 0x00000004; public static final int MOVEMENT_GRANULARITY_LINE = 0x00000004; /** * Granularity bit for traversing the text of a node by paragraph. * Movement granularity bit for traversing the text of a node by paragraph. */ public static final int GRANULARITY_PARAGRAPH = 0x00000008; public static final int MOVEMENT_GRANULARITY_PARAGRAPH = 0x00000008; /** * Granularity bit for traversing the text of a node by page. * Movement granularity bit for traversing the text of a node by page. */ public static final int GRANULARITY_PAGE = 0x00000010; public static final int MOVEMENT_GRANULARITY_PAGE = 0x00000010; // Boolean attributes. Loading Loading @@ -362,7 +366,7 @@ public class AccessibilityNodeInfo implements Parcelable { private final SparseLongArray mChildNodeIds = new SparseLongArray(); private int mActions; private int mGranularities; private int mMovementGranularities; private int mConnectionId = UNDEFINED; Loading Loading @@ -586,7 +590,7 @@ public class AccessibilityNodeInfo implements Parcelable { } /** * Sets the text granularities for traversing the text of this node. * Sets the movement granularities for traversing the text of this node. * <p> * <strong>Note:</strong> Cannot be called from an * {@link android.accessibilityservice.AccessibilityService}. Loading @@ -597,18 +601,18 @@ public class AccessibilityNodeInfo implements Parcelable { * * @throws IllegalStateException If called from an AccessibilityService. */ public void setGranularities(int granularities) { public void setMovementGranularities(int granularities) { enforceNotSealed(); mGranularities = granularities; mMovementGranularities = granularities; } /** * Gets the granularities for traversing the text of this node. * Gets the movement granularities for traversing the text of this node. * * @return The bit mask with granularities. */ public int getGranularities() { return mGranularities; public int getMovementGranularities() { return mMovementGranularities; } /** Loading Loading @@ -1412,7 +1416,7 @@ public class AccessibilityNodeInfo implements Parcelable { parcel.writeInt(mActions); parcel.writeInt(mGranularities); parcel.writeInt(mMovementGranularities); parcel.writeInt(mBooleanProperties); Loading Loading @@ -1446,7 +1450,7 @@ public class AccessibilityNodeInfo implements Parcelable { mContentDescription = other.mContentDescription; mActions= other.mActions; mBooleanProperties = other.mBooleanProperties; mGranularities = other.mGranularities; mMovementGranularities = other.mMovementGranularities; final int otherChildIdCount = other.mChildNodeIds.size(); for (int i = 0; i < otherChildIdCount; i++) { mChildNodeIds.put(i, other.mChildNodeIds.valueAt(i)); Loading Loading @@ -1484,7 +1488,7 @@ public class AccessibilityNodeInfo implements Parcelable { mActions = parcel.readInt(); mGranularities = parcel.readInt(); mMovementGranularities = parcel.readInt(); mBooleanProperties = parcel.readInt(); Loading @@ -1503,7 +1507,7 @@ public class AccessibilityNodeInfo implements Parcelable { mParentNodeId = ROOT_NODE_ID; mWindowId = UNDEFINED; mConnectionId = UNDEFINED; mGranularities = 0; mMovementGranularities = 0; mChildNodeIds.clear(); mBoundsInParent.set(0, 0, 0, 0); mBoundsInScreen.set(0, 0, 0, 0); Loading Loading @@ -1539,10 +1543,10 @@ public class AccessibilityNodeInfo implements Parcelable { return "ACTION_ACCESSIBILITY_FOCUS"; case ACTION_CLEAR_ACCESSIBILITY_FOCUS: return "ACTION_CLEAR_ACCESSIBILITY_FOCUS"; case ACTION_NEXT_AT_GRANULARITY: return "ACTION_NEXT_AT_GRANULARITY"; case ACTION_PREVIOUS_AT_GRANULARITY: return "ACTION_PREVIOUS_AT_GRANULARITY"; 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: Loading @@ -1553,25 +1557,25 @@ public class AccessibilityNodeInfo implements Parcelable { } /** * Gets the human readable granularity symbolic name. * Gets the human readable movement granularity symbolic name. * * @param granularity The action. * @param granularity The granularity. * @return The symbolic name. */ private static String getGranularitySymbolicName(int granularity) { private static String getMovementGranularitySymbolicName(int granularity) { switch (granularity) { case GRANULARITY_CHARACTER: return "GRANULARITY_CHARACTER"; case GRANULARITY_WORD: return "GRANULARITY_WORD"; case GRANULARITY_LINE: return "GRANULARITY_LINE"; case GRANULARITY_PARAGRAPH: return "GRANULARITY_PARAGRAPH"; case GRANULARITY_PAGE: return "GRANULARITY_PAGE"; 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 granularity: " + granularity); throw new IllegalArgumentException("Unknown movement granularity: " + granularity); } } Loading Loading @@ -1622,12 +1626,12 @@ public class AccessibilityNodeInfo implements Parcelable { builder.append("; virtualDescendantId: " + getVirtualDescendantId(mSourceNodeId)); builder.append("; mParentNodeId: " + mParentNodeId); int granularities = mGranularities; builder.append("; granularities: ["); int granularities = mMovementGranularities; builder.append("; MovementGranularities: ["); while (granularities != 0) { final int granularity = 1 << Integer.numberOfTrailingZeros(granularities); granularities &= ~granularity; builder.append(getGranularitySymbolicName(granularity)); builder.append(getMovementGranularitySymbolicName(granularity)); if (granularities != 0) { builder.append(", "); } Loading
services/java/com/android/server/accessibility/AccessibilityManagerService.java +7 −7 Original line number Diff line number Diff line Loading @@ -1701,17 +1701,17 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub | AccessibilityNodeInfo.ACTION_CLEAR_SELECTION | AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS | AccessibilityNodeInfo.ACTION_CLEAR_ACCESSIBILITY_FOCUS | AccessibilityNodeInfo.ACTION_NEXT_AT_GRANULARITY | AccessibilityNodeInfo.ACTION_PREVIOUS_AT_GRANULARITY | AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY | AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY | AccessibilityNodeInfo.ACTION_NEXT_HTML_ELEMENT | AccessibilityNodeInfo.ACTION_PREVIOUS_HTML_ELEMENT; private static final int VALID_GRANULARITIES = AccessibilityNodeInfo.GRANULARITY_CHARACTER | AccessibilityNodeInfo.GRANULARITY_WORD | AccessibilityNodeInfo.GRANULARITY_LINE | AccessibilityNodeInfo.GRANULARITY_PARAGRAPH | AccessibilityNodeInfo.GRANULARITY_PAGE; AccessibilityNodeInfo.MOVEMENT_GRANULARITY_CHARACTER | AccessibilityNodeInfo.MOVEMENT_GRANULARITY_WORD | AccessibilityNodeInfo.MOVEMENT_GRANULARITY_LINE | AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PARAGRAPH | AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE; private static final int RETRIEVAL_ALLOWING_EVENT_TYPES = AccessibilityEvent.TYPE_VIEW_CLICKED Loading