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

Commit 0f4af69d authored by James Lin's avatar James Lin Committed by Automerger Merge Worker
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 am: 507db838

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/opt/net/ims/+/14715998

Change-Id: I760cb764cc055b037e4cdefb79d8a9aeecd7b7b1
parents f781002a 507db838
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));
            }