Loading core/api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -54144,6 +54144,7 @@ package android.view.accessibility { method public android.view.accessibility.AccessibilityWindowInfo getWindow(); method public int getWindowId(); method public boolean hasRequestInitialAccessibilityFocus(); method public boolean hasRequestTouchPassthrough(); method public boolean isAccessibilityFocused(); method public boolean isCheckable(); method public boolean isChecked(); Loading Loading @@ -54225,6 +54226,7 @@ package android.view.accessibility { method public void setQueryFromAppProcessEnabled(@NonNull android.view.View, boolean); method public void setRangeInfo(android.view.accessibility.AccessibilityNodeInfo.RangeInfo); method public void setRequestInitialAccessibilityFocus(boolean); method public void setRequestTouchPassthrough(boolean); method public void setScreenReaderFocusable(boolean); method public void setScrollable(boolean); method public void setSelected(boolean); core/java/android/view/accessibility/AccessibilityNodeInfo.java +49 −0 Original line number Diff line number Diff line Loading @@ -832,6 +832,8 @@ public class AccessibilityNodeInfo implements Parcelable { private static final int BOOLEAN_PROPERTY_REQUEST_INITIAL_ACCESSIBILITY_FOCUS = 1 << 24; private static final int BOOLEAN_PROPERTY_REQUEST_TOUCH_PASSTHROUGH = 1 << 25; /** * Bits that provide the id of a virtual descendant of a view. */ Loading Loading @@ -2594,6 +2596,53 @@ public class AccessibilityNodeInfo implements Parcelable { setBooleanProperty(BOOLEAN_PROPERTY_EDITABLE, editable); } /** * Gets whether this node is one of the candidates that wants touch interaction within its * screen bounds to bypass the touch exploration and go straight to the underlying view * hierarchy. * * <p> * {@link android.accessibilityservice.AccessibilityService} could aggregate the {@link * #getBoundsInScreen()} that has request touch passthrough, and/or doing complex calculation * with other views that doesn't request touch passthrough, and call {@link * AccessibilityService#setTouchExplorationPassthroughRegion(int, Region)} to bypass the touch * interactions to the underlying views within the region. * </p> * * @return True if the node wants touch interaction within its screen bounds to bypass touch * exploration and go straight to the underlying view hierarchy; false otherwise. */ public boolean hasRequestTouchPassthrough() { return getBooleanProperty(BOOLEAN_PROPERTY_REQUEST_TOUCH_PASSTHROUGH); } /** * Sets whether this node wants touch interaction within its screen bounds to bypass touch * exploration and go straight to the underlying view hierarchy. * <p> * <strong>Note:</strong> This property allows the * {@link android.accessibilityservice.AccessibilityService} to calculate the * aggregated touch passthrough region. App developers need to ensure that the * {@link #getBoundsInScreen()} of * the node align with the region they want touchable, and that child nodes overlapping these * bounds may cause that region to be reduced. * </p> * * <p> * <strong>Note:</strong> Cannot be called from an * {@link android.accessibilityservice.AccessibilityService}. * This class is made immutable before being delivered to an AccessibilityService. * </p> * * @param touchPassthrough True if the node wants touch interaction within its screen bounds * to bypass touch exploration and go straight to the underlying view * hierarchy. * @throws IllegalStateException If called from an AccessibilityService. */ public void setRequestTouchPassthrough(boolean touchPassthrough) { setBooleanProperty(BOOLEAN_PROPERTY_REQUEST_TOUCH_PASSTHROUGH, touchPassthrough); } /** * If this node represents a visually distinct region of the screen that may update separately * from the rest of the window, it is considered a pane. Set the pane title to indicate that Loading core/tests/coretests/src/android/view/accessibility/AccessibilityNodeInfoTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,7 @@ public class AccessibilityNodeInfoTest { // The number of flags held in boolean properties. Their values should also be double-checked // in the methods above. private static final int NUM_BOOLEAN_PROPERTIES = 25; private static final int NUM_BOOLEAN_PROPERTIES = 26; @Test public void testStandardActions_serializationFlagIsValid() { Loading Loading
core/api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -54144,6 +54144,7 @@ package android.view.accessibility { method public android.view.accessibility.AccessibilityWindowInfo getWindow(); method public int getWindowId(); method public boolean hasRequestInitialAccessibilityFocus(); method public boolean hasRequestTouchPassthrough(); method public boolean isAccessibilityFocused(); method public boolean isCheckable(); method public boolean isChecked(); Loading Loading @@ -54225,6 +54226,7 @@ package android.view.accessibility { method public void setQueryFromAppProcessEnabled(@NonNull android.view.View, boolean); method public void setRangeInfo(android.view.accessibility.AccessibilityNodeInfo.RangeInfo); method public void setRequestInitialAccessibilityFocus(boolean); method public void setRequestTouchPassthrough(boolean); method public void setScreenReaderFocusable(boolean); method public void setScrollable(boolean); method public void setSelected(boolean);
core/java/android/view/accessibility/AccessibilityNodeInfo.java +49 −0 Original line number Diff line number Diff line Loading @@ -832,6 +832,8 @@ public class AccessibilityNodeInfo implements Parcelable { private static final int BOOLEAN_PROPERTY_REQUEST_INITIAL_ACCESSIBILITY_FOCUS = 1 << 24; private static final int BOOLEAN_PROPERTY_REQUEST_TOUCH_PASSTHROUGH = 1 << 25; /** * Bits that provide the id of a virtual descendant of a view. */ Loading Loading @@ -2594,6 +2596,53 @@ public class AccessibilityNodeInfo implements Parcelable { setBooleanProperty(BOOLEAN_PROPERTY_EDITABLE, editable); } /** * Gets whether this node is one of the candidates that wants touch interaction within its * screen bounds to bypass the touch exploration and go straight to the underlying view * hierarchy. * * <p> * {@link android.accessibilityservice.AccessibilityService} could aggregate the {@link * #getBoundsInScreen()} that has request touch passthrough, and/or doing complex calculation * with other views that doesn't request touch passthrough, and call {@link * AccessibilityService#setTouchExplorationPassthroughRegion(int, Region)} to bypass the touch * interactions to the underlying views within the region. * </p> * * @return True if the node wants touch interaction within its screen bounds to bypass touch * exploration and go straight to the underlying view hierarchy; false otherwise. */ public boolean hasRequestTouchPassthrough() { return getBooleanProperty(BOOLEAN_PROPERTY_REQUEST_TOUCH_PASSTHROUGH); } /** * Sets whether this node wants touch interaction within its screen bounds to bypass touch * exploration and go straight to the underlying view hierarchy. * <p> * <strong>Note:</strong> This property allows the * {@link android.accessibilityservice.AccessibilityService} to calculate the * aggregated touch passthrough region. App developers need to ensure that the * {@link #getBoundsInScreen()} of * the node align with the region they want touchable, and that child nodes overlapping these * bounds may cause that region to be reduced. * </p> * * <p> * <strong>Note:</strong> Cannot be called from an * {@link android.accessibilityservice.AccessibilityService}. * This class is made immutable before being delivered to an AccessibilityService. * </p> * * @param touchPassthrough True if the node wants touch interaction within its screen bounds * to bypass touch exploration and go straight to the underlying view * hierarchy. * @throws IllegalStateException If called from an AccessibilityService. */ public void setRequestTouchPassthrough(boolean touchPassthrough) { setBooleanProperty(BOOLEAN_PROPERTY_REQUEST_TOUCH_PASSTHROUGH, touchPassthrough); } /** * If this node represents a visually distinct region of the screen that may update separately * from the rest of the window, it is considered a pane. Set the pane title to indicate that Loading
core/tests/coretests/src/android/view/accessibility/AccessibilityNodeInfoTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,7 @@ public class AccessibilityNodeInfoTest { // The number of flags held in boolean properties. Their values should also be double-checked // in the methods above. private static final int NUM_BOOLEAN_PROPERTIES = 25; private static final int NUM_BOOLEAN_PROPERTIES = 26; @Test public void testStandardActions_serializationFlagIsValid() { Loading