Add PhoneNumberUtils.compare() method that uses a resource to determine strictness.

Change-Id: I49fbfc683f7089f052671b567ad3e19203a568f0
This commit is contained in:
Evan Millar
2009-09-28 17:15:55 -07:00
parent 7db7e6a00c
commit db1f499398
2 changed files with 29 additions and 0 deletions

View File

@@ -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.
*/