Revert "Revert "Use color extraction for arrow popup.""

This reverts commit 17fda29bf3.

Reason for revert: Fixing the memory leak

Leak was detected in caused launcher tapl tests to fail.
For instructions on how to debug leaks, see go/launcher-testing.
Using AS memory profiler, the color extractor class is holding
onto a reference to launcher that has already been destroyed.
The fix is to set the listener to null when view is closed.

Bug: 175329686
Test: run profiler in AS, open and close popups, and verify no leaks

Change-Id: I2d4a87f0481cbc88f3587dce91278e85ca113545
This commit is contained in:
Jonathan Miranda authored and Jon Miranda committed 2021-05-04 08:53:58 -07:00
1 parent 30ffc3f95c
commit 21930da9a2
8 files changed
+296 -85

No files matched your search

@@ -21,7 +21,6 @@ import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Matrix;
@@ -34,6 +33,7 @@ import android.util.Property;
import android.util.SparseArray;
import android.view.ContextThemeWrapper;
import com.android.launcher3.Utilities;
import com.android.launcher3.anim.Interpolators;
import com.android.launcher3.icons.FastBitmapDrawable;
import com.android.launcher3.icons.GraphicsUtils;
@@ -119,9 +119,7 @@ public class PreloadIconDrawable extends FastBitmapDrawable {
info,
IconPalette.getPreloadProgressColor(context, info.bitmap.color),
getPreloadColors(context),
(context.getResources().getConfiguration().uiMode
& Configuration.UI_MODE_NIGHT_MASK
& Configuration.UI_MODE_NIGHT_YES) != 0) /* isDarkMode */;
Utilities.isDarkTheme(context));
}
public PreloadIconDrawable(