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

Commit 7f0e1c36 authored by Riley Jones's avatar Riley Jones Committed by Android (Google) Code Review
Browse files

Merge "Documenting that AccessibilityWindowInfo#getRoot() can return unimportant nodes" into main

parents 7def1749 60b1b445
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -231,6 +231,11 @@ public final class AccessibilityWindowInfo implements Parcelable {

    /**
     * Gets the root node in the window's hierarchy.
     * <p>
     * Returns {@code null} if connection is invalid. Otherwise, always returns a node, even if the
     * root is considered unimportant for accessibility. In this case, calling
     * {@link AccessibilityNodeInfo#isImportantForAccessibility()} on the returned node will return
     * {@code false}.
     *
     * @return The root node.
     */
@@ -240,6 +245,11 @@ public final class AccessibilityWindowInfo implements Parcelable {

    /**
     * Gets the root node in the window's hierarchy.
     * <p>
     * Returns {@code null} if connection is invalid. Otherwise, always returns a node, even if the
     * root is considered unimportant for accessibility. In this case, calling
     * {@link AccessibilityNodeInfo#isImportantForAccessibility()} on the returned node will return
     * {@code false}.
     *
     * @param prefetchingStrategy the prefetching strategy.
     * @return The root node.
+3 −2
Original line number Diff line number Diff line
@@ -168,10 +168,11 @@ public class AccessibilityInteractionControllerTest {

    @Test
    @DisableFlags(android.view.accessibility.Flags.FLAG_IGNORE_UNIMPORTANT_ROOT)
    public void getRootView_isUnimportant_returnsNotNull() {
    public void getRootView_isUnimportant_returnsRoot() {
        mViewRootImpl.getView().setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);

        assertThat(mAccessibilityInteractionController.getRootView()).isNotNull();
        assertThat(mAccessibilityInteractionController.getRootView())
                .isEqualTo(mViewRootImpl.getView());
    }

    private void launchActivity() {