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

Commit 7470419c authored by Kazuki Takise's avatar Kazuki Takise
Browse files

Split core window addition logic into addWindowInner()

This will make it easier to place closer creating and setting
ready a transition when a new window is added.

The actual logic for presentation windows will be handled in a
separate change.

Flag: EXEMPT refactoring
Bug: 390482707
Test: WmTests:WindowManagerServiceTests
Change-Id: Ibc123832d7491bf84e9a84e568d8a9baa78a3900
parent 3164ec8d
Loading
Loading
Loading
Loading
+113 −100
Original line number Diff line number Diff line
@@ -1820,6 +1820,22 @@ public class WindowManagerService extends IWindowManager.Stub
            final boolean hideSystemAlertWindows = shouldHideNonSystemOverlayWindow(win);
            win.setForceHideNonSystemOverlayWindowIfNeeded(hideSystemAlertWindows);

            res |= addWindowInner(win, displayPolicy, activity, displayContent, outInsetsState,
                    outAttachedFrame, outActiveControls, client, outSizeCompatScale, attrs);
        }

        Binder.restoreCallingIdentity(origId);

        return res;
    }

    private int addWindowInner(@NonNull WindowState win, @NonNull DisplayPolicy displayPolicy,
            @NonNull ActivityRecord activity, @NonNull DisplayContent displayContent,
            @NonNull InsetsState outInsetsState, @NonNull Rect outAttachedFrame,
            @NonNull InsetsSourceControl.Array outActiveControls, @NonNull IWindow client,
            @NonNull float[] outSizeCompatScale, @NonNull LayoutParams attrs) {
        int res = 0;
        final int type = attrs.type;
        boolean imMayMove = true;

        win.mToken.addWindow(win);
@@ -1936,9 +1952,6 @@ public class WindowManagerService extends IWindowManager.Stub
        if (res >= ADD_OKAY && win.isPresentation()) {
            mPresentationController.onPresentationAdded(win);
        }
        }

        Binder.restoreCallingIdentity(origId);

        return res;
    }