diff options
-rw-r--r-- | src/com/android/incallui/CallCardPresenter.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/com/android/incallui/CallCardPresenter.java b/src/com/android/incallui/CallCardPresenter.java index 0cc5da1c..d5972182 100644 --- a/src/com/android/incallui/CallCardPresenter.java +++ b/src/com/android/incallui/CallCardPresenter.java @@ -513,7 +513,15 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> } private void onContactInfoComplete(String callId, ContactCacheEntry entry, boolean isPrimary) { - updateContactEntry(entry, isPrimary); + final boolean entryMatchesExistingCall = + (isPrimary && mPrimary != null && TextUtils.equals(callId, mPrimary.getId())) || + (!isPrimary && mSecondary != null && TextUtils.equals(callId, mSecondary.getId())); + if (entryMatchesExistingCall) { + updateContactEntry(entry, isPrimary); + } else { + Log.w(this, "Dropping stale contact lookup info for " + callId); + } + if (entry.name != null) { Log.d(TAG, "Contact found: " + entry); } |