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

Commit dca6ce76 authored by Paul Soulos's avatar Paul Soulos
Browse files

Normalizes numbers before a CallLog query in Contact card

bug: 17309747
Change-Id: I49924ff0d7ec3a8fd80acae45b000106e81892c3
parent 9bb1a80e
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -23,6 +23,7 @@ import android.database.Cursor;
import android.database.DatabaseUtils;
import android.database.DatabaseUtils;
import android.net.Uri;
import android.net.Uri;
import android.provider.CallLog.Calls;
import android.provider.CallLog.Calls;
import android.telephony.PhoneNumberUtils;


import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.annotations.VisibleForTesting;


@@ -101,7 +102,8 @@ public class CallLogInteractionsLoader extends AsyncTaskLoader<List<ContactInter
    }
    }


    private List<ContactInteraction> getCallLogInteractions(String phoneNumber) {
    private List<ContactInteraction> getCallLogInteractions(String phoneNumber) {
        final Uri uri = Uri.withAppendedPath(Calls.CONTENT_FILTER_URI, Uri.encode(phoneNumber));
        final Uri uri = Uri.withAppendedPath(Calls.CONTENT_FILTER_URI,
                Uri.encode(PhoneNumberUtils.normalizeNumber(phoneNumber)));
        // Append the LIMIT clause onto the ORDER BY clause. This won't cause crashes as long
        // Append the LIMIT clause onto the ORDER BY clause. This won't cause crashes as long
        // as we don't also set the {@link android.provider.CallLog.Calls.LIMIT_PARAM_KEY} that
        // as we don't also set the {@link android.provider.CallLog.Calls.LIMIT_PARAM_KEY} that
        // becomes available in KK.
        // becomes available in KK.