diff options
author | Roshan Pius <rpius@google.com> | 2015-09-02 06:21:48 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-09-02 06:21:48 +0000 |
commit | 16e9dbbd94f2f5574f876f847ba60db15852cb4c (patch) | |
tree | 12ee01df27b9b7aaf7a37898e66c2dfc01acf1d0 | |
parent | 870b8a67390dd28872005953578727a240c6c877 (diff) | |
parent | 5cffb54e1d4538c76748a28e10fc453ac3cbc172 (diff) | |
download | android_packages_apps_ContactsCommon-16e9dbbd94f2f5574f876f847ba60db15852cb4c.tar.gz android_packages_apps_ContactsCommon-16e9dbbd94f2f5574f876f847ba60db15852cb4c.tar.bz2 android_packages_apps_ContactsCommon-16e9dbbd94f2f5574f876f847ba60db15852cb4c.zip |
am 5cffb54e: am d5488b65: Reformat only KR numbers with leading "+82".
* commit '5cffb54e1d4538c76748a28e10fc453ac3cbc172':
Reformat only KR numbers with leading "+82".
-rw-r--r-- | src/com/android/contacts/common/util/PhoneNumberHelper.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/com/android/contacts/common/util/PhoneNumberHelper.java b/src/com/android/contacts/common/util/PhoneNumberHelper.java index 11f2153b..34514024 100644 --- a/src/com/android/contacts/common/util/PhoneNumberHelper.java +++ b/src/com/android/contacts/common/util/PhoneNumberHelper.java @@ -125,10 +125,15 @@ public class PhoneNumberHelper { 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); |