diff options
| -rw-r--r-- | services/core/java/com/android/server/wm/WindowState.java | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java index b9466d2d43d0..d3519fa2ba48 100644 --- a/services/core/java/com/android/server/wm/WindowState.java +++ b/services/core/java/com/android/server/wm/WindowState.java @@ -2721,29 +2721,32 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP destroyedSomething |= c.destroySurface(cleanupOnResume, appStopped); } - if (appStopped || mWindowRemovalAllowed || cleanupOnResume) { + if (!(appStopped || mWindowRemovalAllowed || cleanupOnResume)) { + return destroyedSomething; + } + if (appStopped || mWindowRemovalAllowed) { mWinAnimator.destroyPreservedSurfaceLocked(); + } - if (mDestroying) { - if (DEBUG_ADD_REMOVE) Slog.e(TAG_WM, "win=" + this - + " destroySurfaces: appStopped=" + appStopped - + " win.mWindowRemovalAllowed=" + mWindowRemovalAllowed - + " win.mRemoveOnExit=" + mRemoveOnExit); - - if (!cleanupOnResume || mRemoveOnExit) { - destroyOrSaveSurface(); - } - if (mRemoveOnExit) { - removeImmediately(); - } - if (cleanupOnResume) { - requestUpdateWallpaperIfNeeded(); - } - mDestroying = false; - destroyedSomething = true; + if (mDestroying) { + if (DEBUG_ADD_REMOVE) Slog.e(TAG_WM, "win=" + this + + " destroySurfaces: appStopped=" + appStopped + + " win.mWindowRemovalAllowed=" + mWindowRemovalAllowed + + " win.mRemoveOnExit=" + mRemoveOnExit); + if (!cleanupOnResume || mRemoveOnExit) { + destroyOrSaveSurface(); + } + if (mRemoveOnExit) { + removeImmediately(); } + if (cleanupOnResume) { + requestUpdateWallpaperIfNeeded(); + } + mDestroying = false; + destroyedSomething = true; } + return destroyedSomething; } @@ -4401,7 +4404,8 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP // will keep their surface and its size may change over time. if (mHasSurface && !isChildWindow()) { mWinAnimator.preserveSurfaceLocked(); - result |= RELAYOUT_RES_FIRST_TIME; + result |= RELAYOUT_RES_SURFACE_CHANGED | + RELAYOUT_RES_FIRST_TIME; } } final boolean freeformResizing = isDragResizing() |