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

Commit 93377933 authored by James.cf Lin's avatar James.cf Lin
Browse files

Fix remving the contacts from the EAB failed because the contact should be formatted.

Bug: 188958356
Test: atest -c CtsTelephonyTestCases:android.telephony.ims.cts.RcsUceAdapterTest
Change-Id: I868f6e638678d15bf70aea90d57cf27d909a86f8
parent 995e6a3a
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));
            }