summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaopeng Jia <shaopengjia@google.com>2011-11-07 23:44:45 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2011-11-07 23:44:45 +0000
commitd2b245bcd7dbd3699f31416c1dd69374a3e818ed (patch)
tree2401e3150b78755cfe98a1ce7fd37ae47943563e
parente7fd2450b0b87ccb1996f8c4134ea904a58978bf (diff)
parent4c76ec5eabdedba473151fb40fee35910025f500 (diff)
downloadlibphonenumber-d2b245bcd7dbd3699f31416c1dd69374a3e818ed.tar.gz
am 4c76ec5e: If a number belongs to a country without national prefix, and the number starts with one, classfy the number as invalid.
* commit '4c76ec5eabdedba473151fb40fee35910025f500': If a number belongs to a country without national prefix, and the number starts with one, classfy the number as invalid.
-rw-r--r--java/src/com/android/i18n/phonenumbers/PhoneNumberUtil.java14
1 files changed, 2 insertions, 12 deletions
diff --git a/java/src/com/android/i18n/phonenumbers/PhoneNumberUtil.java b/java/src/com/android/i18n/phonenumbers/PhoneNumberUtil.java
index 3f03ee57..e754828d 100644
--- a/java/src/com/android/i18n/phonenumbers/PhoneNumberUtil.java
+++ b/java/src/com/android/i18n/phonenumbers/PhoneNumberUtil.java
@@ -1364,18 +1364,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();
}