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

Commit 0066fa80 authored by Eghosa Ewansiha-Vlachavas's avatar Eghosa Ewansiha-Vlachavas Committed by Android (Google) Code Review
Browse files

Merge "Don't show the user aspect ratio button for transparent activities" into main

parents e75a83b4 7da06c35
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -3513,7 +3513,8 @@ class Task extends TaskFragment {
        }
        appCompatTaskInfo.topActivityEligibleForUserAspectRatioButton = top != null
                && !appCompatTaskInfo.topActivityInSizeCompat
                && top.mLetterboxUiController.shouldEnableUserAspectRatioSettings();
                && top.mLetterboxUiController.shouldEnableUserAspectRatioSettings()
                && !info.isTopActivityTransparent;
        appCompatTaskInfo.topActivityBoundsLetterboxed = top != null  && top.areBoundsLetterboxed();
    }

+7 −0
Original line number Diff line number Diff line
@@ -574,6 +574,7 @@ public class TaskTests extends WindowTestsBase {
        spyOn(root);
        spyOn(root.mLetterboxUiController);

        doReturn(true).when(root).fillsParent();
        doReturn(true).when(root.mLetterboxUiController)
                .shouldEnableUserAspectRatioSettings();
        doReturn(false).when(root).inSizeCompatMode();
@@ -596,6 +597,12 @@ public class TaskTests extends WindowTestsBase {
        assertFalse(task.getTaskInfo()
                .appCompatTaskInfo.topActivityEligibleForUserAspectRatioButton);
        doReturn(false).when(root).inSizeCompatMode();

        // When the top activity is transparent, the button is not enabled
        doReturn(false).when(root).fillsParent();
        assertFalse(task.getTaskInfo()
                .appCompatTaskInfo.topActivityEligibleForUserAspectRatioButton);
        doReturn(true).when(root).fillsParent();
    }

    /**