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

Commit 0e917336 authored by Makoto Onuki's avatar Makoto Onuki
Browse files

Address API review comments:

- Rename isCorpContactId() to isEnterpriseContactId().
- Update EXTRA_* constant values.
- Update javadoc on NAME_VERIFIED.

Bug 17253963

Change-Id: I1bef3adbb4125b39129c77cca29c4b8089e1f8cc
parent 67a8aae3
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -24404,7 +24404,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 boolean isEnterpriseContactId(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);
@@ -24717,7 +24717,7 @@ package android.provider {
    method public static void showQuickContact(android.content.Context, android.view.View, android.net.Uri, int, java.lang.String[]);
    method public static void showQuickContact(android.content.Context, android.graphics.Rect, android.net.Uri, int, java.lang.String[]);
    field public static final java.lang.String ACTION_QUICK_CONTACT = "com.android.contacts.action.QUICK_CONTACT";
    field public static final java.lang.String EXTRA_EXCLUDE_MIMES = "exclude_mimes";
    field public static final java.lang.String EXTRA_EXCLUDE_MIMES = "android.provider.extra.EXCLUDE_MIMES";
    field public static final int MODE_LARGE = 3; // 0x3
    field public static final int MODE_MEDIUM = 2; // 0x2
    field public static final int MODE_SMALL = 1; // 0x1
+14 −9
Original line number Diff line number Diff line
@@ -36,7 +36,6 @@ import android.database.Cursor;
import android.database.DatabaseUtils;
import android.graphics.Rect;
import android.net.Uri;
import android.net.Uri.Builder;
import android.os.RemoteException;
import android.text.TextUtils;
import android.util.DisplayMetrics;
@@ -1622,15 +1621,15 @@ public final class ContactsContract {
         *
         * @hide
         */
        public static long CORP_CONTACT_ID_BASE = 1000000000; // slightly smaller than 2 ** 30
        public static long ENTERPRISE_CONTACT_ID_BASE = 1000000000; // slightly smaller than 2 ** 30

        /**
         * Return TRUE if a contact ID is from the contacts provider on the corp profile.
         * Return TRUE if a contact ID is from the contacts provider on the enterprise 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);
        public static boolean isEnterpriseContactId(long contactId) {
            return (contactId >= ENTERPRISE_CONTACT_ID_BASE) && (contactId < Profile.MIN_ID);
        }

        /**
@@ -2229,6 +2228,11 @@ public final class ContactsContract {
         * type.  For applications that need to be aware of the data set, this can
         * be used instead of account type to distinguish sets of data.  This is
         * never intended to be used for specifying accounts.
         * <p>
         * This column does *not* escape forward slashes in the account type or the data set.
         * If this is an issue, consider using
         * {@link ContactsContract.RawContacts#ACCOUNT_TYPE} and
         * {@link ContactsContract.RawContacts#DATA_SET} directly.
         */
        public static final String ACCOUNT_TYPE_AND_DATA_SET = "account_type_and_data_set";

@@ -5025,7 +5029,8 @@ public final class ContactsContract {
         *     </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)}.
         *     is from the corp profile, use
         *     {@link ContactsContract.Contacts#isEnterpriseContactId(long)}.
         *     </li>
         * </ul>
         * <p>
@@ -8114,19 +8119,19 @@ public final class ContactsContract {
         * @hide
         */
        @Deprecated
        public static final String EXTRA_TARGET_RECT = "target_rect";
        public static final String EXTRA_TARGET_RECT = "android.provider.extra.TARGET_RECT";

        /**
         * Extra used to specify size of pivot dialog.
         * @hide
         */
        public static final String EXTRA_MODE = "mode";
        public static final String EXTRA_MODE = "android.provider.extra.MODE";

        /**
         * Extra used to indicate a list of specific MIME-types to exclude and not display in the
         * QuickContacts dialog. Stored as a {@link String} array.
         */
        public static final String EXTRA_EXCLUDE_MIMES = "exclude_mimes";
        public static final String EXTRA_EXCLUDE_MIMES = "android.provider.extra.EXCLUDE_MIMES";

        /**
         * Small QuickContact mode, usually presented with minimal actions.
+1 −3
Original line number Diff line number Diff line
@@ -40,8 +40,6 @@ import com.android.i18n.phonenumbers.PhoneNumberUtil;
import com.android.i18n.phonenumbers.Phonenumber.PhoneNumber;
import android.telephony.SubscriptionManager;

import android.telephony.TelephonyManager;

import java.util.Locale;


@@ -219,7 +217,7 @@ public class CallerInfo {
                columnIndex = getColumnIndexForPersonId(contactRef, cursor);
                if (columnIndex != -1) {
                    final long contactId = cursor.getLong(columnIndex);
                    if (contactId != 0 && !Contacts.isCorpContactId(contactId)) {
                    if (contactId != 0 && !Contacts.isEnterpriseContactId(contactId)) {
                        info.contactIdOrZero = contactId;
                        if (VDBG) {
                            Rlog.v(TAG, "==> got info.contactIdOrZero: " + info.contactIdOrZero);