diff options
author | Andrew Lee <anwlee@google.com> | 2015-10-30 23:56:26 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-10-30 23:56:26 +0000 |
commit | 0af3d293e14fe665733076877d7bd7ad6851a091 (patch) | |
tree | 0fada2c627a7e0b75bbe99499d5beb319adf1eb6 /src/com/android/dialer/filterednumber/FilteredNumbersUtil.java | |
parent | 04ea6035cf1b4b673d25c1750a0846e8237a77ae (diff) | |
parent | 97e333cf52c7fd2cf34429f89fe28cb33f1b34e2 (diff) |
Merge "Fix checking for invalid numbers." into ub-contactsdialer-a-dev
Diffstat (limited to 'src/com/android/dialer/filterednumber/FilteredNumbersUtil.java')
-rw-r--r-- | src/com/android/dialer/filterednumber/FilteredNumbersUtil.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/com/android/dialer/filterednumber/FilteredNumbersUtil.java b/src/com/android/dialer/filterednumber/FilteredNumbersUtil.java index fa6aa7ed5..67e7ee36b 100644 --- a/src/com/android/dialer/filterednumber/FilteredNumbersUtil.java +++ b/src/com/android/dialer/filterednumber/FilteredNumbersUtil.java @@ -37,7 +37,6 @@ import java.util.LinkedList; import java.util.List; import com.android.contacts.common.testing.NeededForTesting; -import com.android.contacts.common.util.PhoneNumberHelper; import com.android.dialer.R; import com.android.dialer.database.FilteredNumberAsyncQueryHandler; import com.android.dialer.database.FilteredNumberAsyncQueryHandler.OnHasBlockedNumbersListener; @@ -340,9 +339,10 @@ public class FilteredNumbersUtil { }); } - public static boolean canBlockNumber(Context context, String number) { - return !TextUtils.isEmpty(number) && !PhoneNumberUtils.isEmergencyNumber(number) - && !PhoneNumberHelper.isUriNumber(number); + public static boolean canBlockNumber(Context context, String number, String countryIso) { + final String normalizedNumber = PhoneNumberUtils.formatNumberToE164(number, countryIso); + return !TextUtils.isEmpty(normalizedNumber) + && !PhoneNumberUtils.isEmergencyNumber(normalizedNumber); } private static long getRecentEmergencyCallThresholdMs(Context context) { |