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

Commit d9e6642e authored by Riddle Hsu's avatar Riddle Hsu Committed by Automerger Merge Worker
Browse files

Merge "Do not set orientation changing to invisible window" into tm-qpr-dev...

Merge "Do not set orientation changing to invisible window" into tm-qpr-dev am: b2327bcf am: 9872384a

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20027104



Change-Id: Ida3eb272f4a3989634f07e35614c47955f28008a
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents c937aa2f 9872384a
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -6012,7 +6012,11 @@ public class WindowManagerService extends IWindowManager.Stub
        if (mFrozenDisplayId != INVALID_DISPLAY && mFrozenDisplayId == w.getDisplayId()
                && mWindowsFreezingScreen != WINDOWS_FREEZING_SCREENS_TIMEOUT) {
            ProtoLog.v(WM_DEBUG_ORIENTATION, "Changing surface while display frozen: %s", w);
            // WindowsState#reportResized won't tell invisible requested window to redraw,
            // so do not set it as changing orientation to avoid affecting draw state.
            if (w.isVisibleRequested()) {
                w.setOrientationChanging(true);
            }
            if (mWindowsFreezingScreen == WINDOWS_FREEZING_SCREENS_NONE) {
                mWindowsFreezingScreen = WINDOWS_FREEZING_SCREENS_ACTIVE;
                // XXX should probably keep timeout from
+9 −0
Original line number Diff line number Diff line
@@ -735,6 +735,15 @@ public class WindowStateTests extends WindowTestsBase {
        assertTrue(mWm.mResizingWindows.contains(startingApp));
        assertTrue(startingApp.isDrawn());
        assertFalse(startingApp.getOrientationChanging());

        // Even if the display is frozen, invisible requested window should not be affected.
        startingApp.mActivityRecord.mVisibleRequested = false;
        mWm.startFreezingDisplay(0, 0, mDisplayContent);
        doReturn(true).when(mWm.mPolicy).isScreenOn();
        startingApp.getWindowFrames().setInsetsChanged(true);
        startingApp.updateResizingWindowIfNeeded();
        assertTrue(startingApp.isDrawn());
        assertFalse(startingApp.getOrientationChanging());
    }

    @SetupWindows(addWindows = W_ABOVE_ACTIVITY)