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

Commit 7794a004 authored by Adrian Roos's avatar Adrian Roos
Browse files

WindowInsetsController: make available after addView

Fixes an issue where the WindowInsetsController was only available after
the first traversal.

Bug: 155280356
Test: atest WindowInsetsControllerTests
Change-Id: I225efcaa31e97da9e8ebc6bd7d24c433c8e80826
parent edea65c7
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -11519,6 +11519,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
        ViewParent parent = getParent();
        if (parent instanceof View) {
            return ((View) parent).getWindowInsetsController();
        } else if (parent instanceof ViewRootImpl) {
            // Between WindowManager.addView() and the first traversal AttachInfo isn't set yet.
            return ((ViewRootImpl) parent).getInsetsController();
        }
        return null;
    }