Fixed leak of app token in exiting list.
- Remove app token from exiting list when it's last window is removed.
- Remove app token from exiting list when it's removal isn't delayed.
Test: Launch a few apps and press back and make sure the exit app to
list dump is empty.
Fixes: 38337456
Change-Id: Ia2f22c6f1add5f867e25583ec38ffccc71217ee7
diff --git a/services/core/java/com/android/server/wm/AppWindowToken.java b/services/core/java/com/android/server/wm/AppWindowToken.java
index 96ea5e5..57b0fe2 100644
--- a/services/core/java/com/android/server/wm/AppWindowToken.java
+++ b/services/core/java/com/android/server/wm/AppWindowToken.java
@@ -560,6 +560,9 @@
// with it will be removed as soon as their animations are complete
mAppAnimator.clearAnimation();
mAppAnimator.animating = false;
+ if (stack != null) {
+ stack.mExitingAppTokens.remove(this);
+ }
removeIfPossible();
}