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

Commit 9c1a2677 authored by Adrian Roos's avatar Adrian Roos Committed by android-build-merger
Browse files

Merge "WM: Make maxAspectRatio work with display cutouts" into pi-dev am: ab467035

am: 830bf102

Change-Id: Ia4c86ffb4e0f4c0628e598724683ba73b2a63fa0
parents 8f133c75 830bf102
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -2413,11 +2413,16 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo
        }

        // Compute configuration based on max supported width and height.
        outBounds.set(0, 0, maxActivityWidth, maxActivityHeight);
        // Also account for the left / top insets (e.g. from display cutouts), which will be clipped
        // away later in StackWindowController.adjustConfigurationForBounds(). Otherwise, the app
        // bounds would end up too small.
        outBounds.set(0, 0, maxActivityWidth + appBounds.left, maxActivityHeight + appBounds.top);

        if (service.mWindowManager.getNavBarPosition() == NAV_BAR_LEFT) {
            // Position the activity frame on the opposite side of the nav bar.
        final int navBarPosition = service.mWindowManager.getNavBarPosition();
        final int left = navBarPosition == NAV_BAR_LEFT ? appBounds.right - outBounds.width() : 0;
        outBounds.offsetTo(left, 0 /* top */);
            outBounds.left = appBounds.right - maxActivityWidth;
            outBounds.right = appBounds.right;
        }
    }

    boolean ensureActivityConfiguration(int globalChanges, boolean preserveWindow) {