From d86fd3e7ac6c1bd472b8ec659ed6f66caaeebd81 Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Thu, 19 Apr 2018 12:26:21 -0700 Subject: [PATCH] Destroy app-less surfaces when becoming invisible with no animation. Otherwise there is no later point to destroy them and they linger around indefinitely. tryStartExitingAnimation seems like a safe point as we only call this from relayout and the client renderer is paused at this point, as long as we ensure we don't return a surface (which we won't since we have laid out to invisible) we should be assured that the client will not try again to render. Bug: 77911541 Test: Manual. Docked divider window is destroyed when dismissed. Change-Id: I2ed37f460a7f258083ab1c196c4e5f7a35e3d557 --- .../core/java/com/android/server/wm/WindowManagerService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index b1b026ed55cc2..af2ad783ad3ef 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -2204,7 +2204,7 @@ public class WindowManagerService extends IWindowManager.Stub if (mInputMethodWindow == win) { setInputMethodWindowLocked(null); } - boolean stopped = win.mAppToken != null ? win.mAppToken.mAppStopped : false; + boolean stopped = win.mAppToken != null ? win.mAppToken.mAppStopped : true; // We set mDestroying=true so AppWindowToken#notifyAppStopped in-to destroy surfaces // will later actually destroy the surface if we do not do so here. Normally we leave // this to the exit animation.