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

Commit 984a3e67 authored by calderwoodra's avatar calderwoodra Committed by android-build-merger
Browse files

Merge "Remove contact id from all non-local directory contacts."

am: 33cfcb2d

Change-Id: I0e71d59ccc70eeb003bf83b181dd453e6339ea2b
parents 52d52b13 33cfcb2d
Loading
Loading
Loading
Loading
+1 −12
Original line number Diff line number Diff line
@@ -131,18 +131,7 @@ public final class DirectoryContactViewHolder extends RecyclerView.ViewHolder

  private static Uri getContactUri(SearchCursor cursor) {
    String lookupKey = cursor.getString(Projections.LOOKUP_KEY);

    Uri baseUri;
    // If the contact is a local work contact, leave the contact id out of the uri since it
    // isn't valid.
    if (DirectoryCompat.isOnlyEnterpriseDirectoryId(cursor.getDirectoryId())) {
      baseUri = Uri.withAppendedPath(Contacts.CONTENT_LOOKUP_URI, lookupKey);
    } else {
      long contactId = cursor.getLong(Projections.ID);
      baseUri = Contacts.getLookupUri(contactId, lookupKey);
    }

    return baseUri
    return Uri.withAppendedPath(Contacts.CONTENT_LOOKUP_URI, lookupKey)
        .buildUpon()
        .appendQueryParameter(
            ContactsContract.DIRECTORY_PARAM_KEY, String.valueOf(cursor.getDirectoryId()))