Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ad02037c authored by Louis Chang's avatar Louis Chang Committed by Automerger Merge Worker
Browse files

Merge "Restrict the smallest screen width dp of an embedded TF" into...

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

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



Change-Id: Ic95f3bb2857a37215d74b8f76e492ff3bb7933c6
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents c468abc0 f445ee71
Loading
Loading
Loading
Loading
+7 −1
Original line number Original line Diff line number Diff line
@@ -2054,9 +2054,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) (0.5f
                    inOutConfig.smallestScreenWidthDp = (int) (0.5f
                            + 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
            }
            }