diff options
author | Chiao Cheng <chiaocheng@google.com> | 2013-10-10 16:25:45 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-10-10 16:25:45 -0700 |
commit | 4a36ff5705bf4c703792226620eb2f118fc8d3d7 (patch) | |
tree | ad3cd0c8c5f9e0677ab3f78281c87b4d06b7af1f /InCallUI | |
parent | 0677fb458c3a4f1eb67fbdf8b0f2062b1afe489a (diff) | |
parent | 39ea7dacefa75e5e236fafd8fc331535ad5af438 (diff) |
am 7a40b3de: am 0296fe57: Merge "Pull login protected images for profiles." into klp-dev
* commit '7a40b3de256769057e49d8f9997f825f16a81ebd':
Pull login protected images for profiles.
Diffstat (limited to 'InCallUI')
-rw-r--r-- | InCallUI/src/com/android/incallui/ContactInfoCache.java | 15 | ||||
-rw-r--r-- | InCallUI/src/com/android/incallui/service/PhoneNumberService.java | 13 |
2 files changed, 8 insertions, 20 deletions
diff --git a/InCallUI/src/com/android/incallui/ContactInfoCache.java b/InCallUI/src/com/android/incallui/ContactInfoCache.java index 4b482cb4c..45a38c7cf 100644 --- a/InCallUI/src/com/android/incallui/ContactInfoCache.java +++ b/InCallUI/src/com/android/incallui/ContactInfoCache.java @@ -172,8 +172,8 @@ public class ContactInfoCache implements ContactsAsyncHelper.OnImageLoadComplete if (!callerInfo.contactExists && cacheEntry.name == null && mPhoneNumberService != null) { Log.d(TAG, "Contact lookup. Local contacts miss, checking remote"); - mPhoneNumberService.getPhoneNumberInfo(cacheEntry.number, - new PhoneNumberServiceListener(callId)); + final PhoneNumberServiceListener listener = new PhoneNumberServiceListener(callId); + mPhoneNumberService.getPhoneNumberInfo(cacheEntry.number, listener, listener); } else if (cacheEntry.personUri != null) { Log.d(TAG, "Contact lookup. Local contact found, starting image load"); // Load the image with a callback to update the image state. @@ -244,14 +244,9 @@ public class ContactInfoCache implements ContactsAsyncHelper.OnImageLoadComplete mInfoMap.put(mCallId, entry); sendInfoNotifications(mCallId, entry); - // 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.getNormalizedNumber(), - info.getImageUrl(), this); - } else { - // Otherwise, we're done, so clear callbacks - Log.d(TAG, "Contact lookup. Remote contact found, no image."); + // If there is no image then we should not expect another callback. + if (info.getImageUrl() == null) { + // We're done, so clear callbacks clearCallbacks(mCallId); } } diff --git a/InCallUI/src/com/android/incallui/service/PhoneNumberService.java b/InCallUI/src/com/android/incallui/service/PhoneNumberService.java index 24303cdfd..d5f809c3a 100644 --- a/InCallUI/src/com/android/incallui/service/PhoneNumberService.java +++ b/InCallUI/src/com/android/incallui/service/PhoneNumberService.java @@ -28,17 +28,10 @@ public interface PhoneNumberService { * * @param phoneNumber The phone number to lookup. * @param listener The listener to notify when the phone number lookup is complete. + * @param imageListener The listener to notify when the image lookup is complete. */ - public void getPhoneNumberInfo(String phoneNumber, NumberLookupListener listener); - - /** - * 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 number, String url, ImageLookupListener listener); + public void getPhoneNumberInfo(String phoneNumber, NumberLookupListener listener, + ImageLookupListener imageListener); public interface NumberLookupListener { |