Add PhoneNumberUtils.compare() method that uses a resource to determine strictness.
Change-Id: I49fbfc683f7089f052671b567ad3e19203a568f0
This commit is contained in:
@@ -302,9 +302,21 @@ public class PhoneNumberUtils
|
||||
*/
|
||||
public static boolean compare(String a, String b) {
|
||||
// We've used loose comparation at least Eclair, which may change in the future.
|
||||
|
||||
return compare(a, b, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare phone numbers a and b, and return true if they're identical
|
||||
* enough for caller ID purposes. Checks a resource to determine whether
|
||||
* to use a strict or loose comparison algorithm.
|
||||
*/
|
||||
public static boolean compare(Context context, String a, String b) {
|
||||
boolean useStrict = context.getResources().getBoolean(
|
||||
com.android.internal.R.bool.config_use_strict_phone_number_comparation);
|
||||
return compare(a, b, useStrict);
|
||||
}
|
||||
|
||||
/**
|
||||
* @hide only for testing.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user