From 4c76ec5eabdedba473151fb40fee35910025f500 Mon Sep 17 00:00:00 2001 From: Shaopeng Jia Date: Mon, 7 Nov 2011 10:34:08 +0100 Subject: If a number belongs to a country without national prefix, and the number starts with one, classfy the number as invalid. Bug: 5520899 Change-Id: I107688cb8aa95f5472947743b3373a80b9bfa127 --- .../src/com/android/i18n/phonenumbers/PhoneNumberUtil.java | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'java/src/com') diff --git a/java/src/com/android/i18n/phonenumbers/PhoneNumberUtil.java b/java/src/com/android/i18n/phonenumbers/PhoneNumberUtil.java index 230b8bf6..88f2398f 100644 --- a/java/src/com/android/i18n/phonenumbers/PhoneNumberUtil.java +++ b/java/src/com/android/i18n/phonenumbers/PhoneNumberUtil.java @@ -1352,18 +1352,8 @@ public class PhoneNumberUtil { * @return the national significant number of the PhoneNumber object passed in */ public String getNationalSignificantNumber(PhoneNumber number) { - // The leading zero in the national (significant) number of an Italian phone number has a - // special meaning. Unlike the rest of the world, it indicates the number is a landline - // number. There have been plans to migrate landline numbers to start with the digit two since - // December 2000, but it has not yet happened. - // See http://en.wikipedia.org/wiki/%2B39 for more details. - // Other regions such as Cote d'Ivoire and Gabon use this for their mobile numbers. - StringBuilder nationalNumber = new StringBuilder( - (number.hasItalianLeadingZero() && - number.isItalianLeadingZero() && - isLeadingZeroPossible(number.getCountryCode())) - ? "0" : "" - ); + // If a leading zero has been set, we prefix this now. Note this is not a national prefix. + StringBuilder nationalNumber = new StringBuilder(number.isItalianLeadingZero() ? "0" : ""); nationalNumber.append(number.getNationalNumber()); return nationalNumber.toString(); } -- cgit v1.2.3