Loading telephony/java/android/telephony/PhoneNumberUtils.java +24 −4 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import android.telephony.Rlog; import android.util.SparseIntArray; import static com.android.internal.telephony.MSimConstants.SUBSCRIPTION_KEY; import static com.android.internal.telephony.PhoneConstants.IP_CALL; import static com.android.internal.telephony.TelephonyProperties.PROPERTY_ICC_OPERATOR_ISO_COUNTRY; import static com.android.internal.telephony.TelephonyProperties.PROPERTY_IDP_STRING; import static com.android.internal.telephony.TelephonyProperties.PROPERTY_OPERATOR_ISO_COUNTRY; Loading Loading @@ -81,6 +82,11 @@ public class PhoneNumberUtils static final String LOG_TAG = "PhoneNumberUtils"; private static final boolean DBG = false; /** * Used for multi Sim IP Call Prefix Setting. */ private static final String IP_CALL_PREFIX = "ip_call_prefix_sub"; /* * global-phone-number = ["+"] 1*( DIGIT / written-sep ) * written-sep = ("-"/".") Loading Loading @@ -143,6 +149,16 @@ public class PhoneNumberUtils return !isDialable(ch) && !(('a' <= ch && ch <= 'z') || ('A' <= ch && ch <= 'Z')); } private static String checkAndAppendPrefix(Intent intent, int subscription, String number, Context context) { boolean isIPPrefix = intent.getBooleanExtra(IP_CALL, false); if (isIPPrefix && number != null && subscription < MSimTelephonyManager.getDefault().getPhoneCount()) { return IP_CALL_PREFIX + subscription + number; } return number; } /** Extracts the phone number from an Intent. * * @param intent the intent to get the number of Loading @@ -161,17 +177,21 @@ public class PhoneNumberUtils } String scheme = uri.getScheme(); int subscription = 0; if (MSimTelephonyManager.getDefault().isMultiSimEnabled()) { subscription = intent.getIntExtra(SUBSCRIPTION_KEY, MSimTelephonyManager.getDefault().getPreferredVoiceSubscription()); } if (scheme.equals("tel") || scheme.equals("sip")) { return uri.getSchemeSpecificPart(); return checkAndAppendPrefix(intent, subscription, uri.getSchemeSpecificPart(), context); } // TODO: We don't check for SecurityException here (requires // CALL_PRIVILEGED permission). if (scheme.equals("voicemail")) { if (MSimTelephonyManager.getDefault().isMultiSimEnabled()) { int subscription = intent.getIntExtra(SUBSCRIPTION_KEY, MSimTelephonyManager.getDefault().getPreferredVoiceSubscription()); return MSimTelephonyManager.getDefault() .getCompleteVoiceMailNumber(subscription); } Loading Loading @@ -206,7 +226,7 @@ public class PhoneNumberUtils } } return number; return checkAndAppendPrefix(intent, subscription, number, context); } /** Extracts the network address portion and canonicalizes Loading telephony/java/com/android/internal/telephony/PhoneConstants.java +2 −0 Original line number Diff line number Diff line Loading @@ -86,6 +86,8 @@ public class PhoneConstants { public static final String REASON_LINK_PROPERTIES_CHANGED = "linkPropertiesChanged"; public static final String IP_CALL = "ip_call"; /** * Return codes for supplyPinReturnResult and * supplyPukReturnResult APIs Loading Loading
telephony/java/android/telephony/PhoneNumberUtils.java +24 −4 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import android.telephony.Rlog; import android.util.SparseIntArray; import static com.android.internal.telephony.MSimConstants.SUBSCRIPTION_KEY; import static com.android.internal.telephony.PhoneConstants.IP_CALL; import static com.android.internal.telephony.TelephonyProperties.PROPERTY_ICC_OPERATOR_ISO_COUNTRY; import static com.android.internal.telephony.TelephonyProperties.PROPERTY_IDP_STRING; import static com.android.internal.telephony.TelephonyProperties.PROPERTY_OPERATOR_ISO_COUNTRY; Loading Loading @@ -81,6 +82,11 @@ public class PhoneNumberUtils static final String LOG_TAG = "PhoneNumberUtils"; private static final boolean DBG = false; /** * Used for multi Sim IP Call Prefix Setting. */ private static final String IP_CALL_PREFIX = "ip_call_prefix_sub"; /* * global-phone-number = ["+"] 1*( DIGIT / written-sep ) * written-sep = ("-"/".") Loading Loading @@ -143,6 +149,16 @@ public class PhoneNumberUtils return !isDialable(ch) && !(('a' <= ch && ch <= 'z') || ('A' <= ch && ch <= 'Z')); } private static String checkAndAppendPrefix(Intent intent, int subscription, String number, Context context) { boolean isIPPrefix = intent.getBooleanExtra(IP_CALL, false); if (isIPPrefix && number != null && subscription < MSimTelephonyManager.getDefault().getPhoneCount()) { return IP_CALL_PREFIX + subscription + number; } return number; } /** Extracts the phone number from an Intent. * * @param intent the intent to get the number of Loading @@ -161,17 +177,21 @@ public class PhoneNumberUtils } String scheme = uri.getScheme(); int subscription = 0; if (MSimTelephonyManager.getDefault().isMultiSimEnabled()) { subscription = intent.getIntExtra(SUBSCRIPTION_KEY, MSimTelephonyManager.getDefault().getPreferredVoiceSubscription()); } if (scheme.equals("tel") || scheme.equals("sip")) { return uri.getSchemeSpecificPart(); return checkAndAppendPrefix(intent, subscription, uri.getSchemeSpecificPart(), context); } // TODO: We don't check for SecurityException here (requires // CALL_PRIVILEGED permission). if (scheme.equals("voicemail")) { if (MSimTelephonyManager.getDefault().isMultiSimEnabled()) { int subscription = intent.getIntExtra(SUBSCRIPTION_KEY, MSimTelephonyManager.getDefault().getPreferredVoiceSubscription()); return MSimTelephonyManager.getDefault() .getCompleteVoiceMailNumber(subscription); } Loading Loading @@ -206,7 +226,7 @@ public class PhoneNumberUtils } } return number; return checkAndAppendPrefix(intent, subscription, number, context); } /** Extracts the network address portion and canonicalizes Loading
telephony/java/com/android/internal/telephony/PhoneConstants.java +2 −0 Original line number Diff line number Diff line Loading @@ -86,6 +86,8 @@ public class PhoneConstants { public static final String REASON_LINK_PROPERTIES_CHANGED = "linkPropertiesChanged"; public static final String IP_CALL = "ip_call"; /** * Return codes for supplyPinReturnResult and * supplyPukReturnResult APIs Loading