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

Commit 9c1c3a01 authored by Robert Carr's avatar Robert Carr
Browse files

Ensure we leave the orientation changing state.

During the screen rotation animation, we cover the screen in a static
snapshot. Since failing to exit this state is somewhat catastrophic
we have a timeout which is intended to be a catch call. The timeout
works by clearing the mOrientationChanging state of all windows
and then triggering a layout pass. Recently however we made changes
allowing the orientation changing state to persist past the mOrientationChanging
variable. In the bug, we see many notices of timed out draw reporting, but
somehow we still haven't left the orientation changing state
and the screenshot is still visible. I have to admit...this is sort of a guess
I don't understand why we never reported the configuration to the client...though
it seems probably some intracicies of visibility could be at play.

Bug: 64127238
Test: go/wm-smoke
Change-Id: I5dea9bad29e7cdb43aa5e8c9ece5b0a86a1c8a09
parent 2b7fbd01
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -2681,7 +2681,7 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
            if (!w.getOrientationChanging()) {
            if (!w.getOrientationChanging()) {
                return;
                return;
            }
            }
            w.setOrientationChanging(false);
            w.orientationChangeTimedOut();
            w.mLastFreezeDuration = (int)(SystemClock.elapsedRealtime()
            w.mLastFreezeDuration = (int)(SystemClock.elapsedRealtime()
                    - mService.mDisplayFreezeTime);
                    - mService.mDisplayFreezeTime);
            Slog.w(TAG_WM, "Force clearing orientation change: " + w);
            Slog.w(TAG_WM, "Force clearing orientation change: " + w);
+18 −1
Original line number Original line Diff line number Diff line
@@ -443,6 +443,17 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
     */
     */
    private boolean mOrientationChanging;
    private boolean mOrientationChanging;


    /**
     * Sometimes in addition to the mOrientationChanging
     * flag we report that the orientation is changing
     * due to a mismatch in current and reported configuration.
     *
     * In the case of timeout we still need to make sure we
     * leave the orientation changing state though, so we
     * use this as a special time out escape hatch.
     */
    private boolean mOrientationChangeTimedOut;

    /**
    /**
     * The orientation during the last visible call to relayout. If our
     * The orientation during the last visible call to relayout. If our
     * current orientation is different, the window can't be ready
     * current orientation is different, the window can't be ready
@@ -1221,11 +1232,17 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        //                   better indicator consistent with the client.
        //                   better indicator consistent with the client.
        return (mOrientationChanging || (isVisible()
        return (mOrientationChanging || (isVisible()
                && getConfiguration().orientation != mLastReportedConfiguration.orientation))
                && getConfiguration().orientation != mLastReportedConfiguration.orientation))
                && !mSeamlesslyRotated;
                && !mSeamlesslyRotated
                && !mOrientationChangeTimedOut;
    }
    }


    void setOrientationChanging(boolean changing) {
    void setOrientationChanging(boolean changing) {
        mOrientationChanging = changing;
        mOrientationChanging = changing;
        mOrientationChangeTimedOut = false;
    }

    void orientationChangeTimedOut() {
        mOrientationChangeTimedOut = true;
    }
    }


    DisplayContent getDisplayContent() {
    DisplayContent getDisplayContent() {