From 1e04880221a772aa1705f0e549cc1c6c848c4eb9 Mon Sep 17 00:00:00 2001 From: calderwoodra Date: Thu, 1 Mar 2018 16:33:32 -0800 Subject: Instead of just cancelling loaders, reset them as well. Bug: 71385186 Test: manual PiperOrigin-RevId: 187552834 Change-Id: If4e1f7c18d5f5aae2a152762189948c3543ba321 --- java/com/android/dialer/app/list/PhoneFavoriteTileView.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'java') diff --git a/java/com/android/dialer/app/list/PhoneFavoriteTileView.java b/java/com/android/dialer/app/list/PhoneFavoriteTileView.java index 3739588ea..30b8464ed 100644 --- a/java/com/android/dialer/app/list/PhoneFavoriteTileView.java +++ b/java/com/android/dialer/app/list/PhoneFavoriteTileView.java @@ -199,9 +199,12 @@ public abstract class PhoneFavoriteTileView extends ContactTileView { */ private void sendViewNotification(Context context, Uri contactUri) { if (loader != null) { - loader.cancelLoad(); + // Cancels the current load if it's running and clears up any memory if it's using any. + loader.reset(); } loader = new ContactLoader(context, contactUri, true /* postViewNotification */); + // Immediately release anything we're holding in memory + loader.registerListener(0, (loader1, contact) -> loader.reset()); loader.startLoading(); } } -- cgit v1.2.3