Also look up number as an "Internet call" address.
If a number in the call log is not found as the number of a contact,
also check whether the number was added as part of an "Internet call"
address for one of the contacts.
Normally, one should put a full SIP address in the "Internet call"
address, but it is possible to put just a plain phone number and that
still correcly works to dial that number using the internet calling
feature.
However, the call log does not correctly match the number in that case,
because a plain phone number is never looked up as an "Internet call"
address.
This commit adds that look-up, if the regular look-up of a phone number
fails.
Bug: 5390273
Change-Id: Ibb722083ea1e0166bdd630a6f12f678a90de41eb
diff --git a/src/com/android/contacts/calllog/ContactInfoHelper.java b/src/com/android/contacts/calllog/ContactInfoHelper.java
index c837c9a..f1987ce 100644
--- a/src/com/android/contacts/calllog/ContactInfoHelper.java
+++ b/src/com/android/contacts/calllog/ContactInfoHelper.java
@@ -67,7 +67,14 @@
}
info = sipInfo;
} else {
- info = queryContactInfoForPhoneNumber(number, countryIso);
+ // Look for a contact that has the given phone number.
+ ContactInfo phoneInfo = queryContactInfoForPhoneNumber(number, countryIso);
+
+ if (phoneInfo == null || phoneInfo == ContactInfo.EMPTY) {
+ // Check whether the phone number has been saved as an "Internet call" number.
+ phoneInfo = queryContactInfoForSipAddress(number);
+ }
+ info = phoneInfo;
}
final ContactInfo updatedInfo;