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

Commit 11452bf7 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Reduce duplicated invocation of sendNewConfiguration

If there is a transition, sendNewConfiguration will be called from
WindowOrganizerController#startTransition -> applyTransaction
-> applyDisplayChangeIfNeeded.

So simply skip it as WMS#updateRotationUnchecked did, which checks
transition.isCollecting() to skip sendNewConfiguration.

Bug: 288105083
Test: Launch landscape app from portrait app. sendNewConfiguration
      is only called once.
Change-Id: Iba2cc27cb81e7b4b2d7633e42f08e58ef38e053f
parent b9406495
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -2004,12 +2004,11 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
        }
        // Update directly because the app which will change the orientation of display is ready.
        if (mDisplayRotation.updateOrientation(getOrientation(), false /* forceUpdate */)) {
            // Run rotation change on display thread. See Transition#shouldApplyOnDisplayThread().
            mWmService.mH.post(() -> {
                synchronized (mWmService.mGlobalLock) {
            // If a transition is collecting, let the transition apply the rotation change on
            // display thread. See Transition#shouldApplyOnDisplayThread().
            if (!mTransitionController.isCollecting(this)) {
                sendNewConfiguration();
            }
            });
            return;
        }
        if (mRemoteDisplayChangeController.isWaitingForRemoteDisplayChange()) {
+0 −1
Original line number Diff line number Diff line
@@ -1717,7 +1717,6 @@ public class DisplayContentTests extends WindowTestsBase {
        // The display should be rotated after the launch is finished.
        doReturn(false).when(app).isAnimating(anyInt(), anyInt());
        mDisplayContent.mAppTransition.notifyAppTransitionFinishedLocked(app.token);
        waitHandlerIdle(mWm.mH);
        mStatusBarWindow.finishSeamlessRotation(t);
        mNavBarWindow.finishSeamlessRotation(t);