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

Commit 24083143 authored by Yunfan Chen's avatar Yunfan Chen
Browse files

Decouple the insets from configuration

Change the default behavior to dispatch configuration without insets
considered.

Bug: 151861875
Test: DisplayPolicyTests
Change-Id: Ie65cd2ce503ba51b0732cb402265965b08f3b3c7
parent 6af54b6d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -48,5 +48,7 @@ class WindowManagerFlags {
    final boolean mAllowsScreenSizeDecoupledFromStatusBarAndCutout =
            Flags.allowsScreenSizeDecoupledFromStatusBarAndCutout();

    final boolean mInsetsDecoupledConfiguration = Flags.insetsDecoupledConfiguration();

    /* End Available Flags */
}
+7 −4
Original line number Diff line number Diff line
@@ -1190,13 +1190,16 @@ public class WindowManagerService extends IWindowManager.Stub
        final boolean isScreenSizeDecoupledFromStatusBarAndCutout = context.getResources()
                .getBoolean(R.bool.config_decoupleStatusBarAndDisplayCutoutFromScreenSize)
                && mFlags.mAllowsScreenSizeDecoupledFromStatusBarAndCutout;
        if (!isScreenSizeDecoupledFromStatusBarAndCutout) {
        if (mFlags.mInsetsDecoupledConfiguration) {
            mDecorTypes = 0;
            mConfigTypes = 0;
        } else if (isScreenSizeDecoupledFromStatusBarAndCutout) {
            mDecorTypes = WindowInsets.Type.navigationBars();
            mConfigTypes = WindowInsets.Type.navigationBars();
        } else {
            mDecorTypes = WindowInsets.Type.displayCutout() | WindowInsets.Type.navigationBars();
            mConfigTypes = WindowInsets.Type.displayCutout() | WindowInsets.Type.statusBars()
                    | WindowInsets.Type.navigationBars();
        } else {
            mDecorTypes = WindowInsets.Type.navigationBars();
            mConfigTypes = WindowInsets.Type.navigationBars();
        }

        mLetterboxConfiguration = new LetterboxConfiguration(