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

Commit a6baa774 authored by Jay Shrauner's avatar Jay Shrauner Committed by Android (Google) Code Review
Browse files

Merge "Check for empty lookup keys in getLookupUri"

parents 04bf45a3 1ebaff2a
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1516,8 +1516,14 @@ public final class ContactsContract {
        /**
         * Build a {@link #CONTENT_LOOKUP_URI} lookup {@link Uri} using the
         * given {@link ContactsContract.Contacts#_ID} and {@link #LOOKUP_KEY}.
         * <p>
         * Returns null if unable to construct a valid lookup URI from the
         * provided parameters.
         */
        public static Uri getLookupUri(long contactId, String lookupKey) {
            if (TextUtils.isEmpty(lookupKey)) {
                return null;
            }
            return ContentUris.withAppendedId(Uri.withAppendedPath(Contacts.CONTENT_LOOKUP_URI,
                    lookupKey), contactId);
        }