commit | 3106ae0131a55497a20973d17ad73580bf3cb7cf | [log] [tgz] |
---|---|---|
author | Wale Ogunwale <ogunwale@google.com> | Tue May 16 08:56:37 2017 -0700 |
committer | Wale Ogunwale <ogunwale@google.com> | Tue May 16 12:59:35 2017 -0700 |
tree | a6a70b9ba761897fae00d06dd790c56b8d05a841 | |
parent | 2df0155a9727e770244d6becdf9125d5f7a843b3 [diff] |
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(); }
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 54bfeb5..6be7900 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -1685,6 +1685,10 @@ // re-factor. atoken.firstWindowDrawn = false; atoken.clearAllDrawn(); + final TaskStack stack = atoken.getStack(); + if (stack != null) { + stack.mExitingAppTokens.remove(atoken); + } } }