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

Commit 97dd4394 authored by Cosmin Băieș's avatar Cosmin Băieș Committed by Android (Google) Code Review
Browse files

Merge "Check relayoutCalled in updateSourceFrame" into main

parents 3e1418b5 88cbe44b
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -162,6 +162,12 @@ class InsetsSourceProvider {
        return mSource;
    }

    @VisibleForTesting
    @NonNull
    Rect getSourceFrame() {
        return mSourceFrame;
    }

    /**
     * @return Whether the current flag configuration allows to control this source.
     */
+5 −0
Original line number Diff line number Diff line
@@ -1378,6 +1378,11 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
            // should be updated after the new given insets are sent to window manager.
            return;
        }
        if (!mRelayoutCalled) {
            // The window was not laid out yet. The source frame should be updated after the window
            // is laid out.
            return;
        }
        final SparseArray<InsetsSourceProvider> providers = getInsetsSourceProviders();
        for (int i = providers.size() - 1; i >= 0; i--) {
            providers.valueAt(i).updateSourceFrame(winFrame);
+2 −0
Original line number Diff line number Diff line
@@ -84,6 +84,7 @@ public class DisplayPolicyLayoutTests extends DisplayPolicyTestsBase {
        // Disabling this call for most tests since it can override the systemUiFlags when called.
        doNothing().when(mDisplayPolicy).updateSystemBarAttributes();

        makeWindowVisible(mStatusBarWindow, mNavBarWindow);
        updateDisplayFrames();
    }

@@ -154,6 +155,7 @@ public class DisplayPolicyLayoutTests extends DisplayPolicyTestsBase {
        };
        addWindow(win);
        win.getFrame().set(0, 0, 500, 100);
        makeWindowVisible(win);
        win.updateSourceFrame(win.getFrame());
        mDisplayContent.getInsetsStateController().onPostLayout();

+1 −0
Original line number Diff line number Diff line
@@ -540,6 +540,7 @@ public class DisplayPolicyTests extends WindowTestsBase {
        final DisplayPolicy displayPolicy = mDisplayContent.getDisplayPolicy();

        mDisplayContent.setInputMethodWindowLocked(mImeWindow);
        makeWindowVisible(mImeWindow);
        mImeWindow.getControllableInsetProvider().setServerVisible(true);

        mImeWindow.mGivenContentInsets.set(0, 10, 0, 0);
+2 −0
Original line number Diff line number Diff line
@@ -291,6 +291,8 @@ public class InsetsStateControllerTest extends WindowTestsBase {
        final WindowState statusBar = createWindow(null, TYPE_APPLICATION, "statusBar");
        final WindowState ime = createWindow(null, TYPE_INPUT_METHOD, "ime");

        makeWindowVisible(statusBar);

        // IME cannot be the IME target.
        ime.mAttrs.flags |= FLAG_NOT_FOCUSABLE;

Loading