Lines Matching defs:number

48  * Various utilities for dealing with phone number strings.
55 * (See "What is a phone number?" doc)
82 * global-phone-number = ["+"] 1*( DIGIT / written-sep )
143 /** Extracts the phone number from an Intent.
145 * @param intent the intent to get the number of
148 * @return the phone number that would be called by the intent, or
149 * <code>null</code> if the number cannot be found.
152 String number = null;
188 number = c.getString(c.getColumnIndex(phoneColumn));
195 return number;
276 * Strips separators from a phone number string.
277 * @param phoneNumber phone number to strip.
501 // if the number of dialable chars in a and b match, but the matched chars < MIN_MATCH,
577 // Different Country Calling Code. Must be different phone number.
670 // - the remaining non-separator number is 1
731 * Returns the last numDigits of the reversed phone number
754 * TOA_International number
787 * See Also TS 51.011 10.5.1 "dialing number/ssc string"
792 * @param length is the number of bytes including TOA byte
823 // This is an "international number" and should have
824 // a plus prepended to the dialing number. But there
844 // where there is no dialing number so they
854 // So no dialing number and we'll just
864 // Assume group 4 is a dialing number
880 // number (i.e. group 4) such as *31#+11234567890.
1047 * Convert a dialing number to BCD byte array
1049 * @param number dialing number string
1050 * if the dialing number starts with '+', set to international TOA
1054 numberToCalledPartyBCD(String number) {
1055 return numberToCalledPartyBCDHelper(number, false);
1063 numberToCalledPartyBCDHelper(String number, boolean includeLength) {
1064 int numberLenReal = number.length();
1066 boolean hasPlus = number.indexOf('+') != -1;
1080 char c = number.charAt(i);
1135 * Breaks the given number down and formats it according to the rules
1136 * for the country the number is from.
1138 * @param source The phone number to format
1140 * formatting rules aren't known for the number
1149 * Formats the given number with the given formatting type. Currently
1152 * @param source the phone number to format
1153 * @param defaultFormattingType The default formatting rules to apply if the number does
1155 * @return The phone number formatted with the given formatting type.
1166 * Returns the phone number formatting type for the given locale.
1179 * Formats a phone number in-place. Currently {@link #FORMAT_JAPAN} and {@link #FORMAT_NANP}
1182 * @param text The number to be formatted, will be modified with the formatting
1183 * @param defaultFormattingType The default formatting rules to apply if the number does
1219 * Formats a phone number in-place using the NANP formatting rules. Numbers will be formatted
1230 * @param text the number to be formatted, will be modified with the formatting
1248 // When scanning the number we record where dashes need to be added,
1275 // Only NANP number supported for now
1331 * Formats a phone number in-place using the Japanese formatting rules.
1342 * @param text the number to be formatted, will be modified with
1350 * Removes all dashes from the number.
1352 * @param text the number to clear from dashes
1368 * The given phone number must have an area code and could have a country
1371 * The defaultCountryIso is used to validate the given number and generate
1372 * the E.164 phone number if the given number doesn't have a country code.
1375 * the phone number to format
1378 * @return the E.164 representation, or null if the given phone number is
1397 * Format a phone number.
1399 * If the given number doesn't have the country code, the phone will be
1403 * the number to be formatted.
1406 * be used if the given number doesn't have the country code.
1407 * @return the formatted number, or null if the given number is not valid.
1428 * Format the phone number only if the given number hasn't been formatted.
1430 * The number which has only dailable character is treated as not being
1434 * the number to be formatted.
1436 * the E164 format number whose country code is used if the given
1442 * @return the formatted number if the given number has been formatted,
1443 * otherwise, return the given number.
1460 // The number to be parsed is in E164 format, so the default region used doesn't
1477 * Normalize a phone number by removing the characters other than digits. If
1478 * the given number has keypad letters, the letters will be converted to
1482 * the number to be normalized.
1483 * @return the normalized number.
1507 * @param number
1508 * the number to be normalized.
1509 * @return the replaced number.
1513 public static String replaceUnicodeDigits(String number) {
1514 StringBuilder normalizedDigits = new StringBuilder(number.length());
1515 for (char c : number.toCharArray()) {
1546 * Checks a given number against the list of
1549 * @param number the number to look up.
1550 * @return true if the number is in the list of emergency numbers
1553 public static boolean isEmergencyNumber(String number) {
1554 // Return true only if the specified number *exactly* matches
1556 return isEmergencyNumberInternal(number, true /* useExactMatch */);
1560 * Checks if given number might *potentially* result in
1563 * Specifically, this method will return true if the specified number
1564 * is an emergency number according to the list managed by the RIL or
1565 * SIM, *or* if the specified number simply starts with the same
1572 * @param number the number to look up.
1573 * @return true if the number is in the list of emergency numbers
1574 * listed in the RIL / SIM, *or* if the number starts with the
1579 public static boolean isPotentialEmergencyNumber(String number) {
1582 return isEmergencyNumberInternal(number, false /* useExactMatch */);
1589 * @param number the number to look up.
1591 * @param useExactMatch if true, consider a number to be an emergency
1592 * number only if it *exactly* matches a number listed in
1593 * the RIL / SIM. If false, a number is considered to be an
1594 * emergency number if it simply starts with the same digits
1597 * number that could *potentially* result in emergency calls
1599 * after a valid emergency number.)
1601 * @return true if the number is in the list of emergency numbers
1604 private static boolean isEmergencyNumberInternal(String number, boolean useExactMatch) {
1605 return isEmergencyNumberInternal(number, null, useExactMatch);
1609 * Checks if a given number is an emergency number for a specific country.
1611 * @param number the number to look up.
1612 * @param defaultCountryIso the specific country which the number should be checked against
1613 * @return if the number is an emergency number for the specific country, then return true,
1618 public static boolean isEmergencyNumber(String number, String defaultCountryIso) {
1619 return isEmergencyNumberInternal(number,
1625 * Checks if a given number might *potentially* result in a call to an
1628 * Specifically, this method will return true if the specified number
1629 * is an emergency number in the specified country, *or* if the number
1630 * simply starts with the same digits as any emergency number for that
1637 * @param number the number to look up.
1638 * @param defaultCountryIso the specific country which the number should be checked against
1639 * @return true if the number is an emergency number for the specific
1640 * country, *or* if the number starts with the same digits as
1645 public static boolean isPotentialEmergencyNumber(String number, String defaultCountryIso) {
1646 return isEmergencyNumberInternal(number,
1655 * @param number the number to look up.
1656 * @param defaultCountryIso the specific country which the number should be checked against
1657 * @param useExactMatch if true, consider a number to be an emergency
1658 * number only if it *exactly* matches a number listed in
1659 * the RIL / SIM. If false, a number is considered to be an
1660 * emergency number if it simply starts with the same digits
1663 * @return true if the number is an emergency number for the specified country.
1665 private static boolean isEmergencyNumberInternal(String number,
1668 // If the number passed in is null, just return false:
1669 if (number == null) return false;
1671 // If the number passed in is a SIP address, return false, since the
1678 if (isUriNumber(number)) {
1682 // Strip the separators from the number before comparing it
1684 number = extractNetworkPortionAlt(number);
1698 // It is not possible to append additional digits to an emergency number to dial
1699 // the number in Brazil - it won't connect.
1701 if (number.equals(emergencyNum)) {
1705 if (number.startsWith(emergencyNum)) {
1721 return util.isEmergencyNumber(number, defaultCountryIso);
1723 return util.connectsToEmergencyNumber(number, defaultCountryIso);
1727 return (number.equals("112") || number.equals("911"));
1729 return (number.startsWith("112") || number.startsWith("911"));
1735 * Checks if a given number is an emergency number for the country that the user is in. The
1738 * @param number the number to look up.
1739 * @param context the specific context which the number should be checked against
1740 * @return true if the specified number is an emergency number for a local country, based on the
1746 public static boolean isLocalEmergencyNumber(String number, Context context) {
1747 return isLocalEmergencyNumberInternal(number,
1753 * Checks if a given number might *potentially* result in a call to an
1757 * Specifically, this method will return true if the specified number
1758 * is an emergency number in the current country, *or* if the number
1759 * simply starts with the same digits as any emergency number for the
1766 * @param number the number to look up.
1767 * @param context the specific context which the number should be checked against
1768 * @return true if the specified number is an emergency number for a local country, based on the
1774 public static boolean isPotentialLocalEmergencyNumber(String number, Context context) {
1775 return isLocalEmergencyNumberInternal(number,
1784 * @param number the number to look up.
1785 * @param context the specific context which the number should be checked against
1786 * @param useExactMatch if true, consider a number to be an emergency
1787 * number only if it *exactly* matches a number listed in
1788 * the RIL / SIM. If false, a number is considered to be an
1789 * emergency number if it simply starts with the same digits
1792 * @return true if the specified number is an emergency number for a
1797 private static boolean isLocalEmergencyNumberInternal(String number,
1811 return isEmergencyNumberInternal(number, countryIso, useExactMatch);
1815 * isVoiceMailNumber: checks a given number against the voicemail
1816 * number provided by the RIL and SIM card. The caller must have
1819 * @param number the number to look up.
1820 * @return true if the number is in the list of voicemail. False
1822 * to read the VM number.
1825 public static boolean isVoiceMailNumber(String number) {
1834 // Strip the separators from the number before comparing it
1836 number = extractNetworkPortionAlt(number);
1840 return !TextUtils.isEmpty(number) && compare(number, vmNumber);
1845 * specified phone number into the equivalent numeric digits,
1911 * This function checks if there is a plus sign (+) in the passed-in dialing number.
1988 // Format the string based on the rules for the country the number is from,
2128 * Determines if the specified number is actually a URI
2129 * (i.e. a SIP address) rather than a regular PSTN phone number,
2130 * based on whether or not the number contains an "@" character.
2133 * @param number
2134 * @return true if number contains @
2136 public static boolean isUriNumber(String number) {
2139 // will ever be found in a legal PSTN number.)
2140 return number != null && (number.contains("@") || number.contains("%40"));
2147 * @param number SIP address of the form "username@domainname"
2153 public static String getUsernameFromUriNumber(String number) {
2156 int delimiterIndex = number.indexOf('@');
2158 delimiterIndex = number.indexOf("%40");
2162 "getUsernameFromUriNumber: no delimiter found in SIP addr '" + number + "'");
2163 delimiterIndex = number.length();
2165 return number.substring(0, delimiterIndex);
2170 * If the number format is
2179 // Convert the plus sign to the default IDP since it's an international number
2235 * This method takes a phone number and makes a valid SQL "LIKE"
2354 * If true, the number is country calling code.