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

Commit d37af1cf authored by Walter Jang's avatar Walter Jang
Browse files

Encode read-only lookupKeys twice so multi vcard URI can split on :

With this change, a multi vcard share of a read-only contact and a
writeable contact with the following unencoded lookup Uris:

read-only: 2234ig:111432238085115413361
writeable: 341i2dab67978f1e8bda

will look like: content://com.android.contacts/contacts/as_multi_vcard/
  2234ig%253A111432238085115413361%3A341i2dab67978f1e8bda

So the ':' in the read-only lookupKey will be encoded twice going from
  ':' => '%3A' => '%253A'

In CP2, the lookupKeys will be decoded when fetched as path segments to
  2234ig%3A111432238085115413361:341i2dab67978f1e8bda, which will then
  split properly on ':'.

Bug 22940695

Change-Id: Ie557f1573b1c3a8a5ada1bf5199c1e887c2c9f5a
parent 615ed9c5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1246,7 +1246,7 @@ public class PeopleActivity extends ContactsActivity implements
            final Uri contactUri = ContentUris.withAppendedId(Contacts.CONTENT_URI, contactId);
            final Uri lookupUri = Contacts.getLookupUri(getContentResolver(), contactUri);
            List<String> pathSegments = lookupUri.getPathSegments();
            uriListBuilder.append(pathSegments.get(pathSegments.size() - 2));
            uriListBuilder.append(Uri.encode(pathSegments.get(pathSegments.size() - 2)));
            firstIteration = false;
        }
        final Uri uri = Uri.withAppendedPath(