From f648deadf37f76dfe88d28db47081781aa9ad3f7 Mon Sep 17 00:00:00 2001 From: Issei Suzuki Date: Wed, 12 May 2021 19:10:10 +0200 Subject: [PATCH] Make sure to remove NotificationShade surface when keyguard went away. When unlock animation is finished, SysUI clears FLAG_SHOW_WALLPAPER flag from the NotificationShade window to change wallpaper target from NotificationShade to Launcher, and make NotificationShade window invisible. Wallpaper target change must be processed before disposing surface of NotificationShade. Bug: 186984629 Bug: 166736690 Test: manual, enabled remote animation and unlock the device. Change-Id: Id4c2ae65d9dd5aa903c1a25c920df6ed12a1ba1d --- .../com/android/server/wm/WindowManagerService.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 7df5744cdf15c..4a9c1bbb0f281 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -2329,6 +2329,17 @@ public class WindowManagerService extends IWindowManager.Stub } result |= RELAYOUT_RES_SURFACE_CHANGED; if (!win.mWillReplaceWindow) { + // When FLAG_SHOW_WALLPAPER flag is removed from a window, we usually set a flag + // in DC#pendingLayoutChanges and update the wallpaper target later. + // However it's possible that FLAG_SHOW_WALLPAPER flag is removed from a window + // when the window is about to exit, so we update the wallpaper target + // immediately here. Otherwise this window will be stuck in exiting and its + // surface remains on the screen. + // TODO(b/189856716): Allow destroying surface even if it belongs to the + // keyguard target. + if (wallpaperMayMove) { + displayContent.mWallpaperController.adjustWallpaperWindows(); + } focusMayChange = tryStartExitingAnimation(win, winAnimator, focusMayChange); } }