diff --git a/core/java/android/provider/ContactsContract.java b/core/java/android/provider/ContactsContract.java index c3ec7a2aaf035..418a9d6238133 100644 --- a/core/java/android/provider/ContactsContract.java +++ b/core/java/android/provider/ContactsContract.java @@ -1320,6 +1320,59 @@ public final class ContactsContract { public static final String CONTENT_DIRECTORY = "data"; } + /** + *
+ * A sub-directory of a contact that contains all of its + * {@link ContactsContract.RawContacts} as well as + * {@link ContactsContract.Data} rows. To access this directory append + * {@link #CONTENT_DIRECTORY} to the contact URI. + *
+ *+ * Entity has three ID fields: {@link #CONTACT_ID} for the contact, + * {@link #RAW_CONTACT_ID} for the raw contact and {@link #DATA_ID} for + * the data rows. Entity always contains at least one row per + * constituent raw contact, even if there are no actual data rows. In + * this case the {@link #DATA_ID} field will be null. + *
+ *+ * Entity reads all data for the entire contact in one transaction, to + * guarantee consistency. There is significant data duplication + * in the Entity (each row repeats all Contact columns and all RawContact + * columns), so the benefits of transactional consistency should be weighed + * against the cost of transferring large amounts of denormalized data + * from the Provider. + *
+ * + * @hide + */ + public static final class Entity implements BaseColumns, ContactsColumns, + ContactNameColumns, RawContactsColumns, BaseSyncColumns, SyncColumns, DataColumns, + StatusColumns, ContactOptionsColumns, ContactStatusColumns { + /** + * no public constructor since this is a utility class + */ + private Entity() { + } + + /** + * The directory twig for this sub-table + */ + public static final String CONTENT_DIRECTORY = "entities"; + + /** + * The ID of the raw contact row. + *Type: INTEGER
+ */ + public static final String RAW_CONTACT_ID = "raw_contact_id"; + + /** + * The ID of the data row. The value will be null if this raw contact has no + * data rows. + *Type: INTEGER
+ */ + public static final String DATA_ID = "data_id"; + } + /** ** A read-only sub-directory of a single contact aggregate that @@ -2025,7 +2078,7 @@ public final class ContactsContract { public static final String CONTENT_DIRECTORY = "entity"; /** - * The ID of the data column. The value will be null if this raw contact has no + * The ID of the data row. The value will be null if this raw contact has no * data rows. *
Type: INTEGER
*/