Merge "Re-land "[getPossibleMaximumWindowMetrics] return bounds in natural orientation"" into udc-qpr-dev am: 9df1b3e276

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

Change-Id: Ic3bcdf855a80a64d0879bf42f5f74b3b476829c3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot
2023-06-30 12:54:02 +00:00
committed by Automerger Merge Worker

View File

@@ -145,13 +145,13 @@ public final class WindowMetricsController {
for (int i = 0; i < possibleDisplayInfos.size(); i++) { for (int i = 0; i < possibleDisplayInfos.size(); i++) {
currentDisplayInfo = possibleDisplayInfos.get(i); currentDisplayInfo = possibleDisplayInfos.get(i);
// Calculate max bounds for this rotation and state. // Calculate max bounds for natural rotation and state.
Rect maxBounds = new Rect(0, 0, currentDisplayInfo.logicalWidth, Rect maxBounds = new Rect(0, 0, currentDisplayInfo.getNaturalWidth(),
currentDisplayInfo.logicalHeight); currentDisplayInfo.getNaturalHeight());
// Calculate insets for the rotated max bounds. // Calculate insets for the natural max bounds.
final boolean isScreenRound = (currentDisplayInfo.flags & Display.FLAG_ROUND) != 0; final boolean isScreenRound = (currentDisplayInfo.flags & Display.FLAG_ROUND) != 0;
// Initialize insets based upon display rotation. Note any window-provided insets // Initialize insets based on Surface.ROTATION_0. Note any window-provided insets
// will not be set. // will not be set.
windowInsets = getWindowInsetsFromServerForDisplay( windowInsets = getWindowInsetsFromServerForDisplay(
currentDisplayInfo.displayId, null /* token */, currentDisplayInfo.displayId, null /* token */,