summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2015-10-02 14:54:16 -0700
committerYorke Lee <yorkelee@google.com>2015-10-02 14:55:11 -0700
commit568a22f1d76c83e02b3494a506c21663897d85bb (patch)
tree33a806d18fc78ddd2e853f36e6382ba2247ecb6d
parentefabe88a8dc60d6f9187bebc4756f0bdedfcb925 (diff)
downloadInCallUI-568a22f1d76c83e02b3494a506c21663897d85bb.tar.gz
Fix potential mismatched caller information
This fixes a bug where caller information returned for a call waiting would be mistakenedly applied to an existing call by ensuring that the returned contact information is only assigned to the call that initiated the lookup. 1) Active call A is in progress 2) Incoming call B (call waiting) 3) Contact info lookup is initiated for call B 4) Call B is rejected 5) Contact info is returned 6) UI for call A is updated with the returned info Bug: 24591055 Change-Id: I41e0741d8bc01a2fe98d77cb080d1df455b1e5df
-rw-r--r--src/com/android/incallui/CallCardPresenter.java10
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);
}