Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ad5887d8 authored by Yorke Lee's avatar Yorke Lee
Browse files

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
parent 147d5df2
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -513,7 +513,15 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
    }

    private void onContactInfoComplete(String callId, ContactCacheEntry entry, boolean 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);
        }