From 57f3d4632bf2482ace8316ec9d38098dbe25fbc9 Mon Sep 17 00:00:00 2001 From: Chong Zhang Date: Fri, 1 Apr 2016 17:57:07 -0700 Subject: [PATCH] Fix missing exit animation when app is closed during starting window When the transistion starts and we setTokenVisibilityLocked, mark all relevant window flags on a starting window that's running exit animation. This makes sure the starting window is removed when animation finishes. bug: 27747191 Change-Id: I917ca18583e31db9a3e49ea70aae932c242877b8 --- .../java/com/android/server/wm/WindowManagerService.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 192ba7b879e48..57ba77db148b7 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -4134,6 +4134,14 @@ public class WindowManagerService extends IWindowManager.Stub for (int i = 0; i < windowsCount; i++) { WindowState win = wtoken.allAppWindows.get(i); if (win == wtoken.startingWindow) { + // Starting window that's exiting will be removed when the animation + // finishes. Mark all relevant flags for that finishExit will proceed + // all the way to actually remove it. + if (!visible && win.isVisibleNow() && wtoken.mAppAnimator.isAnimating()) { + win.mAnimatingExit = true; + win.mRemoveOnExit = true; + win.mWindowRemovalAllowed = true; + } continue; }