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

Commit 0415fc05 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Check both parent and current windowing mode for legacy insets override

Currently, when animating between pip and fullscreen mode, the windowing
mode will be: task=pinned activity=fullscreen. If the insets override
only checks the mode from parent, the configuration will lose the
override when the activity still shows as fullscreen appearance, which
causes potential flickering. Especially if the display is close to
square, if the insets area are excluded or included in configuration,
it could even lead to orientation change that makes app uses different
layout during the pip animation.

Bug: 340035487
Test: adb shell am compat disable \
          INSETS_DECOUPLED_CONFIGURATION_ENFORCED pkg.pip.app
      adb shell wm size 2200x2200
      (make display be close to square)
      Enter/expand pip and check there is no extra
      configuration change when switching.
Merged-In: Ifa5e2da4478f89f6a95d15103bb01b29242421e2
Change-Id: Ifa5e2da4478f89f6a95d15103bb01b29242421e2
(cherry picked from commit 79ea1505)
parent ba726295
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -8652,7 +8652,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        }
        if (!mResolveConfigHint.mUseOverrideInsetsForStableBounds
                || getCompatDisplayInsets() != null || shouldCreateCompatDisplayInsets()
                || isFloating(parentWindowingMode) || rotation == ROTATION_UNDEFINED) {
                || (isFloating(parentWindowingMode)
                        // Check the windowing mode of activity as well in case it is switching
                        // between PiP and fullscreen.
                        && isFloating(inOutConfig.windowConfiguration.getWindowingMode()))
                || rotation == ROTATION_UNDEFINED) {
            // If the insets configuration decoupled logic is not enabled for the app, or the app
            // already has a compat override, or the context doesn't contain enough info to
            // calculate the override, skip the override.