summaryrefslogtreecommitdiffstats
path: root/telephony/java
diff options
context:
space:
mode:
authorJake Hamby <jhamby@google.com>2013-11-04 15:22:55 -0800
committerJake Hamby <jhamby@google.com>2013-11-04 15:22:55 -0800
commit921bf624622962ad862e470c11e0f6cc508f25a8 (patch)
treea6cca0f59c2419421db6d559baf9ef8c8a847b99 /telephony/java
parent60999fcb2ed251ec4e24eccf94b66e35b851b415 (diff)
downloadframeworks_base-921bf624622962ad862e470c11e0f6cc508f25a8.zip
frameworks_base-921bf624622962ad862e470c11e0f6cc508f25a8.tar.gz
frameworks_base-921bf624622962ad862e470c11e0f6cc508f25a8.tar.bz2
Add PhoneNumberUtils method for CDMA SMS number formatting.
For CDMA networks, convert "+" prefix to "011" if the home network is using the North American Numbering Plan (NANP). New method is only used for MO SMS messages. Bug: 11360679 Change-Id: I534e0322b566de3fb49d7333bfcf62cfbfafb78a
Diffstat (limited to 'telephony/java')
-rw-r--r--telephony/java/android/telephony/PhoneNumberUtils.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/telephony/java/android/telephony/PhoneNumberUtils.java b/telephony/java/android/telephony/PhoneNumberUtils.java
index ab429fd..e3a1aa6 100644
--- a/telephony/java/android/telephony/PhoneNumberUtils.java
+++ b/telephony/java/android/telephony/PhoneNumberUtils.java
@@ -1957,6 +1957,27 @@ public class PhoneNumberUtils
}
/**
+ * Process phone number for CDMA, converting plus code using the home network number format.
+ * This is used for outgoing SMS messages.
+ *
+ * @param dialStr the original dial string
+ * @return the converted dial string
+ * @hide for internal use
+ */
+ public static String cdmaCheckAndProcessPlusCodeForSms(String dialStr) {
+ if (!TextUtils.isEmpty(dialStr)) {
+ if (isReallyDialable(dialStr.charAt(0)) && isNonSeparator(dialStr)) {
+ String defaultIso = SystemProperties.get(PROPERTY_ICC_OPERATOR_ISO_COUNTRY, "");
+ if (!TextUtils.isEmpty(defaultIso)) {
+ int format = getFormatTypeFromCountryCode(defaultIso);
+ return cdmaCheckAndProcessPlusCodeByNumberFormat(dialStr, format, format);
+ }
+ }
+ }
+ return dialStr;
+ }
+
+ /**
* This function should be called from checkAndProcessPlusCode only
* And it is used for test purpose also.
*