diff options
Diffstat (limited to 'telephony/java')
| -rw-r--r-- | telephony/java/android/telephony/CarrierConfigManager.java | 10 | ||||
| -rw-r--r-- | telephony/java/android/telephony/PhoneNumberUtils.java | 11 |
2 files changed, 18 insertions, 3 deletions
diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java index 6a0bf64..df8affe 100644 --- a/telephony/java/android/telephony/CarrierConfigManager.java +++ b/telephony/java/android/telephony/CarrierConfigManager.java @@ -404,6 +404,15 @@ public class CarrierConfigManager { public static final String KEY_MMS_UA_PROF_URL_STRING = "uaProfUrl"; public static final String KEY_MMS_USER_AGENT_STRING = "userAgent"; + /** + * Determines whether the carrier supports making non-emergency phone calls while the phone is + * in emergency callback mode. Default value is {@code true}, meaning that non-emergency calls + * are allowed in emergency callback mode. + * @hide + */ + public static final String KEY_ALLOW_NON_EMERGENCY_CALLS_IN_ECM_BOOL = + "allow_non_emergency_calls_in_ecm_bool"; + /** The default value for every variable. */ private final static PersistableBundle sDefaults; @@ -496,6 +505,7 @@ public class CarrierConfigManager { sDefaults.putString(KEY_MMS_UA_PROF_TAG_NAME_STRING, "x-wap-profile"); sDefaults.putString(KEY_MMS_UA_PROF_URL_STRING, ""); sDefaults.putString(KEY_MMS_USER_AGENT_STRING, ""); + sDefaults.putBoolean(KEY_ALLOW_NON_EMERGENCY_CALLS_IN_ECM_BOOL, true); } /** 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); |
