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

Commit 1eee2b49 authored by Rob Carr's avatar Rob Carr Committed by Android (Google) Code Review
Browse files

Merge "Ensure we leave the orientation changing state." into oc-dr1-dev

parents f7906863 9c1c3a01
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2681,7 +2681,7 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
            if (!w.getOrientationChanging()) {
                return;
            }
            w.setOrientationChanging(false);
            w.orientationChangeTimedOut();
            w.mLastFreezeDuration = (int)(SystemClock.elapsedRealtime()
                    - mService.mDisplayFreezeTime);
            Slog.w(TAG_WM, "Force clearing orientation change: " + w);
+18 −1
Original line number Diff line number Diff line
@@ -443,6 +443,17 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
     */
    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
     * 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.
        return (mOrientationChanging || (isVisible()
                && getConfiguration().orientation != mLastReportedConfiguration.orientation))
                && !mSeamlesslyRotated;
                && !mSeamlesslyRotated
                && !mOrientationChangeTimedOut;
    }

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

    void orientationChangeTimedOut() {
        mOrientationChangeTimedOut = true;
    }

    DisplayContent getDisplayContent() {