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

Commit 490f4937 authored by Naomi Musgrave's avatar Naomi Musgrave
Browse files

[getPossibleMaximumWindowMetrics] return bounds in natural orientation

Rely upon bounds in natural orientation (ROTATION_0) rather than
width/height reflecting the current orientation.

Fixes: 284124064
Test: Manual
Change-Id: I8424c74d23126432619e2c898c6c72c762766bc5
parent 14711eb9
Loading
Loading
Loading
Loading
+5 −5
Original line number Original line Diff line number Diff line
@@ -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 */,