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

Commit 1a16f030 authored by Yunfan Chen's avatar Yunfan Chen Committed by Android (Google) Code Review
Browse files

Merge "Verify windowing mode and bounds when apply overrides" into main

parents 7fc7611f ba17026f
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -255,9 +255,19 @@ public abstract class ConfigurationContainer<E extends ConfigurationContainer> {
            inOutConfig.windowConfiguration.setAppBounds(
                    newParentConfiguration.windowConfiguration.getBounds());
            outAppBounds = inOutConfig.windowConfiguration.getAppBounds();
            if (inOutConfig.windowConfiguration.getWindowingMode() == WINDOWING_MODE_FULLSCREEN) {
                final DisplayPolicy.DecorInsets.Info decor =
                        displayContent.getDisplayPolicy().getDecorInsetsInfo(rotation, dw, dh);
                if (outAppBounds.contains(decor.mOverrideNonDecorFrame)) {
                    outAppBounds.intersect(decor.mOverrideNonDecorFrame);
                }
            } else {
                // TODO(b/358509380): Handle other windowing mode like split screen and freeform
                //  cases correctly.
                outAppBounds.inset(displayContent.getDisplayPolicy()
                        .getDecorInsetsInfo(rotation, dw, dh).mOverrideNonDecorInsets);
            }
        }
        float density = inOutConfig.densityDpi;
        if (density == Configuration.DENSITY_DPI_UNDEFINED) {
            density = newParentConfiguration.densityDpi;