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

Commit 4ecee5c2 authored by Alan Viverette's avatar Alan Viverette
Browse files

Unhide accessibility focus and importance getter APIs

BUG: 11421928
Change-Id: Ica5cf80fc7e4c1cb0900d4d0d2e7b0d02ff13c87
parent 26606007
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -28421,6 +28421,7 @@ package android.view {
    method public void invalidate(int, int, int, int);
    method public void invalidate();
    method public void invalidateDrawable(android.graphics.drawable.Drawable);
    method public boolean isAccessibilityFocused();
    method public boolean isActivated();
    method public boolean isAttachedToWindow();
    method public boolean isClickable();
@@ -28436,6 +28437,7 @@ package android.view {
    method public boolean isHorizontalFadingEdgeEnabled();
    method public boolean isHorizontalScrollBarEnabled();
    method public boolean isHovered();
    method public boolean isImportantForAccessibility();
    method public boolean isInEditMode();
    method public boolean isInLayout();
    method public boolean isInTouchMode();
+30 −4
Original line number Diff line number Diff line
@@ -6941,7 +6941,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * Returns whether this View is accessibility focused.
     *
     * @return True if this View is accessibility focused.
     * @hide
     */
    public boolean isAccessibilityFocused() {
        return (mPrivateFlags2 & PFLAG2_ACCESSIBILITY_FOCUSED) != 0;
@@ -7289,11 +7288,38 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
    }
    /**
     * Gets whether this view should be exposed for accessibility.
     * Computes whether this view should be exposed for accessibility. In
     * general, views that are interactive or provide information are exposed
     * while views that serve only as containers are hidden.
     * <p>
     * If an ancestor of this view has importance
     * {@link #IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS}, this method
     * returns <code>false</code>.
     * <p>
     * Otherwise, the value is computed according to the view's
     * {@link #getImportantForAccessibility()} value:
     * <ol>
     * <li>{@link #IMPORTANT_FOR_ACCESSIBILITY_NO} or
     * {@link #IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS}, return <code>false
     * </code>
     * <li>{@link #IMPORTANT_FOR_ACCESSIBILITY_YES}, return <code>true</code>
     * <li>{@link #IMPORTANT_FOR_ACCESSIBILITY_AUTO}, return <code>true</code> if
     * view satisfies any of the following:
     * <ul>
     * <li>Is actionable, e.g. {@link #isClickable()},
     * {@link #isLongClickable()}, or {@link #isFocusable()}
     * <li>Has an {@link AccessibilityDelegate}
     * <li>Has an interaction listener, e.g. {@link OnTouchListener},
     * {@link OnKeyListener}, etc.
     * <li>Is an accessibility live region, e.g.
     * {@link #getAccessibilityLiveRegion()} is not
     * {@link #ACCESSIBILITY_LIVE_REGION_NONE}.
     * </ul>
     * </ol>
     *
     * @return Whether the view is exposed for accessibility.
     *
     * @hide
     * @see #setImportantForAccessibility(int)
     * @see #getImportantForAccessibility()
     */
    public boolean isImportantForAccessibility() {
        final int mode = (mPrivateFlags2 & PFLAG2_IMPORTANT_FOR_ACCESSIBILITY_MASK)