summaryrefslogtreecommitdiffstats
path: root/telephony
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-09-29 13:43:17 -0400
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-09-29 13:43:17 -0400
commit22cbf51ef5f374cb32be3295d7de3f7be404e5be (patch)
treea184611be7cb3bb802b2d6463d1fda00d7b5f49d /telephony
parentac5bd144f1add259d53f2e09dc0cef38f1f5bd3f (diff)
parentdb1f4993989bb03cae2f3e008d4db3e49577aa73 (diff)
downloadframeworks_base-22cbf51ef5f374cb32be3295d7de3f7be404e5be.zip
frameworks_base-22cbf51ef5f374cb32be3295d7de3f7be404e5be.tar.gz
frameworks_base-22cbf51ef5f374cb32be3295d7de3f7be404e5be.tar.bz2
Merge change I49fbfc68 into eclair
* changes: Add PhoneNumberUtils.compare() method that uses a resource to determine strictness.
Diffstat (limited to 'telephony')
-rw-r--r--telephony/java/android/telephony/PhoneNumberUtils.java12
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) {