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

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

Merge "Move display order of focused stack to top when updating focus"

parents 11eedb63 57831b51
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -159,15 +159,19 @@ class ActivityDisplay extends ConfigurationContainer<ActivityStack>
        onStackOrderChanged();
    }

    void positionChildAtTop(ActivityStack stack) {
        positionChildAt(stack, mStacks.size());
    void positionChildAtTop(ActivityStack stack, boolean includingParents) {
        positionChildAt(stack, mStacks.size(), includingParents);
    }

    void positionChildAtBottom(ActivityStack stack) {
        positionChildAt(stack, 0);
        positionChildAt(stack, 0, false /* includingParents */);
    }

    private void positionChildAt(ActivityStack stack, int position) {
        positionChildAt(stack, position, false /* includingParents */);
    }

    private void positionChildAt(ActivityStack stack, int position, boolean includingParents) {
        // TODO: Keep in sync with WindowContainer.positionChildAt(), once we change that to adjust
        //       the position internally, also update the logic here
        mStacks.remove(stack);
@@ -179,7 +183,7 @@ class ActivityDisplay extends ConfigurationContainer<ActivityStack>
        // we don't have to call WindowContainerController#positionChildAt() here.
        if (stack.getWindowContainerController() != null) {
            mWindowContainerController.positionChildAt(stack.getWindowContainerController(),
                    insertPosition);
                    insertPosition, includingParents);
        }
        onStackOrderChanged();
    }
+3 −3
Original line number Diff line number Diff line
@@ -521,7 +521,7 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai
            // Since always on top is only on when the stack is freeform or pinned, the state
            // can be toggled when the windowing mode changes. We must make sure the stack is
            // placed properly when always on top state changes.
            display.positionChildAtTop(this);
            display.positionChildAtTop(this, false /* includingParents */);
        }
    }

@@ -1055,7 +1055,7 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai
            mStackSupervisor.moveHomeStackToFront(reason + " returnToHome");
        }

        display.positionChildAtTop(this);
        display.positionChildAtTop(this, true /* includingParents */);
        mStackSupervisor.setFocusStackUnchecked(reason, this);
        if (task != null) {
            // This also moves the entire hierarchy branch to top, including parents
@@ -5318,7 +5318,7 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai
        // always on top windows. Since the position the stack should be inserted into is calculated
        // properly in {@link ActivityDisplay#getTopInsertPosition()} in both cases, we can just
        // request that the stack is put at top here.
        display.positionChildAtTop(this);
        display.positionChildAtTop(this, false /* includingParents */);
    }

    void moveToFrontAndResumeStateIfNeeded(ActivityRecord r, boolean moveToFront, boolean setResume,
+2 −2
Original line number Diff line number Diff line
@@ -1931,8 +1931,8 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
        getParent().positionChildAt(position, this, includingParents);
    }

    void positionStackAt(int position, TaskStack child) {
        mTaskStackContainers.positionChildAt(position, child, false /* includingParents */);
    void positionStackAt(int position, TaskStack child, boolean includingParents) {
        mTaskStackContainers.positionChildAt(position, child, includingParents);
        layoutAndAssignWindowLayersIfNeeded();
    }

+3 −2
Original line number Diff line number Diff line
@@ -76,7 +76,8 @@ public class DisplayWindowController
    /**
     * Positions the task stack at the given position in the task stack container.
     */
    public void positionChildAt(StackWindowController child, int position) {
    public void positionChildAt(StackWindowController child, int position,
            boolean includingParents) {
        synchronized (mWindowMap) {
            if (DEBUG_STACK) Slog.i(TAG_WM, "positionTaskStackAt: positioning stack=" + child
                    + " at " + position);
@@ -90,7 +91,7 @@ public class DisplayWindowController
                        "positionTaskStackAt: could not find stack=" + this);
                return;
            }
            mContainer.positionStackAt(position, child.mContainer);
            mContainer.positionStackAt(position, child.mContainer, includingParents);
        }
    }

+1 −1
Original line number Diff line number Diff line
@@ -751,7 +751,7 @@ public class TaskStack extends WindowContainer<Task> implements
            // be inserted into is calculated properly in
            // {@link DisplayContent#findPositionForStack()} in both cases, we can just request that
            // the stack is put at top here.
            mDisplayContent.positionStackAt(POSITION_TOP, this);
            mDisplayContent.positionStackAt(POSITION_TOP, this, false /* includingParents */);
        }
    }

Loading