diff options
| -rw-r--r-- | services/core/java/com/android/server/wm/ActivityStack.java | 3 | ||||
| -rw-r--r-- | services/core/java/com/android/server/wm/TaskRecord.java | 13 |
2 files changed, 9 insertions, 7 deletions
diff --git a/services/core/java/com/android/server/wm/ActivityStack.java b/services/core/java/com/android/server/wm/ActivityStack.java index 2663d997162c..6755c7363ede 100644 --- a/services/core/java/com/android/server/wm/ActivityStack.java +++ b/services/core/java/com/android/server/wm/ActivityStack.java @@ -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()) { diff --git a/services/core/java/com/android/server/wm/TaskRecord.java b/services/core/java/com/android/server/wm/TaskRecord.java index 5bb64407a28d..8c800097e49d 100644 --- a/services/core/java/com/android/server/wm/TaskRecord.java +++ b/services/core/java/com/android/server/wm/TaskRecord.java @@ -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) { |