summaryrefslogtreecommitdiffstats
path: root/telephony/java/com/android/internal/telephony/CallerInfo.java
diff options
context:
space:
mode:
authorDavid Brown <dab@google.com>2011-11-16 22:10:56 -0800
committerDavid Brown <dab@google.com>2011-11-17 15:39:21 -0800
commit158f116eb7fdc23a12d6822d34a549f33605bc8c (patch)
treeccb2cd0c484f7ace83a98505140440ee7a5c68c1 /telephony/java/com/android/internal/telephony/CallerInfo.java
parent1733a3de8c4f98ba4df08ab79d1fef6d2684d2c2 (diff)
downloadframeworks_base-158f116eb7fdc23a12d6822d34a549f33605bc8c.zip
frameworks_base-158f116eb7fdc23a12d6822d34a549f33605bc8c.tar.gz
frameworks_base-158f116eb7fdc23a12d6822d34a549f33605bc8c.tar.bz2
Fix a crash caused by SIP addresses containing "%40" instead of "@"
CallerInfo.doSecondaryLookupIfNecessary() was assuming that SIP addresses would always contain the character '@', but that's not always true since the username/domainname delimiter can actually be "%40" (the URI-escaped equivalent.) This would cause the in-call UI to crash if you ever called a SIP address like "xyz%40example.com". TESTED: - Make an outgoing call to the SIP address "xyz%40example.com" ==> The call ultimately fails, but the in-call UI no longer crashes when it first comes up. Bug: 5637074 Change-Id: I62d15a7ccd509924d38b780b92e657b9efa26125
Diffstat (limited to 'telephony/java/com/android/internal/telephony/CallerInfo.java')
-rw-r--r--telephony/java/com/android/internal/telephony/CallerInfo.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/telephony/java/com/android/internal/telephony/CallerInfo.java b/telephony/java/com/android/internal/telephony/CallerInfo.java
index 6324550..5d1f758 100644
--- a/telephony/java/com/android/internal/telephony/CallerInfo.java
+++ b/telephony/java/com/android/internal/telephony/CallerInfo.java
@@ -288,7 +288,7 @@ public class CallerInfo {
String number, CallerInfo previousResult) {
if (!previousResult.contactExists
&& PhoneNumberUtils.isUriNumber(number)) {
- String username = number.substring(0, number.indexOf('@'));
+ String username = PhoneNumberUtils.getUsernameFromUriNumber(number);
if (PhoneNumberUtils.isGlobalPhoneNumber(username)) {
previousResult = getCallerInfo(context,
Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI,