diff options
author | Roshan Pius <rpius@google.com> | 2015-09-02 06:12:56 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-09-02 06:12:56 +0000 |
commit | 5cffb54e1d4538c76748a28e10fc453ac3cbc172 (patch) | |
tree | beae5bc83c481a30e6564245a69890b5b3d5d023 | |
parent | 8fdf7d99124c8747e6632d6adf39c2314fcd2ad2 (diff) | |
parent | d5488b65ee5b266097fc69272888462ee4934c09 (diff) | |
download | android_packages_apps_ContactsCommon-5cffb54e1d4538c76748a28e10fc453ac3cbc172.tar.gz android_packages_apps_ContactsCommon-5cffb54e1d4538c76748a28e10fc453ac3cbc172.tar.bz2 android_packages_apps_ContactsCommon-5cffb54e1d4538c76748a28e10fc453ac3cbc172.zip |
am d5488b65: Reformat only KR numbers with leading "+82".
* commit 'd5488b65ee5b266097fc69272888462ee4934c09':
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); |