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

Commit ab467035 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

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

parents d0545395 24be34dc
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) {