diff options
author | calderwoodra <calderwoodra@google.com> | 2018-03-01 16:33:32 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-03-01 18:16:50 -0800 |
commit | 1e04880221a772aa1705f0e549cc1c6c848c4eb9 (patch) | |
tree | 016294b6faf1edf4502d6a732496ef9d96a93310 /java/com/android/dialer/app/list/PhoneFavoriteTileView.java | |
parent | b01a89385d984c8a0136515785759aff9a885855 (diff) |
Instead of just cancelling loaders, reset them as well.
Bug: 71385186
Test: manual
PiperOrigin-RevId: 187552834
Change-Id: If4e1f7c18d5f5aae2a152762189948c3543ba321
Diffstat (limited to 'java/com/android/dialer/app/list/PhoneFavoriteTileView.java')
-rw-r--r-- | java/com/android/dialer/app/list/PhoneFavoriteTileView.java | 5 |
1 files changed, 4 insertions, 1 deletions
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(); } } |