|
|
|
@ -1124,7 +1124,7 @@ public class PhoneNumberUtil { |
|
|
|
|
|
|
|
/** |
|
|
|
* Tests whether a phone number has a geographical association. It checks if the number is |
|
|
|
* associated to a certain region in the country where it belongs to. Note that this doesn't |
|
|
|
* associated with a certain region in the country to which it belongs. Note that this doesn't |
|
|
|
* verify if the number is actually in use. |
|
|
|
*/ |
|
|
|
public boolean isNumberGeographical(PhoneNumber phoneNumber) { |
|
|
|
@ -1132,17 +1132,14 @@ public class PhoneNumberUtil { |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Tests whether a phone number has a geographical association, as represented by its type and the |
|
|
|
* country it belongs to. |
|
|
|
* |
|
|
|
* This version of isNumberGeographical exists since calculating the phone number type is |
|
|
|
* Overload of isNumberGeographical(PhoneNumber), since calculating the phone number type is |
|
|
|
* expensive; if we have already done this, we don't want to do it again. |
|
|
|
*/ |
|
|
|
public boolean isNumberGeographical(PhoneNumberType numberType, int countryCallingCode) { |
|
|
|
return numberType == PhoneNumberType.FIXED_LINE |
|
|
|
|| numberType == PhoneNumberType.FIXED_LINE_OR_MOBILE |
|
|
|
public boolean isNumberGeographical(PhoneNumberType phoneNumberType, int countryCallingCode) { |
|
|
|
return phoneNumberType == PhoneNumberType.FIXED_LINE |
|
|
|
|| phoneNumberType == PhoneNumberType.FIXED_LINE_OR_MOBILE |
|
|
|
|| (GEO_MOBILE_COUNTRIES.contains(countryCallingCode) |
|
|
|
&& numberType == PhoneNumberType.MOBILE); |
|
|
|
&& phoneNumberType == PhoneNumberType.MOBILE); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
|