summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2015-10-06 21:58:48 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-10-06 21:58:48 +0000
commita00ed077a498aa5fa48d9b996e4e3b914e4970ee (patch)
treed3d9d2600405768a17206b26296e7c5ab6fada3c
parentb2cbce12e198d91f848e2aa685a8f8b96aba7c6a (diff)
parentad5887d810ce027b1fffaef9e6a2e6c322887cca (diff)
am 568a22f1: Fix potential mismatched caller information
* commit '568a22f1d76c83e02b3494a506c21663897d85bb': Fix potential mismatched caller information
-rw-r--r--InCallUI/src/com/android/incallui/CallCardPresenter.java10
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);
}