Merge "Ensure null/empty phone number does not crash international number check." into oc-dev

This commit is contained in:
TreeHugger Robot
2017-06-01 07:07:18 +00:00
committed by Android (Google) Code Review

View File

@@ -1449,6 +1449,11 @@ public class PhoneNumberUtils
* @hide
*/
public static boolean isInternationalNumber(String phoneNumber, String defaultCountryIso) {
// If no phone number is provided, it can't be international.
if (TextUtils.isEmpty(phoneNumber)) {
return false;
}
// If it starts with # or * its not international.
if (phoneNumber.startsWith("#") || phoneNumber.startsWith("*")) {
return false;