diff options
| -rw-r--r-- | api/current.txt | 2 | ||||
| -rw-r--r-- | core/java/android/provider/ContactsContract.java | 86 | 
2 files changed, 80 insertions, 8 deletions
diff --git a/api/current.txt b/api/current.txt index 46cf2afc1f99..f3dda785fa67 100644 --- a/api/current.txt +++ b/api/current.txt @@ -16007,6 +16007,7 @@ package android.provider {    protected static abstract interface ContactsContract.GroupsColumns {      field public static final java.lang.String AUTO_ADD = "auto_add"; +    field public static final java.lang.String DATA_SET = "data_set";      field public static final java.lang.String DELETED = "deleted";      field public static final java.lang.String FAVORITES = "favorites";      field public static final java.lang.String GROUP_IS_READ_ONLY = "group_is_read_only"; @@ -16134,6 +16135,7 @@ package android.provider {    protected static abstract interface ContactsContract.RawContactsColumns {      field public static final java.lang.String AGGREGATION_MODE = "aggregation_mode";      field public static final java.lang.String CONTACT_ID = "contact_id"; +    field public static final java.lang.String DATA_SET = "data_set";      field public static final java.lang.String DELETED = "deleted";      field public static final java.lang.String RAW_CONTACT_IS_READ_ONLY = "raw_contact_is_read_only";      field public static final java.lang.String RAW_CONTACT_IS_USER_PROFILE = "raw_contact_is_user_profile"; diff --git a/core/java/android/provider/ContactsContract.java b/core/java/android/provider/ContactsContract.java index 9c12a44c81f3..ec67683cde8d 100644 --- a/core/java/android/provider/ContactsContract.java +++ b/core/java/android/provider/ContactsContract.java @@ -1871,6 +1871,18 @@ public final class ContactsContract {          public static final String CONTACT_ID = "contact_id";          /** +         * The data set within the account that this row belongs to.  This allows +         * multiple sync adapters for the same account type to distinguish between +         * each others' data. +         * +         * This is empty by default, and is completely optional.  It only needs to +         * be populated if multiple sync adapters are entering distinct data for +         * the same account type and account name. +         * <P>Type: TEXT</P> +         */ +        public static final String DATA_SET = "data_set"; + +        /**           * The aggregation mode for this contact.           * <P>Type: INTEGER</P>           */ @@ -2192,8 +2204,8 @@ public final class ContactsContract {       * <td>The name of the account instance to which this row belongs, which when paired with       * {@link #ACCOUNT_TYPE} identifies a specific account.       * For example, this will be the Gmail address if it is a Google account. -     * It should be set at the time -     * the raw contact is inserted and never changed afterwards.</td> +     * It should be set at the time the raw contact is inserted and never +     * changed afterwards.</td>       * </tr>       * <tr>       * <td>String</td> @@ -2203,8 +2215,8 @@ public final class ContactsContract {       * <p>       * The type of account to which this row belongs, which when paired with       * {@link #ACCOUNT_NAME} identifies a specific account. -     * It should be set at the time -     * the raw contact is inserted and never changed afterwards. +     * It should be set at the time the raw contact is inserted and never +     * changed afterwards.       * </p>       * <p>       * To ensure uniqueness, new account types should be chosen according to the @@ -2214,15 +2226,38 @@ public final class ContactsContract {       * </tr>       * <tr>       * <td>String</td> +     * <td>{@link #DATA_SET}</td> +     * <td>read/write-once</td> +     * <td> +     * <p> +     * The data set within the account that this row belongs to.  This allows +     * multiple sync adapters for the same account type to distinguish between +     * each others' data.  The combination of {@link #ACCOUNT_TYPE}, +     * {@link #ACCOUNT_NAME}, and {@link #DATA_SET} identifies a set of data +     * that is associated with a single sync adapter. +     * </p> +     * <p> +     * This is empty by default, and is completely optional.  It only needs to +     * be populated if multiple sync adapters are entering distinct data for +     * the same account type and account name. +     * </p> +     * <p> +     * It should be set at the time the raw contact is inserted and never +     * changed afterwards. +     * </p> +     * </td> +     * </tr> +     * <tr> +     * <td>String</td>       * <td>{@link #SOURCE_ID}</td>       * <td>read/write</td>       * <td>String that uniquely identifies this row to its source account.       * Typically it is set at the time the raw contact is inserted and never       * changed afterwards. The one notable exception is a new raw contact: it -     * will have an account name and type, but no source id. This -     * indicates to the sync adapter that a new contact needs to be created -     * server-side and its ID stored in the corresponding SOURCE_ID field on -     * the phone. +     * will have an account name and type (and possibly a data set), but no +     * source id. This indicates to the sync adapter that a new contact needs +     * to be created server-side and its ID stored in the corresponding +     * SOURCE_ID field on the phone.       * </td>       * </tr>       * <tr> @@ -6172,6 +6207,18 @@ public final class ContactsContract {       */      protected interface GroupsColumns {          /** +         * The data set within the account that this group belongs to.  This allows +         * multiple sync adapters for the same account type to distinguish between +         * each others' group data. +         * +         * This is empty by default, and is completely optional.  It only needs to +         * be populated if multiple sync adapters are entering distinct group data +         * for the same account type and account name. +         * <P>Type: TEXT</P> +         */ +        public static final String DATA_SET = "data_set"; + +        /**           * The display title of this group.           * <p>           * Type: TEXT @@ -6297,6 +6344,29 @@ public final class ContactsContract {       * In other words, it would be a really bad idea to delete and reinsert a       * group. A sync adapter should always do an update instead.</td>       * </tr> +     # <tr> +     * <td>String</td> +     * <td>{@link #DATA_SET}</td> +     * <td>read/write-once</td> +     * <td> +     * <p> +     * The data set within the account that this group belongs to.  This allows +     * multiple sync adapters for the same account type to distinguish between +     * each others' group data.  The combination of {@link #ACCOUNT_TYPE}, +     * {@link #ACCOUNT_NAME}, and {@link #DATA_SET} identifies a set of data +     * that is associated with a single sync adapter. +     * </p> +     * <p> +     * This is empty by default, and is completely optional.  It only needs to +     * be populated if multiple sync adapters are entering distinct data for +     * the same account type and account name. +     * </p> +     * <p> +     * It should be set at the time the group is inserted and never changed +     * afterwards. +     * </p> +     * </td> +     * </tr>       * <tr>       * <td>String</td>       * <td>{@link #TITLE}</td>  |