summaryrefslogtreecommitdiff
path: root/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberMatcher.java
diff options
context:
space:
mode:
authorPaul Duffin <paulduffin@google.com>2015-12-07 15:54:05 +0000
committerPaul Duffin <paulduffin@google.com>2015-12-08 15:16:46 +0000
commit8fda25a631103958dd4e335fa1149913d0552e0a (patch)
tree795d2abf37f433cd1ebcd759b81b1b2fc0bf4d54 /libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberMatcher.java
parentdd36b2bee8d8afca56f225dfa5f2d1d6147bd230 (diff)
downloadlibphonenumber-8fda25a631103958dd4e335fa1149913d0552e0a.tar.gz
Upgrade to version 7.2.1
This introduces a runtime dependency on nano protobuf. The classes are jarjared from com.google.protobuf.nano into com.android.protobuf.nano and will be built as part of the ext library built in frameworks/base/Android.mk. Bug: 24793335 Change-Id: Iba3b7c5ad7789d4a2abca5a174e978138699ef94
Diffstat (limited to 'libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberMatcher.java')
-rw-r--r--libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberMatcher.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberMatcher.java b/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberMatcher.java
index c74b21ab..a9d918f2 100644
--- a/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberMatcher.java
+++ b/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberMatcher.java
@@ -19,10 +19,10 @@ package com.google.i18n.phonenumbers;
import com.google.i18n.phonenumbers.PhoneNumberUtil.Leniency;
import com.google.i18n.phonenumbers.PhoneNumberUtil.MatchType;
import com.google.i18n.phonenumbers.PhoneNumberUtil.PhoneNumberFormat;
-import com.google.i18n.phonenumbers.Phonemetadata.NumberFormat;
-import com.google.i18n.phonenumbers.Phonemetadata.PhoneMetadata;
-import com.google.i18n.phonenumbers.Phonenumber.PhoneNumber.CountryCodeSource;
import com.google.i18n.phonenumbers.Phonenumber.PhoneNumber;
+import com.google.i18n.phonenumbers.Phonenumber.PhoneNumber.CountryCodeSource;
+import com.google.i18n.phonenumbers.nano.Phonemetadata.NumberFormat;
+import com.google.i18n.phonenumbers.nano.Phonemetadata.PhoneMetadata;
import java.lang.Character.UnicodeBlock;
import java.util.Iterator;
@@ -585,7 +585,7 @@ final class PhoneNumberMatcher implements Iterator<PhoneNumberMatch> {
PhoneMetadata alternateFormats =
MetadataManager.getAlternateFormatsForCountry(number.getCountryCode());
if (alternateFormats != null) {
- for (NumberFormat alternateFormat : alternateFormats.numberFormats()) {
+ for (NumberFormat alternateFormat : alternateFormats.numberFormat) {
formattedNumberGroups = getNationalNumberGroups(util, number, alternateFormat);
if (checker.checkGroups(util, number, normalizedCandidate, formattedNumberGroups)) {
return true;
@@ -665,17 +665,17 @@ final class PhoneNumberMatcher implements Iterator<PhoneNumberMatch> {
// Check if a national prefix should be present when formatting this number.
String nationalNumber = util.getNationalSignificantNumber(number);
NumberFormat formatRule =
- util.chooseFormattingPatternForNumber(metadata.numberFormats(), nationalNumber);
+ util.chooseFormattingPatternForNumber(metadata.numberFormat, nationalNumber);
// To do this, we check that a national prefix formatting rule was present and that it wasn't
// just the first-group symbol ($1) with punctuation.
- if ((formatRule != null) && formatRule.getNationalPrefixFormattingRule().length() > 0) {
- if (formatRule.isNationalPrefixOptionalWhenFormatting()) {
+ if ((formatRule != null) && formatRule.nationalPrefixFormattingRule.length() > 0) {
+ if (formatRule.nationalPrefixOptionalWhenFormatting) {
// The national-prefix is optional in these cases, so we don't need to check if it was
// present.
return true;
}
if (PhoneNumberUtil.formattingRuleHasFirstGroupOnly(
- formatRule.getNationalPrefixFormattingRule())) {
+ formatRule.nationalPrefixFormattingRule)) {
// National Prefix not needed for this number.
return true;
}