diff options
author | Yorke Lee <yorkelee@google.com> | 2015-10-06 22:03:09 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-10-06 22:03:09 +0000 |
commit | d123f744998e6a686fc5cb93c4e6d590c9095f5e (patch) | |
tree | 9e50739aa53c6b36e4570bd4aa8dff5b384da379 | |
parent | 558b303078935e4dcfccb436070516843552e876 (diff) | |
parent | a00ed077a498aa5fa48d9b996e4e3b914e4970ee (diff) |
am ad6e03a4: am 568a22f1: Fix potential mismatched caller information
* commit 'ad6e03a4087000459bd82b0b49366dcd18117e4b':
Fix potential mismatched caller information
-rw-r--r-- | InCallUI/src/com/android/incallui/CallCardPresenter.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java index 0cc5da1ca..d5972182b 100644 --- a/InCallUI/src/com/android/incallui/CallCardPresenter.java +++ b/InCallUI/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); } |