API tweaks round 2

Add nullability annotations and change a static constant to a method
that returns a value.

Fixes: 126702861
Fixes: 126699926
Fixes: 126698717
Fixes: 126699057
Fixes: 126701443
Fixes: 126700882
Test: compiles
Change-Id: I96396eb8890b8b5148cf74447e08c31983398e47
This commit is contained in:
Hall Liu
2019-02-28 18:54:15 -08:00
parent a02847ec0d
commit 1059cd57f0
7 changed files with 34 additions and 28 deletions

View File

@@ -149,7 +149,7 @@ public final class PhoneNumberRange implements Parcelable {
* @param number A phone number, with or without separators or a country code.
* @return {@code true} if the number matches, {@code false} otherwise.
*/
public boolean matches(String number) {
public boolean matches(@NonNull String number) {
// Check the prefix, make sure it matches either with or without the country code.
String normalizedNumber = number.replaceAll("[^0-9]", "");
String prefixWithCountryCode = mCountryCode + mPrefix;