diff --git a/services/core/java/com/android/server/wm/TaskFragment.java b/services/core/java/com/android/server/wm/TaskFragment.java index 19e45ff024632..85e25ab077ea1 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 =