From fa8edf8220b8429bb6f9bff368c1737d502af518 Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Thu, 19 Apr 2018 12:38:47 -0700 Subject: [PATCH] Fix destruction of preserved surfaces for non app windows. A new codepath (if (mChildrenDetached)) is allowing the IME surface to become preserved. However WindowState#onAnimationDone will not properly clean up preserved surfaces in the case of windows without an App Token. For windows with an app token we follow the destroySurfaces path which does the right thing via WindowState#destroySurface however for the AppTokenless path we simply add to mDestroySurfaces. To fix this we ensure when processing mDestroySurfaces we also process preserved surfaces. Test: Manual. go/wm-smoke. Bug: 78089772 Change-Id: Ia54e31c83a941ce6ae8ceb11672634c01a91e2e9 --- .../core/java/com/android/server/wm/RootWindowContainer.java | 1 + 1 file changed, 1 insertion(+) diff --git a/services/core/java/com/android/server/wm/RootWindowContainer.java b/services/core/java/com/android/server/wm/RootWindowContainer.java index fd965fbc8ac7f..50d0d0a5f1f9b 100644 --- a/services/core/java/com/android/server/wm/RootWindowContainer.java +++ b/services/core/java/com/android/server/wm/RootWindowContainer.java @@ -692,6 +692,7 @@ class RootWindowContainer extends WindowContainer { wallpaperDestroyed = true; } win.destroySurfaceUnchecked(); + win.mWinAnimator.destroyPreservedSurfaceLocked(); } while (i > 0); mService.mDestroySurface.clear(); }