Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ff18bbf8 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

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.
parent 13a90abc
Loading
Loading
Loading
Loading
+32 −0
Original line number Diff line number Diff line
@@ -113927,6 +113927,17 @@
 visibility="public"
>
</field>
<field name="OFFICE_LOCATION"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;data9&quot;"
 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="&quot;text/x-vcard&quot;"
 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"
+23 −0
Original line number Diff line number Diff line
@@ -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.