From c11b19caef12c3199393b68ae36931a603337c05 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Tue, 30 Sep 2014 15:04:02 -0700 Subject: Fixing an issue with leaking starting windows. (Bug 17657878) In some cases, when starting an animation while another starting window is visible, the starting window is never scheduled to be removed. In that case, we try and schedule the closing app starting window to be removed when we are starting the transition to a new activity. This also partially addresses issues related to leaking windows in b/17381033. Change-Id: Id26525cd71380852f109ec2f55a4a60db5086ded --- services/core/java/com/android/server/wm/WindowManagerService.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 999649b02e68..c956d8099b1e 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -9093,6 +9093,11 @@ public class WindowManagerService extends IWindowManager.Stub // gotten drawn. wtoken.allDrawn = true; wtoken.deferClearAllDrawn = false; + // Ensure that apps that are mid-starting are also scheduled to have their + // starting windows removed after the animation is complete + if (wtoken.startingWindow != null && !wtoken.startingWindow.mExiting) { + scheduleRemoveStartingWindow(wtoken); + } if (animLp != null) { int layer = -1; -- cgit v1.2.3-59-g8ed1b