diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/recents/view/AppTransitionAnimationSpecsFuture.java b/packages/SystemUI/shared/src/com/android/systemui/shared/recents/view/AppTransitionAnimationSpecsFuture.java index 85d362a7a767e..c227feec75b6c 100644 --- a/packages/SystemUI/shared/src/com/android/systemui/shared/recents/view/AppTransitionAnimationSpecsFuture.java +++ b/packages/SystemUI/shared/src/com/android/systemui/shared/recents/view/AppTransitionAnimationSpecsFuture.java @@ -49,6 +49,10 @@ public abstract class AppTransitionAnimationSpecsFuture { mHandler.post(mComposeTask); } List specs = mComposeTask.get(); + // Clear reference to the compose task this future holds onto the reference to it's + // implementation (which can leak references to the bitmap it creates for the + // transition) + mComposeTask = null; if (specs == null) { return null; } diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java index ac26f68bacf79..19da3dba17e88 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java +++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java @@ -276,6 +276,9 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener } }; + // Used to reset the dummy stack view + private final TaskStack mEmptyTaskStack = new TaskStack(); + public RecentsImpl(Context context) { mContext = context; mHandler = new Handler(); @@ -1108,6 +1111,10 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener } }); EventBus.getDefault().send(hideMenuEvent); + + // Once we have launched the activity, reset the dummy stack view tasks so we don't hold + // onto references to the same tasks consumed by the activity + mDummyStackView.setTasks(mEmptyTaskStack, false /* notifyStackChanges */); } /**** OnAnimationFinishedListener Implementation ****/