summaryrefslogtreecommitdiffstats
path: root/telephony/java/android
diff options
context:
space:
mode:
authorDavid Brown <dab@google.com>2010-10-08 12:14:48 -0700
committerDavid Brown <dab@google.com>2010-10-10 16:40:21 -0700
commitd07833f54b6e8e361b666ae16efa15fdf60159de (patch)
treeb60b0325c3e735eceb9c5a01b5cc23789deeeeb7 /telephony/java/android
parent2f77c3e4de3d68904a6a872d53283775b3a5c349 (diff)
downloadframeworks_base-d07833f54b6e8e361b666ae16efa15fdf60159de.zip
frameworks_base-d07833f54b6e8e361b666ae16efa15fdf60159de.tar.gz
frameworks_base-d07833f54b6e8e361b666ae16efa15fdf60159de.tar.bz2
Don't manually create CallerInfo objects from SipPhone
Currently the SipPhone class manually creates a CallerInfo object, and populates it with very basic info from the SIP address, when making an outgoing call. But this is no longer needed, now that we do caller-id lookup properly for SIP addresses (based on real data from the contacts database -- see bug 3004127 and change https://android-git.corp.google.com/g/70555). And in fact the presence of this initial CallerInfo object actually *disabled* contacts lookup for outgoing calls (bug 3072731). This change removes all that CallerInfo-related stuff from SipPhone. (Thus SipPhone is now consistent with the other phone objects, like GSMPhone and CDMAPhone, in that it doesn't muck with CallerInfo data at all, but instead lets the phone app do it.) Also, update isUriNumber() to handle "%40" in case the passed-in string is URI-escaped. (Nobody depends on that now, but it may be needed in the future, and it's certainly safe to say that "%40" will never be found in a legal PSTN number.) TESTED: - Outgoing SIP call: - In-call UI shows correct contact info - After the call, Call Log shows correct contact info - Incoming SIP call: - In-call UI shows correct contact info - After the call, Call Log shows correct contact info - PSTN calls: - correct contact info everywhere Bug: 3072731 Change-Id: I51434e4e5ad66d2e8ff51fc220001fb74485f0f5
Diffstat (limited to 'telephony/java/android')
-rw-r--r--telephony/java/android/telephony/PhoneNumberUtils.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/telephony/java/android/telephony/PhoneNumberUtils.java b/telephony/java/android/telephony/PhoneNumberUtils.java
index b4a3c95..5542c42 100644
--- a/telephony/java/android/telephony/PhoneNumberUtils.java
+++ b/telephony/java/android/telephony/PhoneNumberUtils.java
@@ -1649,12 +1649,19 @@ public class PhoneNumberUtils
}
/**
+ * Determines if the specified number is actually a URI
+ * (i.e. a SIP address) rather than a regular PSTN phone number,
+ * based on whether or not the number contains an "@" character.
+ *
* @hide
* @param number
* @return true if number contains @
*/
public static boolean isUriNumber(String number) {
- return number != null && number.contains("@");
+ // Note we allow either "@" or "%40" to indicate a URI, in case
+ // the passed-in string is URI-escaped. (Neither "@" nor "%40"
+ // will ever be found in a legal PSTN number.)
+ return number != null && (number.contains("@") || number.contains("%40"));
}
/**