Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 22cbf51e authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change I49fbfc68 into eclair

* changes:
  Add PhoneNumberUtils.compare() method that uses a resource to determine strictness.
parents ac5bd144 db1f4993
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -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"
+12 −0
Original line number Diff line number Diff line
@@ -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.
     */