From 7dd3b521ff94be7f060288571b4b87f4126d59d0 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Mon, 14 May 2018 10:07:15 -0700 Subject: [PATCH] Clear ref to animation after drag & drop animation completes - LauncherAppTransitionManagerImpl -> DragLayer -> mDropAnim -> mDragView (via the update listener) -> mBitmap Bug: 76162466 Test: Take hprof after picking up an app or widget, ensure there are no references to the image created for drag and drop Change-Id: Iffc92eed13775921567f9ac25fea8e356d6fe963 --- src/com/android/launcher3/dragndrop/DragLayer.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/com/android/launcher3/dragndrop/DragLayer.java b/src/com/android/launcher3/dragndrop/DragLayer.java index 3a1837d310..7fef904c29 100644 --- a/src/com/android/launcher3/dragndrop/DragLayer.java +++ b/src/com/android/launcher3/dragndrop/DragLayer.java @@ -1,3 +1,4 @@ + /* * Copyright (C) 2008 The Android Open Source Project * @@ -479,6 +480,7 @@ public class DragLayer extends BaseDragLayer { case ANIMATION_END_REMAIN_VISIBLE: break; } + mDropAnim = null; } }); mDropAnim.start(); @@ -488,6 +490,7 @@ public class DragLayer extends BaseDragLayer { if (mDropAnim != null) { mDropAnim.cancel(); } + mDropAnim = null; if (mDropView != null) { mDragController.onDeferredEndDrag(mDropView); }