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

Commit aac7a0b5 authored by Jorge Gil's avatar Jorge Gil
Browse files

Always report bounding rects even if caption bg appearance is opaque

To allows the apps to make the decision of whether to apply a background
caption bar appearance based on the available space determined by the
reported bounding rects.

Bug: 328667385
Test: atest DesktopModeWindowDecorationTests
Change-Id: Ic5048d7e528735774abff24de115e84f7b200963
parent 10fe5e6e
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -318,11 +318,12 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
        relayoutParams.mCaptionHeightId = getCaptionHeightIdStatic(taskInfo.getWindowingMode());
        relayoutParams.mCaptionWidthId = getCaptionWidthId(relayoutParams.mLayoutResId);

        if (captionLayoutId == R.layout.desktop_mode_app_controls_window_decor
                && TaskInfoKt.isTransparentCaptionBarAppearance(taskInfo)) {
            // App is requesting to customize the caption bar. Allow input to fall through to the
            // windows below so that the app can respond to input events on their custom content.
            relayoutParams.mAllowCaptionInputFallthrough = true;
        if (captionLayoutId == R.layout.desktop_mode_app_controls_window_decor) {
            // If the app is requesting to customize the caption bar, allow input to fall through
            // to the windows below so that the app can respond to input events on their custom
            // content.
            relayoutParams.mAllowCaptionInputFallthrough =
                    TaskInfoKt.isTransparentCaptionBarAppearance(taskInfo);
            // Report occluding elements as bounding rects to the insets system so that apps can
            // draw in the empty space in the center:
            //   First, the "app chip" section of the caption bar (+ some extra margins).
+2 −2
Original line number Diff line number Diff line
@@ -173,7 +173,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase {
    }

    @Test
    public void updateRelayoutParams_freeformAndTransparent_allowsInputFallthrough() {
    public void updateRelayoutParams_freeformAndTransparentAppearance_allowsInputFallthrough() {
        final ActivityManager.RunningTaskInfo taskInfo = createTaskInfo(/* visible= */ true);
        taskInfo.configuration.windowConfiguration.setWindowingMode(WINDOWING_MODE_FREEFORM);
        taskInfo.taskDescription.setSystemBarsAppearance(
@@ -191,7 +191,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase {
    }

    @Test
    public void updateRelayoutParams_freeformButOpaque_disallowsInputFallthrough() {
    public void updateRelayoutParams_freeformButOpaqueAppearance_disallowsInputFallthrough() {
        final ActivityManager.RunningTaskInfo taskInfo = createTaskInfo(/* visible= */ true);
        taskInfo.configuration.windowConfiguration.setWindowingMode(WINDOWING_MODE_FREEFORM);
        taskInfo.taskDescription.setSystemBarsAppearance(0);