summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2021-12-02 14:58:13 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2021-12-02 14:58:13 +0000
commit990528e9bef09158a5024f30a7be194cb16ac206 (patch)
tree4ee3565f57092a30a9545d00747b8c26066aa2c1
parent42a9a04b9de30946e0dc784476a6e3b851a54d19 (diff)
parent59a7b14c3e499b3cc70dfc54db7b83a4ea5b1d2d (diff)
Merge "Fix CTS failure for waterfall device" into sc-v2-dev
-rw-r--r--services/core/java/com/android/server/wm/TaskFragment.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/wm/TaskFragment.java b/services/core/java/com/android/server/wm/TaskFragment.java
index 985128aaec35..510ca7775263 100644
--- a/services/core/java/com/android/server/wm/TaskFragment.java
+++ b/services/core/java/com/android/server/wm/TaskFragment.java
@@ -1957,7 +1957,15 @@ class TaskFragment extends WindowContainer<WindowContainer> {
if (inOutConfig.smallestScreenWidthDp
== Configuration.SMALLEST_SCREEN_WIDTH_DP_UNDEFINED) {
- if (WindowConfiguration.isFloating(windowingMode)) {
+ // When entering to or exiting from Pip, the PipTaskOrganizer will set the
+ // windowing mode of the activity in the task to WINDOWING_MODE_FULLSCREEN and
+ // temporarily set the bounds of the task to fullscreen size for transitioning.
+ // It will get the wrong value if the calculation is based on this temporary
+ // fullscreen bounds.
+ // We should just inherit the value from parent for this temporary state.
+ final boolean inPipTransition = windowingMode == WINDOWING_MODE_PINNED
+ && !mTmpFullBounds.isEmpty() && mTmpFullBounds.equals(parentBounds);
+ if (WindowConfiguration.isFloating(windowingMode) && !inPipTransition) {
// For floating tasks, calculate the smallest width from the bounds of the task
inOutConfig.smallestScreenWidthDp = (int) (
Math.min(mTmpFullBounds.width(), mTmpFullBounds.height()) / density);