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

Commit 514ba6fe authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Consolidate TaskDisplayArea#addStack and TaskDisplayArea#addChild" into...

Merge "Consolidate TaskDisplayArea#addStack and TaskDisplayArea#addChild" into rvc-dev am: 53e927f8 am: a037a0cc

Change-Id: I0ab005032efb4ee2ab24eeda99d467facf393a7e
parents a7749cdb a037a0cc
Loading
Loading
Loading
Loading
+4 −12
Original line number Diff line number Diff line
@@ -267,16 +267,14 @@ final class TaskDisplayArea extends DisplayArea<ActivityStack> {

    @Override
    void addChild(ActivityStack stack, int position) {
        if (DEBUG_STACK) Slog.d(TAG_WM, "Set stack=" + stack + " on taskDisplayArea=" + this);
        addStackReferenceIfNeeded(stack);
        position = findPositionForStack(position, stack, true /* adding */);

        super.addChild(stack, position);
        mAtmService.updateSleepIfNeededLocked();

        // The reparenting case is handled in WindowContainer.
        if (!stack.mReparenting) {
            mDisplayContent.setLayoutNeeded();
        }
        positionStackAt(stack, position);
    }

    @Override
@@ -638,12 +636,6 @@ final class TaskDisplayArea extends DisplayArea<ActivityStack> {
        }
    }

    void addStack(ActivityStack stack, int position) {
        if (DEBUG_STACK) Slog.d(TAG_WM, "Set stack=" + stack + " on taskDisplayArea=" + this);
        addChild(stack, position);
        positionStackAt(stack, position);
    }

    void onStackRemoved(ActivityStack stack) {
        if (ActivityTaskManagerDebugConfig.DEBUG_STACK) {
            Slog.v(TAG_STACK, "removeStack: detaching " + stack + " from displayId="
@@ -787,7 +779,7 @@ final class TaskDisplayArea extends DisplayArea<ActivityStack> {
                }
            } else if (stack.getDisplayArea() != this || !stack.isRootTask()) {
                if (stack.getParent() == null) {
                    addStack(stack, position);
                    addChild(stack, position);
                } else {
                    stack.reparent(this, onTop);
                }
@@ -943,7 +935,7 @@ final class TaskDisplayArea extends DisplayArea<ActivityStack> {
                positionStackAtTop((ActivityStack) launchRootTask, false /* includingParents */);
            }
        } else {
            addStack(stack, onTop ? POSITION_TOP : POSITION_BOTTOM);
            addChild(stack, onTop ? POSITION_TOP : POSITION_BOTTOM);
            stack.setWindowingMode(windowingMode, true /* creating */);
        }
        return stack;
+5 −3
Original line number Diff line number Diff line
@@ -662,11 +662,13 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
                //       position that takes into account the removed child (if the index of the
                //       child < position, then the position should be adjusted). We should consider
                //       doing this adjustment here and remove any adjustments in the callers.
                if (mChildren.indexOf(child) != position) {
                    mChildren.remove(child);
                    mChildren.add(position, child);
                    onChildPositionChanged(child);
                }
        }
    }

    /**
     * Notify that a child's position has changed. Possible changes are adding or removing a child.
+1 −1
Original line number Diff line number Diff line
@@ -1196,7 +1196,7 @@ public class ActivityStackTests extends ActivityTestsBase {
        mDefaultTaskDisplayArea.registerStackOrderChangedListener(listener);
        try {
            mStack.mReparenting = true;
            mDefaultTaskDisplayArea.addStack(mStack, 0);
            mDefaultTaskDisplayArea.addChild(mStack, 0);
        } finally {
            mDefaultTaskDisplayArea.unregisterStackOrderChangedListener(listener);
        }