diff options
Diffstat (limited to 'phone/src/com/android/phone2/CallNotifier.java')
-rwxr-xr-x | phone/src/com/android/phone2/CallNotifier.java | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/phone/src/com/android/phone2/CallNotifier.java b/phone/src/com/android/phone2/CallNotifier.java index 99c8139..46676ab 100755 --- a/phone/src/com/android/phone2/CallNotifier.java +++ b/phone/src/com/android/phone2/CallNotifier.java @@ -1842,12 +1842,36 @@ public class CallNotifier extends Handler // Do final CNAP modifications. number = PhoneUtils.modifyForSpecialCnapCases(mPhone.getContext(), callerInfo, number, presentation); - number = PhoneNumberUtils.stripSeparators(number); + + // TODO: SIP: integrate this to PhoneApp later + if (!isUri(number)) { + number = PhoneNumberUtils.stripSeparators(number); + } else { + // See which one is in the contact: entire URL or username only. + // Use that one to create the call log. + Context context = mPhone.getContext(); + CallerInfo info = CallerInfo.getCallerInfo(context, number); + if ((info == null) || (info.name == null)) { + int index = number.indexOf("@"); + if (index > 0) { + String number2 = number.substring(0, index); + info = CallerInfo.getCallerInfo(context, number2); + if ((info != null) && (info.name != null)) { + number = number2; + } + } + } + } if (VDBG) log("getLogNumber: " + number); return number; } } + private static boolean isUri(String number) { + // TODO: SIP: fix this after moving isUri() to PhoneNumberUtils + return OutgoingCallBroadcaster.isUri(number); + } + /** * Get the caller info. * |