/external/libphonenumber/libphonenumber/test/com/google/i18n/phonenumbers/ |
D | PhoneNumberUtilTest.java | 119 assertTrue(phoneUtil.getSupportedRegions().size() > 0); in testGetSupportedRegions() 124 phoneUtil.getSupportedGlobalNetworkCallingCodes(); in testGetSupportedGlobalNetworkCallingCodes() 128 assertEquals(RegionCode.UN001, phoneUtil.getRegionCodeForCountryCode(callingCode)); in testGetSupportedGlobalNetworkCallingCodes() 133 Set<Integer> callingCodes = phoneUtil.getSupportedCallingCodes(); in testGetSupportedCallingCodes() 137 assertTrue(phoneUtil.getRegionCodeForCountryCode(callingCode) != RegionCode.ZZ); in testGetSupportedCallingCodes() 140 assertTrue(callingCodes.size() > phoneUtil.getSupportedGlobalNetworkCallingCodes().size()); in testGetSupportedCallingCodes() 146 assertNull(phoneUtil.getMetadataForRegion("No Such Region")); in testGetInstanceLoadBadMetadata() 147 assertNull(phoneUtil.getMetadataForNonGeographicalRegion(-1)); in testGetInstanceLoadBadMetadata() 151 assertTrue(phoneUtil.getSupportedTypesForRegion(RegionCode.BR) in testGetSupportedTypesForRegion() 154 assertFalse(phoneUtil.getSupportedTypesForRegion(RegionCode.BR) in testGetSupportedTypesForRegion() [all …]
|
D | PhoneNumberMatcherTest.java | 251 phoneUtil.findNumbers(text, RegionCode.US).iterator(); in testFourMatchesInARow() 271 phoneUtil.findNumbers(text, RegionCode.US).iterator(); in testMatchesFoundWithMultipleSpaces() 284 phoneUtil.findNumbers(zipPreceding, RegionCode.US).iterator(); in testMatchWithSurroundingZipcodes() 292 iterator = phoneUtil.findNumbers(zipFollowing, RegionCode.US).iterator(); in testMatchWithSurroundingZipcodes() 404 number1.setCountryCode(phoneUtil.getCountryCodeForRegion(region)); in testMatchesMultiplePhoneNumbersSeparatedByPhoneNumberPunctuation() 409 number2.setCountryCode(phoneUtil.getCountryCodeForRegion(region)); in testMatchesMultiplePhoneNumbersSeparatedByPhoneNumberPunctuation() 413 Iterator<PhoneNumberMatch> matches = phoneUtil.findNumbers(text, region).iterator(); in testMatchesMultiplePhoneNumbersSeparatedByPhoneNumberPunctuation() 423 assertTrue(hasNoMatches(phoneUtil.findNumbers(text, region))); in testDoesNotMatchMultiplePhoneNumbersSeparatedWithNoWhiteSpace() 652 hasNoMatches(phoneUtil.findNumbers(text, region))); in findMatchesInContexts() 661 hasNoMatches(phoneUtil.findNumbers(text, region, Leniency.POSSIBLE, in findMatchesInContexts() [all …]
|
D | AsYouTypeFormatterTest.java | 30 AsYouTypeFormatter formatter = phoneUtil.getAsYouTypeFormatter(RegionCode.ZZ); in testInvalidRegion() 52 AsYouTypeFormatter formatter = phoneUtil.getAsYouTypeFormatter(RegionCode.ZZ); in testInvalidPlusSign() 72 AsYouTypeFormatter formatter = phoneUtil.getAsYouTypeFormatter(RegionCode.ZZ); in testTooLongNumberMatchingMultipleLeadingDigits() 92 AsYouTypeFormatter formatter = phoneUtil.getAsYouTypeFormatter(RegionCode.BY); in testCountryWithSpaceInNationalPrefixFormattingRule() 107 AsYouTypeFormatter formatter = phoneUtil.getAsYouTypeFormatter(RegionCode.BY); in testCountryWithSpaceInNationalPrefixFormattingRuleAndLongNdd() 121 AsYouTypeFormatter formatter = phoneUtil.getAsYouTypeFormatter(RegionCode.US); in testAYTFUS() 215 AsYouTypeFormatter formatter = phoneUtil.getAsYouTypeFormatter(RegionCode.US); in testAYTFUSFullWidthCharacters() 229 AsYouTypeFormatter formatter = phoneUtil.getAsYouTypeFormatter(RegionCode.US); in testAYTFUSMobileShortCode() 238 AsYouTypeFormatter formatter = phoneUtil.getAsYouTypeFormatter(RegionCode.US); in testAYTFUSVanityNumber() 254 AsYouTypeFormatter formatter = phoneUtil.getAsYouTypeFormatter(RegionCode.US); in testAYTFAndRememberPositionUS() [all …]
|
D | TestMetadataTestCase.java | 40 protected final PhoneNumberUtil phoneUtil; field in TestMetadataTestCase 43 phoneUtil = new PhoneNumberUtil(new MultiFileMetadataSourceImpl(TEST_METADATA_FILE_PREFIX, in TestMetadataTestCase() 51 PhoneNumberUtil.setInstance(phoneUtil); in setUp()
|
D | ShortNumberInfoTest.java | 378 return phoneUtil.parse(number, regionCode); in parse()
|
/external/libphonenumber/geocoder/src/com/google/i18n/phonenumbers/geocoding/ |
D | PhoneNumberOfflineGeocoder.java | 39 private final PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance(); field in PhoneNumberOfflineGeocoder 68 phoneUtil.getRegionCodesForCountryCode(number.getCountryCode()); in getCountryNameForNumber() 74 if (phoneUtil.isValidNumberForRegion(number, regionCode)) { in getCountryNameForNumber() 119 String nationalNumber = phoneUtil.getNationalSignificantNumber(number); in getDescriptionForValidNumber() 124 String region = phoneUtil.getRegionCodeForCountryCode(number.getCountryCode()); in getDescriptionForValidNumber() 127 copiedNumber = phoneUtil.parse(nationalNumber, region); in getDescriptionForValidNumber() 169 String regionCode = phoneUtil.getRegionCodeForNumber(number); in getDescriptionForValidNumber() 189 PhoneNumberType numberType = phoneUtil.getNumberType(number); in getDescriptionForNumber() 192 } else if (!phoneUtil.isNumberGeographical(numberType, number.getCountryCode())) { in getDescriptionForNumber() 212 PhoneNumberType numberType = phoneUtil.getNumberType(number); in getDescriptionForNumber() [all …]
|
/external/libphonenumber/demo/src/com/google/phonenumbers/ |
D | PhoneNumberParserServlet.java | 62 private PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance(); field in PhoneNumberParserServlet 161 PhoneNumber number = phoneUtil.parseAndKeepRawInput(numberStr, defaultCountry); in getOutputForFile() 162 boolean isNumberValid = phoneUtil.isValidNumber(number); in getOutputForFile() 164 ? phoneUtil.formatInOriginalFormat(number, defaultCountry) in getOutputForFile() 167 ? phoneUtil.format(number, PhoneNumberFormat.INTERNATIONAL) in getOutputForFile() 276 PhoneNumber number = phoneUtil.parseAndKeepRawInput(phoneNumber, defaultCountry); in getOutputForSingleNumber() 290 boolean isPossible = phoneUtil.isPossibleNumber(number); in getOutputForSingleNumber() 291 boolean isNumberValid = phoneUtil.isValidNumber(number); in getOutputForSingleNumber() 292 PhoneNumberType numberType = phoneUtil.getNumberType(number); in getOutputForSingleNumber() 301 phoneUtil.isPossibleNumberWithReason(number).toString(), output); in getOutputForSingleNumber() [all …]
|
/external/libphonenumber/carrier/src/com/google/i18n/phonenumbers/ |
D | PhoneNumberToCarrierMapper.java | 37 private final PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance(); field in PhoneNumberToCarrierMapper 92 PhoneNumberType numberType = phoneUtil.getNumberType(number); in getNameForNumber() 110 if (phoneUtil.isMobileNumberPortableRegion(phoneUtil.getRegionCodeForNumber(number))) { in getSafeDisplayName()
|
/external/libphonenumber/libphonenumber/src/com/google/i18n/phonenumbers/ |
D | AsYouTypeFormatter.java | 59 private final PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance(); field in AsYouTypeFormatter 137 int countryCallingCode = phoneUtil.getCountryCodeForRegion(regionCode); in getMetadataForRegion() 138 String mainCountry = phoneUtil.getRegionCodeForCountryCode(countryCallingCode); in getMetadataForRegion() 139 PhoneMetadata metadata = phoneUtil.getMetadataForRegion(mainCountry); in getMetadataForRegion() 604 int countryCode = phoneUtil.extractCountryCode(nationalNumber, numberWithoutCountryCallingCode); in attemptToExtractCountryCallingCode() 610 String newRegionCode = phoneUtil.getRegionCodeForCountryCode(countryCode); in attemptToExtractCountryCallingCode() 612 currentMetadata = phoneUtil.getMetadataForNonGeographicalRegion(countryCode); in attemptToExtractCountryCallingCode()
|
D | PhoneNumberMatcher.java | 190 private final PhoneNumberUtil phoneUtil; field in PhoneNumberMatcher 234 this.phoneUtil = util; in PhoneNumberMatcher() 414 PhoneNumber number = phoneUtil.parseAndKeepRawInput(candidate, preferredRegion); in parseAndVerify() 428 if (phoneUtil.getRegionCodeForCountryCode(number.getCountryCode()).equals("IL") in parseAndVerify() 429 && phoneUtil.getNationalSignificantNumber(number).length() == 4 in parseAndVerify() 435 if (leniency.verify(number, candidate, phoneUtil)) { in parseAndVerify()
|
/external/libphonenumber/internal/prefixmapper/src/com/google/i18n/phonenumbers/prefixmapper/ |
D | PhonePrefixMap.java | 39 private final PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance(); field in PhonePrefixMap 182 Long.parseLong(number.getCountryCode() + phoneUtil.getNationalSignificantNumber(number)); in lookup()
|