Home
last modified time | relevance | path

Searched refs:phoneUtil (Results 1 – 11 of 11) sorted by relevance

/external/libphonenumber/libphonenumber/test/com/google/i18n/phonenumbers/
DPhoneNumberUtilTest.java117 assertTrue(phoneUtil.getSupportedRegions().size() > 0); in testGetSupportedRegions()
122 phoneUtil.getSupportedGlobalNetworkCallingCodes(); in testGetSupportedGlobalNetworkCallingCodes()
126 assertEquals(RegionCode.UN001, phoneUtil.getRegionCodeForCountryCode(callingCode)); in testGetSupportedGlobalNetworkCallingCodes()
131 assertNull(phoneUtil.getMetadataForRegion("No Such Region")); in testGetInstanceLoadBadMetadata()
132 assertNull(phoneUtil.getMetadataForNonGeographicalRegion(-1)); in testGetInstanceLoadBadMetadata()
140 phoneUtil.loadMetadataFromFile( in testMissingMetadataFileThrowsRuntimeException()
147 phoneUtil.loadMetadataFromFile("no/such/file", PhoneNumberUtil.REGION_CODE_FOR_NON_GEO_ENTITY, in testMissingMetadataFileThrowsRuntimeException()
156 PhoneMetadata metadata = phoneUtil.getMetadataForRegion(RegionCode.US); in testGetInstanceLoadUSMetadata()
177 PhoneMetadata metadata = phoneUtil.getMetadataForRegion(RegionCode.DE); in testGetInstanceLoadDEMetadata()
197 PhoneMetadata metadata = phoneUtil.getMetadataForRegion(RegionCode.AR); in testGetInstanceLoadARMetadata()
[all …]
DTestMetadataTestCase.java33 protected final PhoneNumberUtil phoneUtil; field in TestMetadataTestCase
36 phoneUtil = initializePhoneUtilForTesting(); in TestMetadataTestCase()
40 PhoneNumberUtil phoneUtil = new PhoneNumberUtil( in initializePhoneUtilForTesting() local
43 PhoneNumberUtil.setInstance(phoneUtil); in initializePhoneUtilForTesting()
44 return phoneUtil; in initializePhoneUtilForTesting()
DPhoneNumberMatcherTest.java251 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 …]
DAsYouTypeFormatterTest.java30 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 …]
DShortNumberInfoTest.java338 return phoneUtil.parse(number, regionCode); in parse()
/external/libphonenumber/demo/src/com/google/phonenumbers/
DPhoneNumberParserServlet.java55 private PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance(); field in PhoneNumberParserServlet
137 PhoneNumber number = phoneUtil.parseAndKeepRawInput(numberStr, defaultCountry); in getOutputForFile()
138 boolean isNumberValid = phoneUtil.isValidNumber(number); in getOutputForFile()
140 ? phoneUtil.formatInOriginalFormat(number, defaultCountry) in getOutputForFile()
143 ? phoneUtil.format(number, PhoneNumberFormat.INTERNATIONAL) in getOutputForFile()
173 PhoneNumber number = phoneUtil.parseAndKeepRawInput(phoneNumber, defaultCountry); in getOutputForSingleNumber()
187 boolean isPossible = phoneUtil.isPossibleNumber(number); in getOutputForSingleNumber()
188 boolean isNumberValid = phoneUtil.isValidNumber(number); in getOutputForSingleNumber()
189 PhoneNumberType numberType = phoneUtil.getNumberType(number); in getOutputForSingleNumber()
197 phoneUtil.isPossibleNumberWithReason(number).toString(), output); in getOutputForSingleNumber()
[all …]
/external/libphonenumber/geocoder/src/com/google/i18n/phonenumbers/geocoding/
DPhoneNumberOfflineGeocoder.java39 private final PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance(); field in PhoneNumberOfflineGeocoder
68 phoneUtil.getRegionCodesForCountryCode(number.getCountryCode()); in getCountryNameForNumber()
74 if (phoneUtil.isValidNumberForRegion(number, regionCode)) { in getCountryNameForNumber()
117 String nationalNumber = phoneUtil.getNationalSignificantNumber(number); in getDescriptionForValidNumber()
122 String region = phoneUtil.getRegionCodeForCountryCode(number.getCountryCode()); in getDescriptionForValidNumber()
125 copiedNumber = phoneUtil.parse(nationalNumber, region); in getDescriptionForValidNumber()
166 String regionCode = phoneUtil.getRegionCodeForNumber(number); in getDescriptionForValidNumber()
186 PhoneNumberType numberType = phoneUtil.getNumberType(number); in getDescriptionForNumber()
209 PhoneNumberType numberType = phoneUtil.getNumberType(number); in getDescriptionForNumber()
/external/libphonenumber/carrier/src/com/google/i18n/phonenumbers/
DPhoneNumberToCarrierMapper.java37 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/
DAsYouTypeFormatter.java58 private final PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance(); field in AsYouTypeFormatter
136 int countryCallingCode = phoneUtil.getCountryCodeForRegion(regionCode); in getMetadataForRegion()
137 String mainCountry = phoneUtil.getRegionCodeForCountryCode(countryCallingCode); in getMetadataForRegion()
138 PhoneMetadata metadata = phoneUtil.getMetadataForRegion(mainCountry); in getMetadataForRegion()
600 int countryCode = phoneUtil.extractCountryCode(nationalNumber, numberWithoutCountryCallingCode); in attemptToExtractCountryCallingCode()
606 String newRegionCode = phoneUtil.getRegionCodeForCountryCode(countryCode); in attemptToExtractCountryCallingCode()
608 currentMetadata = phoneUtil.getMetadataForNonGeographicalRegion(countryCode); in attemptToExtractCountryCallingCode()
DPhoneNumberMatcher.java190 private final PhoneNumberUtil phoneUtil; field in PhoneNumberMatcher
234 this.phoneUtil = util; in PhoneNumberMatcher()
415 PhoneNumber number = phoneUtil.parseAndKeepRawInput(candidate, preferredRegion); in parseAndVerify()
429 if (phoneUtil.getRegionCodeForCountryCode(number.getCountryCode()).equals("IL") && in parseAndVerify()
430 phoneUtil.getNationalSignificantNumber(number).length() == 4 && in parseAndVerify()
436 if (leniency.verify(number, candidate, phoneUtil)) { in parseAndVerify()
/external/libphonenumber/internal/prefixmapper/src/com/google/i18n/phonenumbers/prefixmapper/
DPhonePrefixMap.java39 private final PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance(); field in PhonePrefixMap
182 Long.parseLong(number.getCountryCode() + phoneUtil.getNationalSignificantNumber(number)); in lookup()