Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cbfd71c6 authored by Casey Burkhardt's avatar Casey Burkhardt Committed by Android (Google) Code Review
Browse files

Merge "Exposes accessibility importance on AccessibilityNodeInfo"

parents bc89bd20 2d80ae4f
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -43689,6 +43689,7 @@ package android.view.accessibility {
    method public boolean isEnabled();
    method public boolean isFocusable();
    method public boolean isFocused();
    method public boolean isImportantForAccessibility();
    method public boolean isLongClickable();
    method public boolean isMultiLine();
    method public boolean isPassword();
@@ -43727,6 +43728,7 @@ package android.view.accessibility {
    method public void setError(java.lang.CharSequence);
    method public void setFocusable(boolean);
    method public void setFocused(boolean);
    method public void setImportantForAccessibility(boolean);
    method public void setInputType(int);
    method public void setLabelFor(android.view.View);
    method public void setLabelFor(android.view.View, int);
+2 −0
Original line number Diff line number Diff line
@@ -46111,6 +46111,7 @@ package android.view.accessibility {
    method public boolean isEnabled();
    method public boolean isFocusable();
    method public boolean isFocused();
    method public boolean isImportantForAccessibility();
    method public boolean isLongClickable();
    method public boolean isMultiLine();
    method public boolean isPassword();
@@ -46149,6 +46150,7 @@ package android.view.accessibility {
    method public void setError(java.lang.CharSequence);
    method public void setFocusable(boolean);
    method public void setFocused(boolean);
    method public void setImportantForAccessibility(boolean);
    method public void setInputType(int);
    method public void setLabelFor(android.view.View);
    method public void setLabelFor(android.view.View, int);
+2 −0
Original line number Diff line number Diff line
@@ -43706,6 +43706,7 @@ package android.view.accessibility {
    method public boolean isEnabled();
    method public boolean isFocusable();
    method public boolean isFocused();
    method public boolean isImportantForAccessibility();
    method public boolean isLongClickable();
    method public boolean isMultiLine();
    method public boolean isPassword();
@@ -43744,6 +43745,7 @@ package android.view.accessibility {
    method public void setError(java.lang.CharSequence);
    method public void setFocusable(boolean);
    method public void setFocused(boolean);
    method public void setImportantForAccessibility(boolean);
    method public void setInputType(int);
    method public void setLabelFor(android.view.View);
    method public void setLabelFor(android.view.View, int);
+7 −0
Original line number Diff line number Diff line
@@ -6770,6 +6770,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
        info.setVisibleToUser(isVisibleToUser());
        if ((mAttachInfo != null) && ((mAttachInfo.mAccessibilityFetchFlags
                & AccessibilityNodeInfo.FLAG_INCLUDE_NOT_IMPORTANT_VIEWS) != 0)) {
            info.setImportantForAccessibility(isImportantForAccessibility());
        } else {
            info.setImportantForAccessibility(true);
        }
        info.setPackageName(mContext.getPackageName());
        info.setClassName(getAccessibilityClassName());
        info.setContentDescription(getContentDescription());
+29 −0
Original line number Diff line number Diff line
@@ -569,6 +569,8 @@ public class AccessibilityNodeInfo implements Parcelable {

    private static final int BOOLEAN_PROPERTY_CONTEXT_CLICKABLE = 0x00020000;

    private static final int BOOLEAN_PROPERTY_IMPORTANCE = 0x0040000;

    /**
     * Bits that provide the id of a virtual descendant of a view.
     */
@@ -2156,6 +2158,33 @@ public class AccessibilityNodeInfo implements Parcelable {
        setBooleanProperty(BOOLEAN_PROPERTY_DISMISSABLE, dismissable);
    }

    /**
     * Returns whether the node originates from a view considered important for accessibility.
     *
     * @return {@code true} if the node originates from a view considered important for
     *         accessibility, {@code false} otherwise
     *
     * @see View#isImportantForAccessibility()
     */
    public boolean isImportantForAccessibility() {
        return getBooleanProperty(BOOLEAN_PROPERTY_IMPORTANCE);
    }

    /**
     * Sets whether the node is considered important for accessibility.
     * <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 important {@code true} if the node is considered important for accessibility,
     *                  {@code false} otherwise
     */
    public void setImportantForAccessibility(boolean important) {
        setBooleanProperty(BOOLEAN_PROPERTY_IMPORTANCE, important);
    }

    /**
     * Gets the package this node comes from.
     *