mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-26 12:44:38 +00:00
Update libphonenumber to 8.13.23
This commit is contained in:
@@ -127,6 +127,7 @@ public class PhoneNumberFormatter {
|
||||
}
|
||||
|
||||
if (isShortCode(bareNumber, localCountryCode)) {
|
||||
Log.i(TAG, "Recognized number as short code.");
|
||||
return bareNumber;
|
||||
}
|
||||
|
||||
@@ -134,7 +135,13 @@ public class PhoneNumberFormatter {
|
||||
|
||||
try {
|
||||
Phonenumber.PhoneNumber parsedNumber = phoneNumberUtil.parse(processedNumber, localCountryCode);
|
||||
return phoneNumberUtil.format(parsedNumber, PhoneNumberUtil.PhoneNumberFormat.E164);
|
||||
String formatted = phoneNumberUtil.format(parsedNumber, PhoneNumberUtil.PhoneNumberFormat.E164);
|
||||
|
||||
if (formatted.startsWith("+")) {
|
||||
return formatted;
|
||||
} else {
|
||||
throw new NumberParseException(NumberParseException.ErrorType.NOT_A_NUMBER, "After formatting, the number did not start with +! hasRawInput: " + parsedNumber.hasRawInput());
|
||||
}
|
||||
} catch (NumberParseException e) {
|
||||
Log.w(TAG, e.toString());
|
||||
if (bareNumber.charAt(0) == '+') {
|
||||
|
||||
Reference in New Issue
Block a user