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

Commit ce5c8fcd authored by Eghosa Ewansiha-Vlachavas's avatar Eghosa Ewansiha-Vlachavas
Browse files

[1/n] Freeze rotation for SCM activities in desktop mode

When a SCM activity is in desktop mode, if the device is rotated don't
inherit new parent rotation. This essentially freezes the rotation of
the activity to that when it first enters SCM in desktop mode.

Replace `appCompatDisplayInsets.mIsFloating` with
`newParentConfiguration.windowConfiguration.tasksAreFloating()` to
respect current window mode and enfoce this behaviour.

Flag: NONE (bug fix)
Test: manual testing
Fixes: 368104917
Change-Id: I3964e1df30ce4a1d5b04a5159d89fee938acdb9b
parent 8ee235ee
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -223,7 +223,10 @@ class AppCompatSizeCompatModePolicy {
        int rotation = newParentConfiguration.windowConfiguration.getRotation();
        final boolean isFixedToUserRotation = mActivityRecord.mDisplayContent == null
                || mActivityRecord.mDisplayContent.getDisplayRotation().isFixedToUserRotation();
        if (!isFixedToUserRotation && !appCompatDisplayInsets.mIsFloating) {
        // Ignore parent rotation for floating tasks as window rotation is independent of its parent
        // and thus will remain, and so should be reconfigured, in its original rotation.
        if (!isFixedToUserRotation
                && !newParentConfiguration.windowConfiguration.tasksAreFloating()) {
            // Use parent rotation because the original display can be rotated.
            resolvedConfig.windowConfiguration.setRotation(rotation);
        } else {