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.
diff --git a/api/current.xml b/api/current.xml
index 5efaed1..364c113 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -113927,6 +113927,17 @@
visibility="public"
>
</field>
+<field name="OFFICE_LOCATION"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value=""data9""
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
<field name="PHONETIC_NAME"
type="java.lang.String"
transient="false"
@@ -115097,6 +115108,27 @@
visibility="public"
>
</field>
+<field name="CONTENT_VCARD_TYPE"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value=""text/x-vcard""
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="CONTENT_VCARD_URI"
+ type="android.net.Uri"
+ transient="false"
+ volatile="false"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
</class>
<class name="ContactsContract.Contacts.AggregationSuggestions"
extends="java.lang.Object"
diff --git a/core/java/android/provider/ContactsContract.java b/core/java/android/provider/ContactsContract.java
index 3a9bad8..ef79ed3 100644
--- a/core/java/android/provider/ContactsContract.java
+++ b/core/java/android/provider/ContactsContract.java
@@ -318,6 +318,17 @@
"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.
*
@@ -435,6 +446,12 @@
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.
*/
@@ -1633,6 +1650,12 @@
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.
*/