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

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

[WindowDecor2] Fix logic for setting spy/force-consumption params

A subtle change that joined two nested |if| statements together changed
the execution flow during relayout param calculation, this change
reverts to the original logic from window decor 1.

Specifically, isTransparentCaptionBarAppearance=true +
enable_accessible_custom_headers=true +
enable_caption_compat_inset_force_consumtion=true should NOT set
params.mShouldSetAppBounds nor FLAG_FORCE_CONSUMING, but wd2 would set
one of the two.

Flag: com.android.window.flags.enable_window_decoration_refactor
Bug: 409648813
Bug: 414521306
Test: atest WMShellUnitTests
Change-Id: I966cfbf8048e17469c82868b28143b73fae382a3
parent afaaf340
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -431,13 +431,12 @@ constructor(
        var insetSourceFlags = 0
        var shouldSetAppBounds = false
        if (isAppHeader) {
            if (
                taskInfo.isTransparentCaptionBarAppearance &&
                    !DesktopModeFlags.ENABLE_ACCESSIBLE_CUSTOM_HEADERS.isTrue
            ) {
            if (taskInfo.isTransparentCaptionBarAppearance) {
                if (!DesktopModeFlags.ENABLE_ACCESSIBLE_CUSTOM_HEADERS.isTrue) {
                    // Allow input to fall through to the windows below so that the app can respond
                    // to input events on their custom content.
                    inputFeatures = inputFeatures or WindowManager.LayoutParams.INPUT_FEATURE_SPY
                }
            } else if (DesktopModeFlags.ENABLE_CAPTION_COMPAT_INSET_FORCE_CONSUMPTION.isTrue) {
                if (shouldExcludeCaptionFromAppBounds) {
                    shouldSetAppBounds = true