Merge change I49fbfc68 into eclair
* changes: Add PhoneNumberUtils.compare() method that uses a resource to determine strictness.
This commit is contained in:
@@ -123244,6 +123244,23 @@
|
||||
<parameter name="b" type="java.lang.String">
|
||||
</parameter>
|
||||
</method>
|
||||
<method name="compare"
|
||||
return="boolean"
|
||||
abstract="false"
|
||||
native="false"
|
||||
synchronized="false"
|
||||
static="true"
|
||||
final="false"
|
||||
deprecated="not deprecated"
|
||||
visibility="public"
|
||||
>
|
||||
<parameter name="context" type="android.content.Context">
|
||||
</parameter>
|
||||
<parameter name="a" type="java.lang.String">
|
||||
</parameter>
|
||||
<parameter name="b" type="java.lang.String">
|
||||
</parameter>
|
||||
</method>
|
||||
<method name="convertKeypadLettersToDigits"
|
||||
return="java.lang.String"
|
||||
abstract="false"
|
||||
|
||||
@@ -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