Merge "Reformat only KR numbers with leading "+82"." into mnc-dr-dev
This commit is contained in:
@@ -1457,10 +1457,15 @@ public class PhoneNumberUtils
|
|||||||
String result = null;
|
String result = null;
|
||||||
try {
|
try {
|
||||||
PhoneNumber pn = util.parseAndKeepRawInput(phoneNumber, defaultCountryIso);
|
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) &&
|
if (KOREA_ISO_COUNTRY_CODE.equals(defaultCountryIso) &&
|
||||||
(pn.getCountryCode() == util.getCountryCodeForRegion(KOREA_ISO_COUNTRY_CODE))) {
|
(pn.getCountryCode() == util.getCountryCodeForRegion(KOREA_ISO_COUNTRY_CODE)) &&
|
||||||
// Format local Korean phone numbers with country code to corresponding national
|
(pn.getCountryCodeSource() ==
|
||||||
// format which would replace the leading +82 with 0.
|
PhoneNumber.CountryCodeSource.FROM_NUMBER_WITH_PLUS_SIGN)) {
|
||||||
result = util.format(pn, PhoneNumberUtil.PhoneNumberFormat.NATIONAL);
|
result = util.format(pn, PhoneNumberUtil.PhoneNumberFormat.NATIONAL);
|
||||||
} else {
|
} else {
|
||||||
result = util.formatInOriginalFormat(pn, defaultCountryIso);
|
result = util.formatInOriginalFormat(pn, defaultCountryIso);
|
||||||
|
|||||||
Reference in New Issue
Block a user