From 03c572f066ec9ef28d6fbc7bdd56cab89626ac1c Mon Sep 17 00:00:00 2001 From: Jay Shrauner Date: Sat, 14 Sep 2013 12:24:04 -0700 Subject: Pass number to fetchImage as cache key Pass phone number in on fetchImage lookups so it can be used to save the image to the cache. Bug:10760102 Change-Id: I3afb5e99aa4e8a4bc9148f6cfda4e5eba48ec476 --- InCallUI/src/com/android/incallui/ContactInfoCache.java | 3 ++- InCallUI/src/com/android/incallui/service/PhoneNumberService.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'InCallUI') diff --git a/InCallUI/src/com/android/incallui/ContactInfoCache.java b/InCallUI/src/com/android/incallui/ContactInfoCache.java index 9ad7c5415..bc5d7c9a1 100644 --- a/InCallUI/src/com/android/incallui/ContactInfoCache.java +++ b/InCallUI/src/com/android/incallui/ContactInfoCache.java @@ -239,7 +239,8 @@ public class ContactInfoCache implements ContactsAsyncHelper.OnImageLoadComplete // If there's an associated image, fetch that if (info.getImageUrl() != null) { Log.d(TAG, "Contact lookup. Remote contact found, loading image."); - mPhoneNumberService.fetchImage(info.getImageUrl(), this); + mPhoneNumberService.fetchImage(info.getNormalizedNumber(), + info.getImageUrl(), this); } else { // Otherwise, we're done, so clear callbacks Log.d(TAG, "Contact lookup. Remote contact found, no image."); diff --git a/InCallUI/src/com/android/incallui/service/PhoneNumberService.java b/InCallUI/src/com/android/incallui/service/PhoneNumberService.java index 279593da2..942bf422f 100644 --- a/InCallUI/src/com/android/incallui/service/PhoneNumberService.java +++ b/InCallUI/src/com/android/incallui/service/PhoneNumberService.java @@ -34,10 +34,11 @@ public interface PhoneNumberService { /** * Get an image asynchronously. * + * @param number The phone number for the image. * @param url The url to fetch the image from. * @param listener The listener to notify when the image lookup is complete. */ - public void fetchImage(String url, ImageLookupListener listener); + public void fetchImage(String number, String url, ImageLookupListener listener); public interface NumberLookupListener { -- cgit v1.2.3