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

Commit 507db838 authored by James Lin's avatar James Lin Committed by Android (Google) Code Review
Browse files

Merge "Fix remving the contacts from the EAB failed because the contact should...

Merge "Fix remving the contacts from the EAB failed because the contact should be formatted." into sc-dev
parents 93671d2b 93377933
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -775,7 +775,7 @@ public class EabControllerImpl implements EabController {
        return formatNumber(context, numberParts[0]);
    }

    private static String formatNumber(Context context, String number) {
    static String formatNumber(Context context, String number) {
        TelephonyManager manager = context.getSystemService(TelephonyManager.class);
        String simCountryIso = manager.getSimCountryIso();
        if (simCountryIso != null) {
+2 −1
Original line number Diff line number Diff line
@@ -100,12 +100,13 @@ public class EabUtil {
    private static int getEabContactId(String contactNumber, Context context) {
        int contactId = -1;
        Cursor cursor = null;
        String formattedNumber = EabControllerImpl.formatNumber(context, contactNumber);
        try {
            cursor = context.getContentResolver().query(
                    EabProvider.CONTACT_URI,
                    new String[] { EabProvider.EabCommonColumns._ID },
                    EabProvider.ContactColumns.PHONE_NUMBER + "=?",
                    new String[] { contactNumber }, null);
                    new String[] { formattedNumber }, null);
            if (cursor != null && cursor.moveToFirst()) {
                contactId = cursor.getInt(cursor.getColumnIndex(EabProvider.ContactColumns._ID));
            }