summaryrefslogtreecommitdiff
path: root/InCallUI/src/com/android/incallui
diff options
context:
space:
mode:
authorChristine Chen <christinech@google.com>2013-09-06 17:49:24 -0700
committerChristine Chen <christinech@google.com>2013-09-06 17:49:24 -0700
commit7a863a056a96638c32171f721d99c694a1890df8 (patch)
tree75f8a3a9fda6d4b2c1cceddc592a0efed394f7b5 /InCallUI/src/com/android/incallui
parent24deb0f78f1854bfc273bb888e7fd4ac123bcc22 (diff)
Fixes bug where photo is only set to primary call.
Bug: 10653476 Change-Id: Icc2e31215c6e3fa59266e3c6b1e3ac2935770e49
Diffstat (limited to 'InCallUI/src/com/android/incallui')
-rw-r--r--InCallUI/src/com/android/incallui/CallCardPresenter.java20
1 files changed, 11 insertions, 9 deletions
diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java
index ee587067f..94f787639 100644
--- a/InCallUI/src/com/android/incallui/CallCardPresenter.java
+++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java
@@ -118,7 +118,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
@Override
public void onStateChange(InCallState state, CallList callList) {
- Log.d(TAG, "onStateChange() " + state);
+ Log.d(this, "onStateChange() " + state);
final CallCardUi ui = getUi();
if (ui == null) {
return;
@@ -253,8 +253,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
if (entry.label == null) {
// Name not found. Try lookup.
Log.d(TAG, "Contact lookup. Contact provider miss. Searching people api.");
- lookupPhoneNumber(identification.getNumber(),
- isPrimary, isConference);
+ lookupPhoneNumber(identification.getNumber(), isPrimary, isConference);
} else {
Log.d(TAG, "Contact lookup. Found in contact provider: " + entry);
updateContactEntry(entry, isPrimary, isConference);
@@ -263,12 +262,11 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
@Override
public void onImageLoadComplete(int callId, Bitmap photo) {
- if (callId == mPrimary.getCallId()) {
+ if (mPrimary != null && callId == mPrimary.getCallId()) {
getUi().setPrimaryImage(photo);
- } else if (callId == mSecondary.getCallId()) {
+ } else if (mSecondary != null && callId == mSecondary.getCallId()) {
getUi().setSecondaryImage(photo);
}
-
}
});
} else {
@@ -409,7 +407,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
updateContactEntry(entry, isPrimary, isConference);
if (info.getImageUrl() != null) {
- fetchImage(info.getImageUrl());
+ fetchImage(info.getImageUrl(), isPrimary);
}
}
});
@@ -457,13 +455,17 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
!TextUtils.isEmpty(mPrimary.getGatewayPackage()));
}
- private void fetchImage(final String url) {
+ private void fetchImage(final String url, final boolean isPrimary) {
if (url != null && mPhoneNumberService != null) {
mPhoneNumberService.fetchImage(url, new PhoneNumberService.ImageLookupListener() {
@Override
public void onImageFetchComplete(Bitmap bitmap) {
if (getUi() != null) {
- getUi().setPrimaryImage(bitmap);
+ if (isPrimary) {
+ getUi().setPrimaryImage(bitmap);
+ } else {
+ getUi().setSecondaryImage(bitmap);
+ }
}
}
});