summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/provider/ContactsContract.java79
1 files changed, 77 insertions, 2 deletions
diff --git a/core/java/android/provider/ContactsContract.java b/core/java/android/provider/ContactsContract.java
index b2c1c2de79ce..36e2c5653513 100644
--- a/core/java/android/provider/ContactsContract.java
+++ b/core/java/android/provider/ContactsContract.java
@@ -445,7 +445,7 @@ public final class ContactsContract {
/**
* One of {@link #SHORTCUT_SUPPORT_NONE}, {@link #SHORTCUT_SUPPORT_DATA_ITEMS_ONLY},
- * {@link #SHORTCUT_SUPPORT_FULL}, This is the expectation the directory
+ * {@link #SHORTCUT_SUPPORT_FULL}. This is the expectation the directory
* has for shortcuts created for its elements. Clients must obey this setting.
*/
public static final String SHORTCUT_SUPPORT = "shortcutSupport";
@@ -470,6 +470,37 @@ public final class ContactsContract {
public static final int SHORTCUT_SUPPORT_FULL = 2;
/**
+ * One of {@link #PHOTO_SUPPORT_NONE}, {@link #PHOTO_SUPPORT_THUMBNAIL_ONLY},
+ * {@link #PHOTO_SUPPORT_FULL}. This is a feature flag indicating the extent
+ * to which the directory supports contact photos.
+ */
+ public static final String PHOTO_SUPPORT = "photoSupport";
+
+ /**
+ * An {@link #PHOTO_SUPPORT} setting that indicates that the directory
+ * does not provide any photos.
+ */
+ public static final int PHOTO_SUPPORT_NONE = 0;
+
+ /**
+ * An {@link #PHOTO_SUPPORT} setting that indicates that the directory
+ * can only produce small size thumbnails of contact photos.
+ */
+ public static final int PHOTO_SUPPORT_THUMBNAIL_ONLY = 1;
+
+ /**
+ * An {@link #PHOTO_SUPPORT} setting that indicates that the directory
+ * has full-size contact photos, but cannot provide scaled thumbnails.
+ */
+ public static final int PHOTO_SUPPORT_FULL_SIZE_ONLY = 2;
+
+ /**
+ * An {@link #PHOTO_SUPPORT} setting that indicates that the directory
+ * can produce thumbnails as well as full-size contact photos.
+ */
+ public static final int PHOTO_SUPPORT_FULL = 3;
+
+ /**
* Notifies the system of a change in the list of directories handled by
* a particular directory provider. The Contacts provider will turn around
* and send a query to the directory provider for the full list of directories,
@@ -676,12 +707,42 @@ public final class ContactsContract {
public static final String NAME_RAW_CONTACT_ID = "name_raw_contact_id";
/**
- * Reference to the row in the data table holding the photo.
+ * Reference to the row in the data table holding the photo. A photo can
+ * be referred to either by ID (this field) or by URI (see {@link #PHOTO_THUMBNAIL_URI}
+ * and {@link #PHOTO_URI}).
+ * If PHOTO_ID is null, consult {@link #PHOTO_URI} or {@link #PHOTO_THUMBNAIL_URI},
+ * which is a more generic mechanism for referencing the contact photo, especially for
+ * contacts returned by non-local directories (see {@link Directory}).
+ *
* <P>Type: INTEGER REFERENCES data(_id)</P>
*/
public static final String PHOTO_ID = "photo_id";
/**
+ * A URI that can be used to retrieve the contact's full-size photo.
+ * A photo can be referred to either by a URI (this field) or by ID
+ * (see {@link #PHOTO_ID}). If PHOTO_ID is not null, PHOTO_URI and
+ * PHOTO_THUMBNAIL_URI shall not be null (but not necessarily vice versa).
+ * Thus using PHOTO_URI is a more robust method of retrieving contact photos.
+ *
+ * <P>Type: TEXT</P>
+ */
+ public static final String PHOTO_URI = "photo_uri";
+
+ /**
+ * A URI that can be used to retrieve a thumbnail of the contact's photo.
+ * A photo can be referred to either by a URI (this field or {@link #PHOTO_URI})
+ * or by ID (see {@link #PHOTO_ID}). If PHOTO_ID is not null, PHOTO_URI and
+ * PHOTO_THUMBNAIL_URI shall not be null (but not necessarily vice versa).
+ * If the content provider does not differentiate between full-size photos
+ * and thumbnail photos, PHOTO_THUMBNAIL_URI and {@link #PHOTO_URI} can contain
+ * the same value, but either both shell be null or both not null.
+ *
+ * <P>Type: TEXT</P>
+ */
+ public static final String PHOTO_THUMBNAIL_URI = "photo_thumb_uri";
+
+ /**
* Lookup value that reflects the {@link Groups#GROUP_VISIBLE} state of
* any {@link CommonDataKinds.GroupMembership} for this contact.
*/
@@ -1032,6 +1093,20 @@ public final class ContactsContract {
* that mime type.</td>
* </tr>
* <tr>
+ * <td>long</td>
+ * <td>{@link #PHOTO_URI}</td>
+ * <td>read-only</td>
+ * <td>A URI that can be used to retrieve the contact's full-size photo. This
+ * column is the preferred method of retrieving the contact photo.</td>
+ * </tr>
+ * <tr>
+ * <td>long</td>
+ * <td>{@link #PHOTO_THUMBNAIL_URI}</td>
+ * <td>read-only</td>
+ * <td>A URI that can be used to retrieve the thumbnail of contact's photo. This
+ * column is the preferred method of retrieving the contact photo.</td>
+ * </tr>
+ * <tr>
* <td>int</td>
* <td>{@link #IN_VISIBLE_GROUP}</td>
* <td>read-only</td>