Merge "Fix CTS failure for waterfall device" am: 816e6b43aa

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

Change-Id: Idb1d7987211f501390b024d6f4f084e79e1e1cc5
This commit is contained in:
Shawn Lin
2021-12-22 05:04:11 +00:00
committed by Automerger Merge Worker

View File

@@ -2787,7 +2787,15 @@ class Task extends WindowContainer<WindowContainer> {
if (inOutConfig.smallestScreenWidthDp if (inOutConfig.smallestScreenWidthDp
== Configuration.SMALLEST_SCREEN_WIDTH_DP_UNDEFINED) { == 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 // For floating tasks, calculate the smallest width from the bounds of the task
inOutConfig.smallestScreenWidthDp = (int) ( inOutConfig.smallestScreenWidthDp = (int) (
Math.min(mTmpFullBounds.width(), mTmpFullBounds.height()) / density); Math.min(mTmpFullBounds.width(), mTmpFullBounds.height()) / density);