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

Commit 15c77d13 authored by Abodunrinwa Toki's avatar Abodunrinwa Toki Committed by The Android Automerger
Browse files

Ensure that ViewGroup.getChildVisibleRect(...) is recursive.

This change fixes the issue where
getChildVisibleRect(View, Rect, Point, boolean) call isn't recursive.
The method was introduced in I49550ed4082bcbdcfe4643b962b50f3308092525

Bug: 28514727
Change-Id: Ib6b0fb67ca6c700b44f645319c23b1213a2742d4
parent 334c12d4
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -5482,6 +5482,9 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
    }

    /**
     * @param forceParentCheck true to guarantee that this call will propagate to all ancestors,
     *      false otherwise
     *
     * @hide
     */
    public boolean getChildVisibleRect(
@@ -5541,8 +5544,13 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
                (int) Math.ceil(rect.right), (int) Math.ceil(rect.bottom));

        if ((forceParentCheck || rectIsVisible) && mParent != null) {
            if (mParent instanceof ViewGroup) {
                rectIsVisible = ((ViewGroup) mParent)
                        .getChildVisibleRect(this, r, offset, forceParentCheck);
            } else {
                rectIsVisible = mParent.getChildVisibleRect(this, r, offset);
            }
        }
        return rectIsVisible;
    }