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

Commit 50b79421 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Make sure wm Stack gets override config on creation"

parents 0f334393 704a3c0d
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -1722,21 +1722,22 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
        out.set(mContentRect);
    }

    TaskStack addStackToDisplay(int stackId, boolean onTop) {
    TaskStack addStackToDisplay(int stackId, boolean onTop, StackWindowController controller) {
        if (DEBUG_STACK) Slog.d(TAG_WM, "Create new stackId=" + stackId + " on displayId="
                + mDisplayId);

        TaskStack stack = getStackById(stackId);
        if (stack != null) {
            // It's already attached to the display...clear mDeferRemoval and move stack to
            // appropriate z-order on display as needed.
            // It's already attached to the display...clear mDeferRemoval, set controller, and move
            // stack to appropriate z-order on display as needed.
            stack.mDeferRemoval = false;
            stack.setController(controller);
            // We're not moving the display to front when we're adding stacks, only when
            // requested to change the position of stack explicitly.
            mTaskStackContainers.positionChildAt(onTop ? POSITION_TOP : POSITION_BOTTOM, stack,
                    false /* includingParents */);
        } else {
            stack = new TaskStack(mService, stackId);
            stack = new TaskStack(mService, stackId, controller);
            mTaskStackContainers.addStackToDisplay(stack, onTop);
        }

+1 −4
Original line number Diff line number Diff line
@@ -18,8 +18,6 @@ package com.android.server.wm;

import static android.app.ActivityManager.StackId.PINNED_STACK_ID;

import android.app.ActivityManager.StackId;
import android.app.WindowConfiguration;
import android.content.res.Configuration;
import android.graphics.Rect;
import android.os.Handler;
@@ -76,8 +74,7 @@ public class StackWindowController
                        + " to unknown displayId=" + displayId);
            }

            final TaskStack stack = dc.addStackToDisplay(stackId, onTop);
            stack.setController(this);
            dc.addStackToDisplay(stackId, onTop, this);
            getRawBounds(outBounds);
        }
    }
+2 −1
Original line number Diff line number Diff line
@@ -149,9 +149,10 @@ public class TaskStack extends WindowContainer<Task> implements DimLayer.DimLaye

    Rect mPreAnimationBounds = new Rect();

    TaskStack(WindowManagerService service, int stackId) {
    TaskStack(WindowManagerService service, int stackId, StackWindowController controller) {
        mService = service;
        mStackId = stackId;
        setController(controller);
        mDockedStackMinimizeThickness = service.mContext.getResources().getDimensionPixelSize(
                com.android.internal.R.dimen.docked_stack_minimize_thickness);
        EventLog.writeEvent(EventLogTags.WM_STACK_CREATED, stackId);
+1 −1
Original line number Diff line number Diff line
@@ -102,7 +102,7 @@ public class WindowFrameTests extends WindowTestsBase {
        sWm.mSystemDecorLayer = 10000;

        mWindowToken = new WindowTestUtils.TestAppWindowToken(sWm.getDefaultDisplayContentLocked());
        mStubStack = new TaskStack(sWm, 0);
        mStubStack = new TaskStack(sWm, 0, null);
    }

    public void assertRect(Rect rect, int left, int top, int right, int bottom) {
+1 −1
Original line number Diff line number Diff line
@@ -78,7 +78,7 @@ public class WindowTestUtils {
     */
    public static class TestTaskStack extends TaskStack {
        TestTaskStack(WindowManagerService service, int stackId) {
            super(service, stackId);
            super(service, stackId, null);
        }

        @Override