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

Commit e6da6c1e authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Remove imprecise condition of orientation update by translucent activity

The change I4fce2f84254875d0b52252d428000d39f994f14b is enough to
handle the the removed logic in a more precise way.

This avoids clearing rotation transform too early by a translucent
trampoline activity, e.g. portrait activity (X) ->
 landscape translucent activity (Y) -> landscape opaque activity (Z).
Because "r.fillsParent()" is false for (Y), it continues to update
orientation and clear (Z)'s rotation transform. That causes (Z) to
receive extra landscape->portrait->landscape configuration change.

Bug: 390049399
Flag: EXEMPT bugfix
Test: DisplayContentTests#testRespectNonTopVisibleFixedOrientation
Change-Id: I843bee77fef4d0a0b55fef762ce04a512bca7392
parent 32521fd2
Loading
Loading
Loading
Loading
+5 −9
Original line number Original line Diff line number Diff line
@@ -7057,11 +7057,11 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
                }
                }
                return;
                return;
            }
            }
            if (mFixedRotationLaunchingApp.hasFixedRotationTransform(r)) {
            if (!r.isVisible()) {
            if (!r.isVisible()) {
                // Let the opening activity update orientation.
                // Let the opening activity update orientation.
                return;
                return;
            }
            }
            if (mFixedRotationLaunchingApp.hasFixedRotationTransform(r)) {
                if (mFixedRotationLaunchingApp.hasAnimatingFixedRotationTransition()) {
                if (mFixedRotationLaunchingApp.hasAnimatingFixedRotationTransition()) {
                    // Waiting until all of the associated activities have done animation, or the
                    // Waiting until all of the associated activities have done animation, or the
                    // orientation would be updated too early and cause flickering.
                    // orientation would be updated too early and cause flickering.
@@ -7069,11 +7069,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
                }
                }
            } else {
            } else {
                // Check to skip updating display orientation by a non-top activity.
                // Check to skip updating display orientation by a non-top activity.
                if ((!r.isVisible() || !mFixedRotationLaunchingApp.fillsParent())
                if (!mFixedRotationLaunchingApp.fillsParent()) {
                        // When closing a translucent task A (r.fillsParent() is false) to a
                        // visible task B, because only A has visibility change, there is only A's
                        // transition callback. Then it still needs to update orientation for B.
                        && r.fillsParent()) {
                    return;
                    return;
                }
                }
                if (r.inTransition()) {
                if (r.inTransition()) {