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

Commit aa2dd62c authored by Makoto Onuki's avatar Makoto Onuki
Browse files

No longer keep track of contacts affinity (2/4)

Test: atest android.provider.cts.contacts
Test: atest ContactsProviderTests ContactsProviderTests2
Change-Id: I10e66441a9766947c7c14ae25022deadac5a9c7c
Bug: 111210683
parent 2ff6ee5e
Loading
Loading
Loading
Loading
+6 −6
Original line number Original line Diff line number Diff line
@@ -35610,11 +35610,11 @@ package android.provider {
  protected static abstract interface ContactsContract.ContactOptionsColumns {
  protected static abstract interface ContactsContract.ContactOptionsColumns {
    field public static final java.lang.String CUSTOM_RINGTONE = "custom_ringtone";
    field public static final java.lang.String CUSTOM_RINGTONE = "custom_ringtone";
    field public static final java.lang.String LAST_TIME_CONTACTED = "last_time_contacted";
    field public static final deprecated java.lang.String LAST_TIME_CONTACTED = "last_time_contacted";
    field public static final java.lang.String PINNED = "pinned";
    field public static final java.lang.String PINNED = "pinned";
    field public static final java.lang.String SEND_TO_VOICEMAIL = "send_to_voicemail";
    field public static final java.lang.String SEND_TO_VOICEMAIL = "send_to_voicemail";
    field public static final java.lang.String STARRED = "starred";
    field public static final java.lang.String STARRED = "starred";
    field public static final java.lang.String TIMES_CONTACTED = "times_contacted";
    field public static final deprecated java.lang.String TIMES_CONTACTED = "times_contacted";
  }
  }
  protected static abstract interface ContactsContract.ContactStatusColumns {
  protected static abstract interface ContactsContract.ContactStatusColumns {
@@ -35636,7 +35636,7 @@ package android.provider {
    method public static java.io.InputStream openContactPhotoInputStream(android.content.ContentResolver, android.net.Uri, boolean);
    method public static java.io.InputStream openContactPhotoInputStream(android.content.ContentResolver, android.net.Uri, boolean);
    method public static java.io.InputStream openContactPhotoInputStream(android.content.ContentResolver, android.net.Uri);
    method public static java.io.InputStream openContactPhotoInputStream(android.content.ContentResolver, android.net.Uri);
    field public static final android.net.Uri CONTENT_FILTER_URI;
    field public static final android.net.Uri CONTENT_FILTER_URI;
    field public static final android.net.Uri CONTENT_FREQUENT_URI;
    field public static final deprecated android.net.Uri CONTENT_FREQUENT_URI;
    field public static final android.net.Uri CONTENT_GROUP_URI;
    field public static final android.net.Uri CONTENT_GROUP_URI;
    field public static final java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/contact";
    field public static final java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/contact";
    field public static final android.net.Uri CONTENT_LOOKUP_URI;
    field public static final android.net.Uri CONTENT_LOOKUP_URI;
@@ -35744,7 +35744,7 @@ package android.provider {
  protected static abstract interface ContactsContract.DataColumnsWithJoins implements android.provider.BaseColumns android.provider.ContactsContract.ContactNameColumns android.provider.ContactsContract.ContactOptionsColumns android.provider.ContactsContract.ContactStatusColumns android.provider.ContactsContract.ContactsColumns android.provider.ContactsContract.DataColumns android.provider.ContactsContract.DataUsageStatColumns android.provider.ContactsContract.RawContactsColumns android.provider.ContactsContract.StatusColumns {
  protected static abstract interface ContactsContract.DataColumnsWithJoins implements android.provider.BaseColumns android.provider.ContactsContract.ContactNameColumns android.provider.ContactsContract.ContactOptionsColumns android.provider.ContactsContract.ContactStatusColumns android.provider.ContactsContract.ContactsColumns android.provider.ContactsContract.DataColumns android.provider.ContactsContract.DataUsageStatColumns android.provider.ContactsContract.RawContactsColumns android.provider.ContactsContract.StatusColumns {
  }
  }
  public static final class ContactsContract.DataUsageFeedback {
  public static final deprecated class ContactsContract.DataUsageFeedback {
    ctor public ContactsContract.DataUsageFeedback();
    ctor public ContactsContract.DataUsageFeedback();
    field public static final android.net.Uri DELETE_USAGE_URI;
    field public static final android.net.Uri DELETE_USAGE_URI;
    field public static final android.net.Uri FEEDBACK_URI;
    field public static final android.net.Uri FEEDBACK_URI;
@@ -35755,8 +35755,8 @@ package android.provider {
  }
  }
  protected static abstract interface ContactsContract.DataUsageStatColumns {
  protected static abstract interface ContactsContract.DataUsageStatColumns {
    field public static final java.lang.String LAST_TIME_USED = "last_time_used";
    field public static final deprecated java.lang.String LAST_TIME_USED = "last_time_used";
    field public static final java.lang.String TIMES_USED = "times_used";
    field public static final deprecated java.lang.String TIMES_USED = "times_used";
  }
  }
  public static final class ContactsContract.DeletedContacts implements android.provider.ContactsContract.DeletedContactsColumns {
  public static final class ContactsContract.DeletedContacts implements android.provider.ContactsContract.DeletedContactsColumns {
+42 −85
Original line number Original line Diff line number Diff line
@@ -187,8 +187,7 @@ public final class ContactsContract {
    /**
    /**
     * A boolean parameter for {@link Contacts#CONTENT_STREQUENT_URI} and
     * A boolean parameter for {@link Contacts#CONTENT_STREQUENT_URI} and
     * {@link Contacts#CONTENT_STREQUENT_FILTER_URI}, which requires the ContactsProvider to
     * {@link Contacts#CONTENT_STREQUENT_FILTER_URI}, which requires the ContactsProvider to
     * return only phone-related results. For example, frequently contacted person list should
     * return only phone-related results.
     * include persons contacted via phone (not email, sms, etc.)
     */
     */
    public static final String STREQUENT_PHONE_ONLY = "strequent_phone_only";
    public static final String STREQUENT_PHONE_ONLY = "strequent_phone_only";


@@ -870,13 +869,23 @@ public final class ContactsContract {
        /**
        /**
         * The number of times a contact has been contacted
         * The number of times a contact has been contacted
         * <P>Type: INTEGER</P>
         * <P>Type: INTEGER</P>
         *
         * @deprecated Contacts affinity information is no longer supported as of
         * Android version {@link android.os.Build.VERSION_CODES#Q}. This column
         * always contains 0.
         */
         */
        @Deprecated
        public static final String TIMES_CONTACTED = "times_contacted";
        public static final String TIMES_CONTACTED = "times_contacted";


        /**
        /**
         * The last time a contact was contacted.
         * The last time a contact was contacted.
         * <P>Type: INTEGER</P>
         * <P>Type: INTEGER</P>
         *
         * @deprecated Contacts affinity information is no longer supported as of
         * Android version {@link android.os.Build.VERSION_CODES#Q}. This column
         * always contains 0.
         */
         */
        @Deprecated
        public static final String LAST_TIME_CONTACTED = "last_time_contacted";
        public static final String LAST_TIME_CONTACTED = "last_time_contacted";


        /** @hide Raw value. */
        /** @hide Raw value. */
@@ -1313,8 +1322,7 @@ public final class ContactsContract {
     * of the newly inserted raw contact.</dd>
     * of the newly inserted raw contact.</dd>
     * <dt><b>Update</b></dt>
     * <dt><b>Update</b></dt>
     * <dd>Only certain columns of Contact are modifiable:
     * <dd>Only certain columns of Contact are modifiable:
     * {@link #TIMES_CONTACTED}, {@link #LAST_TIME_CONTACTED}, {@link #STARRED},
     * {@link #STARRED}, {@link #CUSTOM_RINGTONE}, {@link #SEND_TO_VOICEMAIL}. Changing any of
     * {@link #CUSTOM_RINGTONE}, {@link #SEND_TO_VOICEMAIL}. Changing any of
     * these columns on the Contact also changes them on all constituent raw
     * these columns on the Contact also changes them on all constituent raw
     * contacts.</dd>
     * contacts.</dd>
     * <dt><b>Delete</b></dt>
     * <dt><b>Delete</b></dt>
@@ -1415,27 +1423,6 @@ public final class ContactsContract {
     * </tr>
     * </tr>
     * <tr>
     * <tr>
     * <td>int</td>
     * <td>int</td>
     * <td>{@link #TIMES_CONTACTED}</td>
     * <td>read/write</td>
     * <td>The number of times the contact has been contacted. See
     * {@link #markAsContacted}. When raw contacts are aggregated, this field is
     * computed automatically as the maximum number of times contacted among all
     * constituent raw contacts. Setting this field automatically changes the
     * corresponding field on all constituent raw contacts.</td>
     * </tr>
     * <tr>
     * <td>long</td>
     * <td>{@link #LAST_TIME_CONTACTED}</td>
     * <td>read/write</td>
     * <td>The timestamp of the last time the contact was contacted. See
     * {@link #markAsContacted}. Setting this field also automatically
     * increments {@link #TIMES_CONTACTED}. When raw contacts are aggregated,
     * this field is computed automatically as the latest time contacted of all
     * constituent raw contacts. Setting this field automatically changes the
     * corresponding field on all constituent raw contacts.</td>
     * </tr>
     * <tr>
     * <td>int</td>
     * <td>{@link #STARRED}</td>
     * <td>{@link #STARRED}</td>
     * <td>read/write</td>
     * <td>read/write</td>
     * <td>An indicator for favorite contacts: '1' if favorite, '0' otherwise.
     * <td>An indicator for favorite contacts: '1' if favorite, '0' otherwise.
@@ -1696,16 +1683,12 @@ public final class ContactsContract {
         * @param resolver the ContentResolver to use
         * @param resolver the ContentResolver to use
         * @param contactId the person who was contacted
         * @param contactId the person who was contacted
         *
         *
         * @deprecated The class DataUsageStatUpdater of the Android support library should
         * @deprecated Contacts affinity information is no longer supported as of
         *     be used instead.
         * Android version {@link android.os.Build.VERSION_CODES#Q}. This method
         * is no-op.
         */
         */
        @Deprecated
        @Deprecated
        public static void markAsContacted(ContentResolver resolver, long contactId) {
        public static void markAsContacted(ContentResolver resolver, long contactId) {
            Uri uri = ContentUris.withAppendedId(CONTENT_URI, contactId);
            ContentValues values = new ContentValues();
            // TIMES_CONTACTED will be incremented when LAST_TIME_CONTACTED is modified.
            values.put(LR_LAST_TIME_CONTACTED, System.currentTimeMillis());
            resolver.update(uri, values, null, null);
        }
        }


        /**
        /**
@@ -1727,15 +1710,21 @@ public final class ContactsContract {


        /**
        /**
         * The content:// style URI for this table joined with useful data from
         * The content:// style URI for this table joined with useful data from
         * {@link ContactsContract.Data}, filtered to include only starred contacts
         * {@link ContactsContract.Data}, filtered to include only starred contacts.
         * and the most frequently contacted contacts.
         * Frequent contacts are no longer included in the result as of
         * Android version {@link android.os.Build.VERSION_CODES#Q}.
         */
         */
        public static final Uri CONTENT_STREQUENT_URI = Uri.withAppendedPath(
        public static final Uri CONTENT_STREQUENT_URI = Uri.withAppendedPath(
                CONTENT_URI, "strequent");
                CONTENT_URI, "strequent");


        /**
        /**
         * The content:// style URI for showing a list of frequently contacted people.
         * The content:// style URI for showing a list of frequently contacted people.
         *
         * @deprecated Frequent contacts are no longer supported as of
         * Android version {@link android.os.Build.VERSION_CODES#Q}.
         * This URI always returns an empty cursor.
         */
         */
        @Deprecated
        public static final Uri CONTENT_FREQUENT_URI = Uri.withAppendedPath(
        public static final Uri CONTENT_FREQUENT_URI = Uri.withAppendedPath(
                CONTENT_URI, "frequent");
                CONTENT_URI, "frequent");


@@ -2631,27 +2620,6 @@ public final class ContactsContract {
     * </tr>
     * </tr>
     * <tr>
     * <tr>
     * <td>int</td>
     * <td>int</td>
     * <td>{@link #TIMES_CONTACTED}</td>
     * <td>read/write</td>
     * <td>The number of times the contact has been contacted. To have an effect
     * on the corresponding value of the aggregate contact, this field
     * should be set at the time the raw contact is inserted.
     * After that, this value is typically updated via
     * {@link ContactsContract.Contacts#markAsContacted}.</td>
     * </tr>
     * <tr>
     * <td>long</td>
     * <td>{@link #LAST_TIME_CONTACTED}</td>
     * <td>read/write</td>
     * <td>The timestamp of the last time the contact was contacted. To have an effect
     * on the corresponding value of the aggregate contact, this field
     * should be set at the time the raw contact is inserted.
     * After that, this value is typically updated via
     * {@link ContactsContract.Contacts#markAsContacted}.
     * </td>
     * </tr>
     * <tr>
     * <td>int</td>
     * <td>{@link #STARRED}</td>
     * <td>{@link #STARRED}</td>
     * <td>read/write</td>
     * <td>read/write</td>
     * <td>An indicator for favorite contacts: '1' if favorite, '0' otherwise.
     * <td>An indicator for favorite contacts: '1' if favorite, '0' otherwise.
@@ -4286,10 +4254,22 @@ public final class ContactsContract {
     * Columns in the Data_Usage_Stat table
     * Columns in the Data_Usage_Stat table
     */
     */
    protected interface DataUsageStatColumns {
    protected interface DataUsageStatColumns {
        /** The last time (in milliseconds) this {@link Data} was used. */
        /**
         * The last time (in milliseconds) this {@link Data} was used.
         * @deprecated Contacts affinity information is no longer supported as of
         * Android version {@link android.os.Build.VERSION_CODES#Q}.
         * This column always contains 0.
         */
        @Deprecated
        public static final String LAST_TIME_USED = "last_time_used";
        public static final String LAST_TIME_USED = "last_time_used";


        /** The number of times the referenced {@link Data} has been used. */
        /**
         * The number of times the referenced {@link Data} has been used.
         * @deprecated Contacts affinity information is no longer supported as of
         * Android version {@link android.os.Build.VERSION_CODES#Q}.
         * This column always contains 0.
         */
        @Deprecated
        public static final String TIMES_USED = "times_used";
        public static final String TIMES_USED = "times_used";


        /** @hide Raw value. */
        /** @hide Raw value. */
@@ -4765,18 +4745,6 @@ public final class ContactsContract {
     * </tr>
     * </tr>
     * <tr>
     * <tr>
     * <td>int</td>
     * <td>int</td>
     * <td>{@link #TIMES_CONTACTED}</td>
     * <td>read-only</td>
     * <td>See {@link ContactsContract.Contacts}.</td>
     * </tr>
     * <tr>
     * <td>long</td>
     * <td>{@link #LAST_TIME_CONTACTED}</td>
     * <td>read-only</td>
     * <td>See {@link ContactsContract.Contacts}.</td>
     * </tr>
     * <tr>
     * <td>int</td>
     * <td>{@link #STARRED}</td>
     * <td>{@link #STARRED}</td>
     * <td>read-only</td>
     * <td>read-only</td>
     * <td>See {@link ContactsContract.Contacts}.</td>
     * <td>See {@link ContactsContract.Contacts}.</td>
@@ -5221,18 +5189,6 @@ public final class ContactsContract {
     * </tr>
     * </tr>
     * <tr>
     * <tr>
     * <td>int</td>
     * <td>int</td>
     * <td>{@link #TIMES_CONTACTED}</td>
     * <td>read-only</td>
     * <td>See {@link ContactsContract.Contacts}.</td>
     * </tr>
     * <tr>
     * <td>long</td>
     * <td>{@link #LAST_TIME_CONTACTED}</td>
     * <td>read-only</td>
     * <td>See {@link ContactsContract.Contacts}.</td>
     * </tr>
     * <tr>
     * <td>int</td>
     * <td>{@link #STARRED}</td>
     * <td>{@link #STARRED}</td>
     * <td>read-only</td>
     * <td>read-only</td>
     * <td>See {@link ContactsContract.Contacts}.</td>
     * <td>See {@link ContactsContract.Contacts}.</td>
@@ -8305,7 +8261,12 @@ public final class ContactsContract {
     * boolean successful = resolver.delete(DataUsageFeedback.DELETE_USAGE_URI, null, null) > 0;
     * boolean successful = resolver.delete(DataUsageFeedback.DELETE_USAGE_URI, null, null) > 0;
     * </pre>
     * </pre>
     * </p>
     * </p>
     *
     * @deprecated Contacts affinity information is no longer supported as of
     * Android version {@link android.os.Build.VERSION_CODES#Q}.
     * Both update and delete calls are always ignored.
     */
     */
    @Deprecated
    public static final class DataUsageFeedback {
    public static final class DataUsageFeedback {


        /**
        /**
@@ -8925,10 +8886,6 @@ public final class ContactsContract {
         * +<phone>", etc. If you must show the prefix text in the Contacts App, please use a
         * +<phone>", etc. If you must show the prefix text in the Contacts App, please use a
         * different DATA# column, and update your contacts.xml to point to this new column. </em>
         * different DATA# column, and update your contacts.xml to point to this new column. </em>
         * </li>
         * </li>
         * <li>Everytime the user sends a message to a contact, your app may choose to update the
         * {@link ContactOptionsColumns#TIMES_CONTACTED} entry through DataUsageFeedback class.
         * Doing this will allow Voice Assistant to bias speech recognition to contacts frequently
         * contacted, this is particularly useful for contact names that are hard to pronounce.</li>
         * </ul>
         * </ul>
         * If the app chooses not to integrate with the Contacts Provider (in particular, when
         * If the app chooses not to integrate with the Contacts Provider (in particular, when
         * either METADATA_ACCOUNT_TYPE or METADATA_MIMETYPE field is missing), Voice Assistant
         * either METADATA_ACCOUNT_TYPE or METADATA_MIMETYPE field is missing), Voice Assistant