Separate API for vCards through openAssetFileDescriptor().

Previously we overloaded Contacts.CONTENT_URI to return
vCard-formatted Contacts entries.  To fix http://b/2138790
this is a separate API that returns a well-known MIME-type.

Also helps fix http://b/2078399 by adding OFFICE_LOCATION.
This commit is contained in:
Jeff Sharkey
2009-09-27 16:55:00 -07:00
parent 13a90abcae
commit ff18bbf835
2 changed files with 55 additions and 0 deletions

View File

@@ -317,6 +317,17 @@ public final class ContactsContract {
public static final Uri CONTENT_LOOKUP_URI = Uri.withAppendedPath(CONTENT_URI,
"lookup");
/**
* Base {@link Uri} for referencing a single {@link Contacts} entry,
* created by appending {@link Contacts#LOOKUP_KEY} using
* {@link Uri#withAppendedPath(Uri, String)}. Provides
* {@link OpenableColumns} columns when queried, or returns the
* referenced contact formatted as a vCard when opened through
* {@link ContentResolver#openAssetFileDescriptor(Uri, String)}.
*/
public static final Uri CONTENT_VCARD_URI = Uri.withAppendedPath(CONTENT_URI,
"as_vcard");
/**
* Builds a {@link #CONTENT_LOOKUP_URI} style {@link Uri} describing the
* requested {@link Contacts} entry.
@@ -434,6 +445,12 @@ public final class ContactsContract {
*/
public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/contact";
/**
* The MIME type of a {@link #CONTENT_URI} subdirectory of a single
* person.
*/
public static final String CONTENT_VCARD_TYPE = "text/x-vcard";
/**
* A sub-directory of a single contact that contains all of the constituent raw contact
* {@link Data} rows.
@@ -1632,6 +1649,12 @@ public final class ContactsContract {
*/
public static final String PHONETIC_NAME = DATA8;
/**
* The office location of this organization.
* <P>Type: TEXT</P>
*/
public static final String OFFICE_LOCATION = DATA9;
/**
* Return the string resource that best describes the given
* {@link #TYPE}. Will always return a valid resource.