Lines Matching refs:PhoneNumber
22 import com.android.i18n.phonenumbers.Phonenumber.PhoneNumber;
211 * Returns null if phoneNumber == null
214 extractNetworkPortion(String phoneNumber) {
215 if (phoneNumber == null) {
219 int len = phoneNumber.length();
223 char c = phoneNumber.charAt(i);
253 public static String extractNetworkPortionAlt(String phoneNumber) {
254 if (phoneNumber == null) {
258 int len = phoneNumber.length();
263 char c = phoneNumber.charAt(i);
282 * @param phoneNumber phone number to strip.
285 public static String stripSeparators(String phoneNumber) {
286 if (phoneNumber == null) {
289 int len = phoneNumber.length();
293 char c = phoneNumber.charAt(i);
316 public static String convertAndStrip(String phoneNumber) {
317 return stripSeparators(convertKeypadLettersToDigits(phoneNumber));
326 public static String convertPreDial(String phoneNumber) {
327 if (phoneNumber == null) {
330 int len = phoneNumber.length();
334 char c = phoneNumber.charAt(i);
389 * unless phoneNumber == null.
391 * Returns null if phoneNumber == null
395 extractPostDialPortion(String phoneNumber) {
396 if (phoneNumber == null) return null;
401 trimIndex = indexOfLastNetworkChar (phoneNumber);
403 for (int i = trimIndex + 1, s = phoneNumber.length()
406 char c = phoneNumber.charAt(i);
711 * Returns null if phoneNumber == null
714 toCallerIDMinMatch(String phoneNumber) {
715 String np = extractNetworkPortionAlt(phoneNumber);
724 * Returns null if phoneNumber == null
727 getStrippedReversed(String phoneNumber) {
728 String np = extractNetworkPortionAlt(phoneNumber);
1005 public static boolean isGlobalPhoneNumber(String phoneNumber) {
1006 if (TextUtils.isEmpty(phoneNumber)) {
1010 Matcher match = GLOBAL_PHONE_NUMBER_PATTERN.matcher(phoneNumber);
1153 * @deprecated Use link #formatNumber(String phoneNumber, String defaultCountryIso) instead
1172 * @deprecated Use link #formatNumber(String phoneNumber, String defaultCountryIso) instead
1188 * @deprecated Use link #formatNumber(String phoneNumber, String defaultCountryIso) instead
1205 * @deprecated Use link #formatNumber(String phoneNumber, String defaultCountryIso) instead
1254 * @deprecated Use link #formatNumber(String phoneNumber, String defaultCountryIso) instead
1370 * @deprecated Use link #formatNumber(String phoneNumber, String defaultCountryIso) instead
1394 * Formats the specified {@code phoneNumber} to the E.164 representation.
1396 * @param phoneNumber the phone number to format.
1400 public static String formatNumberToE164(String phoneNumber, String defaultCountryIso) {
1401 return formatNumberInternal(phoneNumber, defaultCountryIso, PhoneNumberFormat.E164);
1405 * Formats the specified {@code phoneNumber} to the RFC3966 representation.
1407 * @param phoneNumber the phone number to format.
1411 public static String formatNumberToRFC3966(String phoneNumber, String defaultCountryIso) {
1412 return formatNumberInternal(phoneNumber, defaultCountryIso, PhoneNumberFormat.RFC3966);
1433 PhoneNumber phoneNumber = util.parse(rawPhoneNumber, defaultCountryIso);
1434 if (util.isValidNumber(phoneNumber)) {
1435 return util.format(phoneNumber, formatIdentifier);
1443 * Determines if a {@param phoneNumber} is international if dialed from
1446 * @param phoneNumber The phone number.
1451 public static boolean isInternationalNumber(String phoneNumber, String defaultCountryIso) {
1453 if (TextUtils.isEmpty(phoneNumber)) {
1458 if (phoneNumber.startsWith("#") || phoneNumber.startsWith("*")) {
1464 PhoneNumber pn = util.parseAndKeepRawInput(phoneNumber, defaultCountryIso);
1477 * @param phoneNumber
1484 public static String formatNumber(String phoneNumber, String defaultCountryIso) {
1486 if (phoneNumber.startsWith("#") || phoneNumber.startsWith("*")) {
1487 return phoneNumber;
1493 PhoneNumber pn = util.parseAndKeepRawInput(phoneNumber, defaultCountryIso);
1498 PhoneNumber.CountryCodeSource.FROM_NUMBER_WITH_PLUS_SIGN)) {
1508 PhoneNumber.CountryCodeSource.FROM_NUMBER_WITH_PLUS_SIGN)) {
1528 * @param phoneNumber
1532 * phoneNumber doesn't have the country code.
1535 * be used if the phoneNumberE164 is null or invalid, or if phoneNumber
1541 String phoneNumber, String phoneNumberE164, String defaultCountryIso) {
1542 int len = phoneNumber.length();
1544 if (!isDialable(phoneNumber.charAt(i))) {
1545 return phoneNumber;
1555 PhoneNumber pn = util.parse(phoneNumberE164, "ZZ");
1558 // This makes sure phoneNumber doesn't contain an IDD
1559 normalizeNumber(phoneNumber).indexOf(phoneNumberE164.substring(1)) <= 0) {
1565 String result = formatNumber(phoneNumber, defaultCountryIso);
1566 return result != null ? result : phoneNumber;
1574 * @param phoneNumber the number to be normalized.
1577 public static String normalizeNumber(String phoneNumber) {
1578 if (TextUtils.isEmpty(phoneNumber)) {
1583 int len = phoneNumber.length();
1585 char c = phoneNumber.charAt(i);
1593 return normalizeNumber(PhoneNumberUtils.convertKeypadLettersToDigits(phoneNumber));
2446 * @param phoneNumber A {@code CharSequence} the entirety of which represents a phone number.
2449 public static CharSequence createTtsSpannable(CharSequence phoneNumber) {
2450 if (phoneNumber == null) {
2453 Spannable spannable = Spannable.Factory.getInstance().newSpannable(phoneNumber);
2477 * @param phoneNumber A {@code CharSequence} the entirety of which represents a phone number.
2484 public static CharSequence ttsSpanAsPhoneNumber(CharSequence phoneNumber) {
2485 return createTtsSpannable(phoneNumber);
2518 PhoneNumber phoneNumber = null;
2523 phoneNumber = phoneNumberUtil.parse(phoneNumberString, /* defaultRegion */ null);
2529 if (phoneNumber == null) {
2534 if (phoneNumber.hasCountryCode()) {
2535 builder.setCountryCode(Integer.toString(phoneNumber.getCountryCode()));
2537 builder.setNumberParts(Long.toString(phoneNumber.getNationalNumber()));