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

Commit 66d0eaff authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Only consider parent windowing mode if activity has no mode override

The freeform case could be
  task windowing mode=freeform
  activity requested windowing mode=undefined (inherit task)
Because isFloating returns false for undefined mode, it should ignore
the undefined case because the activity will inherit the mode from
task, then it should be considered as floating mode.

This is the follow-up of commit 79ea1505.

Bug: 151861875
Flag: com.android.window.flags.insets_decoupled_configuration
Test: adb shell am compat disable \
      INSETS_DECOUPLED_CONFIGURATION_ENFORCED test_app
      Launch test_app in freeform and resize it.
      The applySizeOverrideIfNeeded should not take effect.
Change-Id: I0153cbc5d53e1c05f41aa2423d271b0cded792b5
parent 8b1d33b5
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -8701,9 +8701,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        if (!mOptOutEdgeToEdge && (!mResolveConfigHint.mUseOverrideInsetsForConfig
                || getCompatDisplayInsets() != null
                || (isFloating(parentWindowingMode)
                        // Check the windowing mode of activity as well in case it is switching
                        // between PiP and fullscreen.
                        && isFloating(inOutConfig.windowConfiguration.getWindowingMode()))
                        // Check the requested windowing mode of activity as well in case it is
                        // switching between PiP and fullscreen.
                        && (inOutConfig.windowConfiguration.getWindowingMode()
                                == WINDOWING_MODE_UNDEFINED
                                || 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