Merge "Restrict the smallest screen width dp of an embedded TF" into tm-dev am: e107722e17

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18668447

Change-Id: I7bbb09276e37babeb364d8d7a527bfa4b4680275
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Louis Chang
2022-06-01 01:25:39 +00:00
committed by Automerger Merge Worker

View File

@@ -2061,9 +2061,15 @@ class TaskFragment extends WindowContainer<WindowContainer> {
final boolean inPipTransition = windowingMode == WINDOWING_MODE_PINNED final boolean inPipTransition = windowingMode == WINDOWING_MODE_PINNED
&& !mTmpFullBounds.isEmpty() && mTmpFullBounds.equals(parentBounds); && !mTmpFullBounds.isEmpty() && mTmpFullBounds.equals(parentBounds);
if (WindowConfiguration.isFloating(windowingMode) && !inPipTransition) { if (WindowConfiguration.isFloating(windowingMode) && !inPipTransition) {
// For floating tasks, calculate the smallest width from the bounds of the task // For floating tasks, calculate the smallest width from the bounds of the
// task, because they should not be affected by insets.
inOutConfig.smallestScreenWidthDp = (int) ( inOutConfig.smallestScreenWidthDp = (int) (
Math.min(mTmpFullBounds.width(), mTmpFullBounds.height()) / density); Math.min(mTmpFullBounds.width(), mTmpFullBounds.height()) / density);
} else if (isEmbedded()) {
// For embedded TFs, the smallest width should be updated. Otherwise, inherit
// from the parent task would result in applications loaded wrong resource.
inOutConfig.smallestScreenWidthDp =
Math.min(inOutConfig.screenWidthDp, inOutConfig.screenHeightDp);
} }
// otherwise, it will just inherit // otherwise, it will just inherit
} }