summaryrefslogtreecommitdiffstats
path: root/telephony
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2015-09-02 06:12:56 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-09-02 06:12:56 +0000
commit8750f04a73568b2002cdd50d550822ffb53d5362 (patch)
tree31cef17c22138dcecb745508743a4abb9aeb3e8d /telephony
parent9e30e20233136d499447622213e0f383e695dd04 (diff)
parenta14e900181aa03daa760e3ba6eb1e7e00d438305 (diff)
downloadframeworks_base-8750f04a73568b2002cdd50d550822ffb53d5362.zip
frameworks_base-8750f04a73568b2002cdd50d550822ffb53d5362.tar.gz
frameworks_base-8750f04a73568b2002cdd50d550822ffb53d5362.tar.bz2
am a14e9001: Merge "Reformat only KR numbers with leading "+82"." into mnc-dr-dev
* commit 'a14e900181aa03daa760e3ba6eb1e7e00d438305': Reformat only KR numbers with leading "+82".
Diffstat (limited to 'telephony')
-rw-r--r--telephony/java/android/telephony/PhoneNumberUtils.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/telephony/java/android/telephony/PhoneNumberUtils.java b/telephony/java/android/telephony/PhoneNumberUtils.java
index 273cc93..b430340 100644
--- a/telephony/java/android/telephony/PhoneNumberUtils.java
+++ b/telephony/java/android/telephony/PhoneNumberUtils.java
@@ -1457,10 +1457,15 @@ public class PhoneNumberUtils
String result = null;
try {
PhoneNumber pn = util.parseAndKeepRawInput(phoneNumber, defaultCountryIso);
+ /**
+ * Need to reformat any local Korean phone numbers (when the user is in Korea) with
+ * country code to corresponding national format which would replace the leading
+ * +82 with 0.
+ */
if (KOREA_ISO_COUNTRY_CODE.equals(defaultCountryIso) &&
- (pn.getCountryCode() == util.getCountryCodeForRegion(KOREA_ISO_COUNTRY_CODE))) {
- // Format local Korean phone numbers with country code to corresponding national
- // format which would replace the leading +82 with 0.
+ (pn.getCountryCode() == util.getCountryCodeForRegion(KOREA_ISO_COUNTRY_CODE)) &&
+ (pn.getCountryCodeSource() ==
+ PhoneNumber.CountryCodeSource.FROM_NUMBER_WITH_PLUS_SIGN)) {
result = util.format(pn, PhoneNumberUtil.PhoneNumberFormat.NATIONAL);
} else {
result = util.formatInOriginalFormat(pn, defaultCountryIso);