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

Commit cadbe4cc authored by Yorke Lee's avatar Yorke Lee
Browse files

Update PinnedPositions API (2/2)

Remove the now unnecessary UPDATE_API and STAR_WHEN_PINNING fields
Make PinnedPositions public API once more

Bug: 15593967

Change-Id: I5eabee6977b93b5ddbf79ec8c01649f20b02abf1
parent bbc9cd32
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -23460,6 +23460,7 @@ package android.provider {
  protected static abstract interface ContactsContract.ContactOptionsColumns {
    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 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 STARRED = "starred";
    field public static final java.lang.String TIMES_CONTACTED = "times_contacted";
@@ -23737,6 +23738,13 @@ package android.provider {
    field public static final int UNDEFINED = 0; // 0x0
  }
  public static final class ContactsContract.PinnedPositions {
    ctor public ContactsContract.PinnedPositions();
    field public static final int DEMOTED = -1; // 0xffffffff
    field public static final java.lang.String UNDEMOTE_METHOD = "undemote";
    field public static final int UNPINNED = 2147483647; // 0x7fffffff
  }
  public static final class ContactsContract.Preferences {
    ctor public ContactsContract.Preferences();
    field public static final java.lang.String DISPLAY_ORDER = "android.contacts.DISPLAY_ORDER";
+2 −92
Original line number Diff line number Diff line
@@ -811,7 +811,6 @@ public final class ContactsContract {
         * The position at which the contact is pinned. If {@link PinnedPositions#UNPINNED},
         * the contact is not pinned. Also see {@link PinnedPositions}.
         * <P>Type: INTEGER </P>
         * @hide
         */
        public static final String PINNED = "pinned";

@@ -7745,8 +7744,8 @@ public final class ContactsContract {

    /**
     * <p>
     * API allowing applications to send pinning information for specified contacts to the
     * Contacts Provider.
     * Contact-specific information about whether or not a contact has been pinned by the user
     * at a particular position within the system contact application's user interface.
     * </p>
     *
     * <p>
@@ -7771,47 +7770,8 @@ public final class ContactsContract {
     * pinned positions can be positive integers that range anywhere from 0 to
     * {@link PinnedPositions#UNPINNED}.
     * </p>
     *
     * <p>
     * When using {@link PinnedPositions#UPDATE_URI} to update the pinned positions of
     * certain contacts, it may make sense for your application to star any pinned contacts
     * by default. To specify this behavior, set the boolean query parameter
     * {@link PinnedPositions#STAR_WHEN_PINNING} to true to force all pinned and unpinned
     * contacts to be automatically starred and unstarred.
     * </p>
     *
     * @hide
     */
    public static final class PinnedPositions {

        /**
         * <p>
         * This URI allows applications to update pinned positions for a provided set of contacts.
         * </p>
         *
         * <p>
         * The list of contactIds to pin and their corresponding pinned positions should be
         * provided in key-value pairs stored in a {@link ContentValues} object where the key
         * is a valid contactId, while each pinned position is a positive integer.
         * </p>
         *
         * <p>
         * Example:
         * <pre>
         * ContentValues values = new ContentValues();
         * values.put("10", 20);
         * values.put("12", 2);
         * values.put("15", PinnedPositions.UNPINNED);
         * int count = resolver.update(PinnedPositions.UPDATE_URI, values, null, null);
         * </pre>
         *
         * This pins the contact with id 10 at position 20, the contact with id 12 at position 2,
         * and unpins the contact with id 15.
         * </p>
         */
        public static final Uri UPDATE_URI = Uri.withAppendedPath(AUTHORITY_URI,
                "pinned_position_update");

        /**
         * <p>
         * The method to invoke in order to undemote a formerly demoted contact. The contact id of
@@ -7826,7 +7786,6 @@ public final class ContactsContract {
         * resolver.call(ContactsContract.AUTHORITY_URI, PinnedPositions.UNDEMOTE_METHOD,
         *         String.valueOf(contactId), null);
         * </pre>
         *
         * </p>
         */
        public static final String UNDEMOTE_METHOD = "undemote";
@@ -7844,55 +7803,6 @@ public final class ContactsContract {
         * just hidden from view.
         */
        public static final int DEMOTED = -1;

        /**
         * <p> Clients can provide this value as a pinned position to undemote a formerly demoted
         * contact. If the contact was formerly demoted, it will be restored to an
         * {@link #UNPINNED} position. If it was otherwise already pinned at another position,
         * it will not be affected.
         * </p>
         *
         * <p>
         * Example:
         * <pre>
         * ContentValues values = new ContentValues();
         * values.put("15", PinnedPositions.UNDEMOTE);
         * int count = resolver.update(ContactsContract.PinnedPositions.UPDATE_URI.buildUpon()
         *          .build(), values, null, null);
         * </pre>
         *
         * This restores the contact with id 15 to an {@link #UNPINNED} position, meaning that
         * other apps (e.g. the Dialer) that were formerly hiding this contact from view based on
         * its {@link #DEMOTED} position will start displaying it again.
         * </p>
         */
        public static final String UNDEMOTE = "undemote";

        /**
         * <p>
         * A boolean query parameter that can be used with {@link #UPDATE_URI}.
         * If "1" or "true", any contact that is pinned or unpinned will be correspondingly
         * starred or unstarred. Otherwise, starring information will not be affected by pinned
         * updates. This is false by default.
         * </p>
         *
         * <p>
         * Example:
         * <pre>
         * ContentValues values = new ContentValues();
         * values.put("10", 20);
         * values.put("15", PinnedPositions.UNPINNED);
         * int count = resolver.update(ContactsContract.PinnedPositions.UPDATE_URI.buildUpon()
         *          .appendQueryParameter(PinnedPositions.FORCE_STAR_WHEN_PINNING, "true").build(),
         *          values, null, null);
         * </pre>
         *
         * This will pin the contact with id 10 at position 20 and star it automatically if not
         * already starred, and unpin the contact with id 15, and unstar it automatically if not
         * already unstarred.
         * </p>
         */
        public static final String STAR_WHEN_PINNING = "star_when_pinning";
    }

    /**