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

Commit 6642c65f authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Run app switch display change from on display thread

This is similar to [1]. Which aligns the same behavior as legacy
transition which runs sendNewConfiguration on display thread (legacy
always use RemoteDisplayChangeController#continueDisplayChange).

So the system decorations won't handle the display change too early.

[1]: I7e1de5b5fe12cb30b5f48808ea6b0a2214c0f339

Bug: 317462067
Test: Enable auto rotation. Disable home rotation.
      Put device on landscape. Loop start camera and return
      to home. The camera cutout won't flicker on wrong side.
Change-Id: I26c05d19769f4ae8131ff911e607723a743c99f1
parent 944de4f9
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -2007,7 +2007,12 @@ 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) {
                    sendNewConfiguration();
                }
            });
            return;
        }
        if (mRemoteDisplayChangeController.isWaitingForRemoteDisplayChange()) {
+1 −0
Original line number Diff line number Diff line
@@ -1717,6 +1717,7 @@ 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);