diff options
author | Paul Duffin <paulduffin@google.com> | 2017-02-27 16:01:34 +0000 |
---|---|---|
committer | Paul Duffin <paulduffin@google.com> | 2017-02-28 12:39:10 +0000 |
commit | eba9dfda1f2b487b7399e2210ad5c4c5eeb83f1e (patch) | |
tree | d1af12f71d1469723d4fb6f48f42795e623daa5a /libphonenumber | |
parent | 864377fb67acb5b9c0097792cf769c1d2fab0809 (diff) | |
download | libphonenumber-eba9dfda1f2b487b7399e2210ad5c4c5eeb83f1e.tar.gz |
Upgrade to 8.3.1
Created using ./update-from-external.sh 8.3.1
m -j32 droid
adb reboot bootloader
fastboot flashall -w
m -j32 cts
cts-tradefed run cts -m CtsTelephonyTestCases -t android.telephony.cts.PhoneNumberUtilsTest
m -j32 libphonenumber-test vogar dx
vogar --timeout 0 \
--classpath out/target/common/obj/JAVA_LIBRARIES/libphonenumber-test_intermediates/classes.jack \
com.google.i18n.phonenumbers
Bug: 35655217
Test: As described above
Change-Id: I58a4ea79762322603875a1be02c8a5542076191f
Diffstat (limited to 'libphonenumber')
-rw-r--r-- | libphonenumber/pom.xml | 4 | ||||
-rw-r--r-- | libphonenumber/src/com/google/i18n/phonenumbers/AlternateFormatsCountryCodeSet.java | 5 | ||||
-rw-r--r-- | libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java | 2 | ||||
-rw-r--r-- | libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberAlternateFormatsProto_39 | bin | 0 -> 192 bytes | |||
-rw-r--r-- | libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BS | bin | 667 -> 671 bytes | |||
-rw-r--r-- | libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_VN | bin | 1276 -> 1280 bytes | |||
-rw-r--r-- | libphonenumber/test/com/google/i18n/phonenumbers/PhoneNumberUtilTest.java | 13 |
7 files changed, 19 insertions, 5 deletions
diff --git a/libphonenumber/pom.xml b/libphonenumber/pom.xml index d691a59a..ab0e5fe6 100644 --- a/libphonenumber/pom.xml +++ b/libphonenumber/pom.xml @@ -3,14 +3,14 @@ <modelVersion>4.0.0</modelVersion> <groupId>com.googlecode.libphonenumber</groupId> <artifactId>libphonenumber</artifactId> - <version>8.3.0</version> + <version>8.3.1</version> <packaging>jar</packaging> <url>https://github.com/googlei18n/libphonenumber/</url> <parent> <groupId>com.googlecode.libphonenumber</groupId> <artifactId>libphonenumber-parent</artifactId> - <version>8.3.0</version> + <version>8.3.1</version> </parent> <build> diff --git a/libphonenumber/src/com/google/i18n/phonenumbers/AlternateFormatsCountryCodeSet.java b/libphonenumber/src/com/google/i18n/phonenumbers/AlternateFormatsCountryCodeSet.java index dbf0f354..cf94bdb2 100644 --- a/libphonenumber/src/com/google/i18n/phonenumbers/AlternateFormatsCountryCodeSet.java +++ b/libphonenumber/src/com/google/i18n/phonenumbers/AlternateFormatsCountryCodeSet.java @@ -26,9 +26,9 @@ import java.util.Set; public class AlternateFormatsCountryCodeSet { // A set of all country codes for which data is available. static Set<Integer> getCountryCodeSet() { - // The capacity is set to 58 as there are 44 different entries, + // The capacity is set to 60 as there are 45 different entries, // and this offers a load factor of roughly 0.75. - Set<Integer> countryCodeSet = new HashSet<Integer>(58); + Set<Integer> countryCodeSet = new HashSet<Integer>(60); countryCodeSet.add(7); countryCodeSet.add(27); @@ -36,6 +36,7 @@ public class AlternateFormatsCountryCodeSet { countryCodeSet.add(31); countryCodeSet.add(34); countryCodeSet.add(36); + countryCodeSet.add(39); countryCodeSet.add(43); countryCodeSet.add(44); countryCodeSet.add(49); diff --git a/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java b/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java index 90a969e2..4ce27810 100644 --- a/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java +++ b/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java @@ -1717,7 +1717,7 @@ public class PhoneNumberUtil { public String getNationalSignificantNumber(PhoneNumber number) { // If leading zero(s) have been set, we prefix this now. Note this is not a national prefix. StringBuilder nationalNumber = new StringBuilder(); - if (number.isItalianLeadingZero()) { + if (number.isItalianLeadingZero() && number.getNumberOfLeadingZeros() > 0) { char[] zeros = new char[number.getNumberOfLeadingZeros()]; Arrays.fill(zeros, '0'); nationalNumber.append(new String(zeros)); diff --git a/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberAlternateFormatsProto_39 b/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberAlternateFormatsProto_39 Binary files differnew file mode 100644 index 00000000..50e08699 --- /dev/null +++ b/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberAlternateFormatsProto_39 diff --git a/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BS b/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BS Binary files differindex 4466d852..eba5495a 100644 --- a/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BS +++ b/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BS diff --git a/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_VN b/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_VN Binary files differindex e4353ba4..3551b547 100644 --- a/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_VN +++ b/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_VN diff --git a/libphonenumber/test/com/google/i18n/phonenumbers/PhoneNumberUtilTest.java b/libphonenumber/test/com/google/i18n/phonenumbers/PhoneNumberUtilTest.java index faf11f9d..706b8fcc 100644 --- a/libphonenumber/test/com/google/i18n/phonenumbers/PhoneNumberUtilTest.java +++ b/libphonenumber/test/com/google/i18n/phonenumbers/PhoneNumberUtilTest.java @@ -330,6 +330,19 @@ public class PhoneNumberUtilTest extends TestMetadataTestCase { assertEquals("12345678", phoneUtil.getNationalSignificantNumber(INTERNATIONAL_TOLL_FREE)); } + public void testGetNationalSignificantNumber_ManyLeadingZeros() { + PhoneNumber number = new PhoneNumber(); + number.setCountryCode(1); + number.setNationalNumber(650); + number.setItalianLeadingZero(true); + number.setNumberOfLeadingZeros(2); + assertEquals("00650", phoneUtil.getNationalSignificantNumber(number)); + + // Set a bad value; we shouldn't crash, we shouldn't output any leading zeros at all. + number.setNumberOfLeadingZeros(-3); + assertEquals("650", phoneUtil.getNationalSignificantNumber(number)); + } + public void testGetExampleNumber() { assertEquals(DE_NUMBER, phoneUtil.getExampleNumber(RegionCode.DE)); |