diff options
| -rw-r--r-- | services/core/java/com/android/server/wm/DisplayContent.java | 2 | ||||
| -rw-r--r-- | services/core/java/com/android/server/wm/WindowState.java | 19 | 
2 files changed, 19 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java index 4d77d40584c1..5bc4a6b23392 100644 --- a/services/core/java/com/android/server/wm/DisplayContent.java +++ b/services/core/java/com/android/server/wm/DisplayContent.java @@ -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); diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java index c968653b814f..c6b9c52913ae 100644 --- a/services/core/java/com/android/server/wm/WindowState.java +++ b/services/core/java/com/android/server/wm/WindowState.java @@ -444,6 +444,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       * to be shown. @@ -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() {  |