From 0730eb16ceeae9805b164c954ec15dd0538fd508 Mon Sep 17 00:00:00 2001 From: Louis Chang Date: Fri, 17 Mar 2023 00:53:41 +0000 Subject: Fix the smallest width not updated while resolving override bounds Using the resolved override bounds vs. the current bounds to check if the TaskFragment has bounds override and updates the smallest width. Or the activity in the embedded TaskFragment could be relaunched next time resolving override configuration due to smallest width changed. Bug: 273184670 Test: steps on the bugs Change-Id: I014decd10d14b8a2f25c8ac6833768cc5f89c624 --- services/core/java/com/android/server/wm/TaskFragment.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/wm/TaskFragment.java b/services/core/java/com/android/server/wm/TaskFragment.java index 19e45ff02463..85e25ab077ea 100644 --- a/services/core/java/com/android/server/wm/TaskFragment.java +++ b/services/core/java/com/android/server/wm/TaskFragment.java @@ -2243,8 +2243,8 @@ class TaskFragment extends WindowContainer { // task, because they should not be affected by insets. inOutConfig.smallestScreenWidthDp = (int) (0.5f + Math.min(mTmpFullBounds.width(), mTmpFullBounds.height()) / density); - } else if (windowingMode == WINDOWING_MODE_MULTI_WINDOW - && isEmbeddedWithBoundsOverride()) { + } else if (windowingMode == WINDOWING_MODE_MULTI_WINDOW && mIsEmbedded + && insideParentBounds && !resolvedBounds.equals(parentBounds)) { // For embedded TFs, the smallest width should be updated. Otherwise, inherit // from the parent task would result in applications loaded wrong resource. inOutConfig.smallestScreenWidthDp = -- cgit v1.2.3-59-g8ed1b