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

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

Merge "Exclude insets from new parent config bounds when resolving SCM config" into main

parents c2f02181 88f80b9a
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -9261,6 +9261,19 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
            @NonNull CompatDisplayInsets compatDisplayInsets) {
        final Configuration resolvedConfig = getResolvedOverrideConfiguration();
        final Rect resolvedBounds = resolvedConfig.windowConfiguration.getBounds();
        final Insets insets;
        if (mResolveConfigHint.mUseOverrideInsetsForConfig) {
            // TODO(b/343197837): Add test to verify SCM behaviour with new bound configuration
            // Insets are decoupled from configuration by default from V+, use legacy
            // compatibility behaviour for apps targeting SDK earlier than 35
            // (see applySizeOverrideIfNeeded).
            insets = Insets.of(mDisplayContent.getDisplayPolicy()
                    .getDecorInsetsInfo(mDisplayContent.mDisplayFrames.mRotation,
                            mDisplayContent.mDisplayFrames.mWidth,
                            mDisplayContent.mDisplayFrames.mHeight).mOverrideNonDecorInsets);
        } else {
            insets = Insets.NONE;
        }
        // When an activity needs to be letterboxed because of fixed orientation, use fixed
        // orientation bounds (stored in resolved bounds) instead of parent bounds since the
@@ -9271,9 +9284,12 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        final Rect containerBounds = useResolvedBounds
                ? new Rect(resolvedBounds)
                : newParentConfiguration.windowConfiguration.getBounds();
        final Rect parentAppBounds =
                newParentConfiguration.windowConfiguration.getAppBounds();
        parentAppBounds.inset(insets);
        final Rect containerAppBounds = useResolvedBounds
                ? new Rect(resolvedConfig.windowConfiguration.getAppBounds())
                : newParentConfiguration.windowConfiguration.getAppBounds();
                : parentAppBounds;
        final int requestedOrientation = getRequestedConfigurationOrientation();
        final boolean orientationRequested = requestedOrientation != ORIENTATION_UNDEFINED;