From 7d2fb8620b808c28c49bde99dc54f6de46fdcb44 Mon Sep 17 00:00:00 2001 From: Chiao Cheng Date: Tue, 3 Sep 2013 17:00:23 -0700 Subject: Fix incall image for local contacts. The contact info callback was being called back at a minimum of two times. Once for the name and text data and a second time for the photo. The results of the first call triggers reverse lookups and was causing it to trigger twice. To fix it for both cases, break out the callback into two separate calls to the client can properly handle the cases differently. Bug: 10607629 Change-Id: I2e0754d2d7c46bc2797a1a672827bd2f8d56e5d8 --- InCallUI/src/com/android/incallui/CallCardPresenter.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'InCallUI/src/com/android/incallui/CallCardPresenter.java') diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java index a0ad3ce88..5b6520d7c 100644 --- a/InCallUI/src/com/android/incallui/CallCardPresenter.java +++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java @@ -259,6 +259,16 @@ public class CallCardPresenter extends Presenter updateContactEntry(entry, isPrimary, isConference); } } + + @Override + public void onImageLoadComplete(int callId, Bitmap photo) { + if (callId == mPrimary.getCallId()) { + getUi().setPrimaryImage(photo); + } else if (callId == mSecondary.getCallId()) { + getUi().setSecondaryImage(photo); + } + + } }); } else { Log.d(TAG, "Contact lookup. Found in memory cache: " + entry); @@ -481,6 +491,7 @@ public class CallCardPresenter extends Presenter void setPrimary(String number, String name, boolean nameIsNumber, String label, Drawable photo, boolean isConference, String gatewayLabel, String gatewayNumber); void setSecondary(boolean show, String name, String label, Drawable photo); + void setSecondaryImage(Bitmap bitmap); void setCallState(int state, Call.DisconnectCause cause, boolean bluetoothOn); void setPrimaryCallElapsedTime(boolean show, String duration); -- cgit v1.2.3