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

Commit e8053c5e authored by Massimo Carli's avatar Massimo Carli Committed by Android (Google) Code Review
Browse files

Merge "Fix letterboxing in bubble" into main

parents a7c6c80c 8765e421
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -8507,8 +8507,9 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A

        applySizeOverrideIfNeeded(newParentConfiguration, parentWindowingMode, resolvedConfig);

        final boolean isFixedOrientationLetterboxAllowed =
                parentWindowingMode == WINDOWING_MODE_MULTI_WINDOW
        // Bubble activities should always fill their parent and should not be letterboxed.
        final boolean isFixedOrientationLetterboxAllowed = !getLaunchedFromBubble()
                && (parentWindowingMode == WINDOWING_MODE_MULTI_WINDOW
                        || parentWindowingMode == WINDOWING_MODE_FULLSCREEN
                        // When starting to switch between PiP and fullscreen, the task is pinned
                        // and the activity is fullscreen. But only allow to apply letterbox if the
@@ -8516,7 +8517,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
                        || (!mWaitForEnteringPinnedMode
                                && parentWindowingMode == WINDOWING_MODE_PINNED
                                && resolvedConfig.windowConfiguration.getWindowingMode()
                                        == WINDOWING_MODE_FULLSCREEN);
                                        == WINDOWING_MODE_FULLSCREEN));
        // TODO(b/181207944): Consider removing the if condition and always run
        // resolveFixedOrientationConfiguration() since this should be applied for all cases.
        if (isFixedOrientationLetterboxAllowed) {
+11 −0
Original line number Diff line number Diff line
@@ -927,6 +927,17 @@ public class SizeCompatTests extends WindowTestsBase {
                mActivity.findMainWindow()));
    }

    @Test
    public void testIsLetterboxed_activityFromBubble_returnsFalse() {
        setUpDisplaySizeWithApp(1000, 2500);
        mActivity.mDisplayContent.setIgnoreOrientationRequest(true /* ignoreOrientationRequest */);
        spyOn(mActivity);
        doReturn(true).when(mActivity).getLaunchedFromBubble();
        prepareUnresizable(mActivity, SCREEN_ORIENTATION_LANDSCAPE);

        assertFalse(mActivity.areBoundsLetterboxed());
    }

    @Test
    public void testAspectRatioMatchParentBoundsAndImeAttachable() {
        setUpApp(new TestDisplayContent.Builder(mAtm, 1000, 2000).build());