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

Commit 80b3ab6a authored by Makoto Onuki's avatar Makoto Onuki
Browse files

Spec change for enterprise lookup

- Stop nulling out most fields.
- Return artificial IDs for corp contacts.
- Add a method to tell if a contact is from the corp profile.

Bug 15779911

Change-Id: I21ab20ad4147b303cd0d49d33b64a38275342dc5
parent 35d552f7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -23581,6 +23581,7 @@ package android.provider {
  public static class ContactsContract.Contacts implements android.provider.BaseColumns android.provider.ContactsContract.ContactNameColumns android.provider.ContactsContract.ContactOptionsColumns android.provider.ContactsContract.ContactStatusColumns android.provider.ContactsContract.ContactsColumns {
    method public static android.net.Uri getLookupUri(android.content.ContentResolver, android.net.Uri);
    method public static android.net.Uri getLookupUri(long, java.lang.String);
    method public static boolean isCorpContactId(long);
    method public static android.net.Uri lookupContact(android.content.ContentResolver, android.net.Uri);
    method public static deprecated void markAsContacted(android.content.ContentResolver, long);
    method public static java.io.InputStream openContactPhotoInputStream(android.content.ContentResolver, android.net.Uri, boolean);
+23 −10
Original line number Diff line number Diff line
@@ -1670,6 +1670,24 @@ public final class ContactsContract {
         */
        public static final String CONTENT_VCARD_TYPE = "text/x-vcard";


        /**
         * Mimimal ID for corp contacts returned from
         * {@link PhoneLookup#ENTERPRISE_CONTENT_FILTER_URI}.
         *
         * @hide
         */
        public static long CORP_CONTACT_ID_BASE = 1000000000; // slightly smaller than 2 ** 30

        /**
         * Return TRUE if a contact ID is from the contacts provider on the corp profile.
         *
         * {@link PhoneLookup#ENTERPRISE_CONTENT_FILTER_URI} may return such a contact.
         */
        public static boolean isCorpContactId(long contactId) {
            return (contactId >= CORP_CONTACT_ID_BASE) && (contactId < Profile.MIN_ID);
        }

        /**
         * A sub-directory of a single contact that contains all of the constituent raw contact
         * {@link ContactsContract.Data} rows.  This directory can be used either
@@ -4842,20 +4860,15 @@ public final class ContactsContract {
         * <p>
         * If a result is from the corp profile, it makes the following changes to the data:
         * <ul>
         *     <li>The following columns will be set to null, as they don't make sense on a
         *     different profile:
         *     {@link #_ID},
         *     {@link #PHOTO_ID},
         *     {@link #PHOTO_FILE_ID},
         *     {@link #LOOKUP_KEY},
         *     {@link #CUSTOM_RINGTONE},
         *     {@link #IN_VISIBLE_GROUP},
         *     and {@link #IN_DEFAULT_DIRECTORY}.
         *     </li>
         *     <li>
         *     {@link #PHOTO_THUMBNAIL_URI} and {@link #PHOTO_URI} will be rewritten to special
         *     URIs.  Use {@link ContentResolver#openAssetFileDescriptor} or its siblings to
         *     load pictures from them.
         *     {@link #PHOTO_ID} and {@link #PHOTO_FILE_ID} will be set to null.  Do not use them.
         *     </li>
         *     <li>
         *     Corp contacts will get artificial {@link #_ID}s.  In order to tell whether a contact
         *     is from the corp profile, use {@link ContactsContract.Contacts#isCorpContactId(long)}.
         *     </li>
         * </ul>
         * <p>