diff options
| author | Evan Millar <emillar@google.com> | 2009-09-28 17:15:55 -0700 |
|---|---|---|
| committer | Evan Millar <emillar@google.com> | 2009-09-29 08:38:07 -0700 |
| commit | db1f4993989bb03cae2f3e008d4db3e49577aa73 (patch) | |
| tree | 00431b82a441630d39e4f5a2b6ae7137e88e9d3d /telephony/java | |
| parent | 7db7e6a00c5a0b38bb2077d93a009581941884d3 (diff) | |
| download | frameworks_base-db1f4993989bb03cae2f3e008d4db3e49577aa73.zip frameworks_base-db1f4993989bb03cae2f3e008d4db3e49577aa73.tar.gz frameworks_base-db1f4993989bb03cae2f3e008d4db3e49577aa73.tar.bz2 | |
Add PhoneNumberUtils.compare() method that uses a resource to determine strictness.
Change-Id: I49fbfc683f7089f052671b567ad3e19203a568f0
Diffstat (limited to 'telephony/java')
| -rw-r--r-- | telephony/java/android/telephony/PhoneNumberUtils.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/telephony/java/android/telephony/PhoneNumberUtils.java b/telephony/java/android/telephony/PhoneNumberUtils.java index 3265708..1aa1c76 100644 --- a/telephony/java/android/telephony/PhoneNumberUtils.java +++ b/telephony/java/android/telephony/PhoneNumberUtils.java @@ -302,10 +302,22 @@ 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. */ public static boolean compare(String a, String b, boolean useStrictComparation) { |
