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

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

Merge "Fix ActivityManagerManifestLayoutTests#testMinimalSizeDocked."

parents 0dc6a89f 020607df
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -4914,7 +4914,6 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai

        // Update override configurations of all tasks in the stack.
        final Rect taskBounds = tempTaskBounds != null ? tempTaskBounds : bounds;
        final Rect insetBounds = tempTaskInsetBounds != null ? tempTaskInsetBounds : taskBounds;

        mTmpBounds.clear();
        mTmpInsetBounds.clear();
@@ -4922,7 +4921,7 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai
        for (int i = mTaskHistory.size() - 1; i >= 0; i--) {
            final TaskRecord task = mTaskHistory.get(i);
            if (task.isResizeable()) {
                task.updateOverrideConfiguration(taskBounds, insetBounds);
                task.updateOverrideConfiguration(taskBounds, tempTaskInsetBounds);
            }

            if (task.hasDisplayedBounds()) {
+8 −5
Original line number Diff line number Diff line
@@ -1716,7 +1716,7 @@ class TaskRecord extends ConfigurationContainer {
        updateTaskDescription();
    }

    private void adjustForMinimalTaskDimensions(Rect bounds) {
    private void adjustForMinimalTaskDimensions(Rect bounds, Rect previousBounds) {
        if (bounds == null) {
            return;
        }
@@ -1747,9 +1747,8 @@ class TaskRecord extends ConfigurationContainer {
            return;
        }

        final Rect configBounds = getRequestedOverrideBounds();
        if (adjustWidth) {
            if (!configBounds.isEmpty() && bounds.right == configBounds.right) {
            if (!previousBounds.isEmpty() && bounds.right == previousBounds.right) {
                bounds.left = bounds.right - minWidth;
            } else {
                // Either left bounds match, or neither match, or the previous bounds were
@@ -1758,7 +1757,7 @@ class TaskRecord extends ConfigurationContainer {
            }
        }
        if (adjustHeight) {
            if (!configBounds.isEmpty() && bounds.bottom == configBounds.bottom) {
            if (!previousBounds.isEmpty() && bounds.bottom == previousBounds.bottom) {
                bounds.top = bounds.bottom - minHeight;
            } else {
                // Either top bounds match, or neither match, or the previous bounds were
@@ -2113,11 +2112,15 @@ class TaskRecord extends ConfigurationContainer {
    // TODO(b/113900640): remove this once ActivityRecord is changed to not need it anymore.
    void computeResolvedOverrideConfiguration(Configuration inOutConfig, Configuration parentConfig,
            Configuration overrideConfig) {
        // Save previous bounds because adjustForMinimalTaskDimensions uses that to determine if it
        // changes left bound vs. right bound, or top bound vs. bottom bound.
        mTmpBounds.set(inOutConfig.windowConfiguration.getBounds());

        inOutConfig.setTo(overrideConfig);

        Rect outOverrideBounds = inOutConfig.windowConfiguration.getBounds();
        if (outOverrideBounds != null && !outOverrideBounds.isEmpty()) {
            adjustForMinimalTaskDimensions(outOverrideBounds);
            adjustForMinimalTaskDimensions(outOverrideBounds, mTmpBounds);

            int windowingMode = overrideConfig.windowConfiguration.getWindowingMode();
            if (windowingMode == WINDOWING_MODE_UNDEFINED) {