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

Commit c016672b authored by Svetoslav Ganov's avatar Svetoslav Ganov Committed by The Android Automerger
Browse files

Accessibility query APIs report invisible views.

1. The accessibility querying APIs failed to check whether
   all predecessors of a view are visible before reporting it.

bug:6291855

Change-Id: I364a6f08e8d02c7105c00c9fdff0fec033829554
parent 8a053db2
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -5071,9 +5071,13 @@ public final class ViewRootImpl implements ViewParent,
     * @return Whether the view is visible on the screen.
     * @return Whether the view is visible on the screen.
     */
     */
    private boolean isDisplayedOnScreen(View view) {
    private boolean isDisplayedOnScreen(View view) {
        // The first two checks are made also made by isShown() which
        // however traverses the tree up to the parent to catch that.
        // Therefore, we do some fail fast check to minimize the up
        // tree traversal.
        return (view.mAttachInfo != null
        return (view.mAttachInfo != null
                && view.mAttachInfo.mWindowVisibility == View.VISIBLE
                && view.mAttachInfo.mWindowVisibility == View.VISIBLE
                && view.getVisibility() == View.VISIBLE
                && view.isShown()
                && view.getGlobalVisibleRect(mTempRect));
                && view.getGlobalVisibleRect(mTempRect));
    }
    }