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

Commit 84b4d37d authored by Dmitri Plotnikov's avatar Dmitri Plotnikov
Browse files

[Issue 2099206] Encoding phone number prior to sending it to the phone lookup filter

Change-Id: I80327febe7134ac1bdef958251943a9777879d53
parent e02f4f12
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -366,7 +366,8 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList
    public void bindFromPhoneNumber(String number) {
        Cursor c = null;
        try {
            c = mContentResolver.query(Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, number),
            c = mContentResolver.query(
                    Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, Uri.encode(number)),
                    PHONE_LOOKUP_PROJECTION, null, null, null);
            if (c != null && c.moveToFirst()) {
                long contactId = c.getLong(PHONE_LOOKUP_CONTACT_ID_COLUMN_INDEX);
+1 −1
Original line number Diff line number Diff line
@@ -250,7 +250,7 @@ public class CallerInfo {
            }
        }

        Uri contactUri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, number);
        Uri contactUri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, Uri.encode(number));

        CallerInfo info = getCallerInfo(context, contactUri);

+1 −1
Original line number Diff line number Diff line
@@ -303,7 +303,7 @@ public class CallerInfoAsyncQuery {
    public static CallerInfoAsyncQuery startQuery(int token, Context context, String number,
            OnQueryCompleteListener listener, Object cookie) {
        //contruct the URI object and start Query.
        Uri contactRef = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, number);
        Uri contactRef = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, Uri.encode(number));

        CallerInfoAsyncQuery c = new CallerInfoAsyncQuery();
        c.allocate(context, contactRef);