From 161dd86394a9733fd7ff303c31481cae7e31e7b4 Mon Sep 17 00:00:00 2001 From: Evan Millar Date: Fri, 12 Jun 2009 16:02:43 -0700 Subject: [PATCH] Add new URIs to the Phone and Postal classes. The Postal class now contains: CONTENT_URI * The content:// style URI for all data records of the * Postal.CONTENT_ITEM_TYPE mimetype, combined with the associated contact * and aggregate data. CONTENT_TYPE * The MIME type of CONTENT_URI providing a directory of * postal addresses. The Phone class now contains: CONTENT_URI * The content:// style URI for all data records of the * Phone.CONTENT_ITEM_TYPE mimetype, combined with the associated contact * and aggregate data. CONTENT_FILTER_URI * The content:// style URI for filtering data records of the * Phone.CONTENT_ITEM_TYPE mimetype, combined with the associated contact * and aggregate data. The filter argument should be passed * as an additional path segment after this URI. CONTENT_TYPE * The MIME type of #CONTENT_URI providing a directory of * phones. --- .../android/provider/ContactsContract.java | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/core/java/android/provider/ContactsContract.java b/core/java/android/provider/ContactsContract.java index d7e7d8d3c3613..b9c9236731143 100644 --- a/core/java/android/provider/ContactsContract.java +++ b/core/java/android/provider/ContactsContract.java @@ -171,6 +171,14 @@ public final class ContactsContract { */ public static final Uri CONTENT_SUMMARY_URI = Uri.withAppendedPath(AUTHORITY_URI, "aggregates_summary"); + /** + * The content:// style URI used for "type-to-filter" functionality on the + * {@link CONTENT_SUMMARY_URI} URI. The filter string will be used to match + * various parts of the aggregate name. The filter argument should be passed + * as an additional path segment after this URI. + */ + public static final Uri CONTENT_SUMMARY_FILTER_URI = Uri.withAppendedPath( + CONTENT_SUMMARY_URI, "filter"); /** * The MIME type of {@link #CONTENT_URI} providing a directory of @@ -676,6 +684,29 @@ public final class ContactsContract { /** Mime-type used when storing this in data table. */ public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/phone"; + /** + * The MIME type of {@link #CONTENT_URI} providing a directory of + * phones. + */ + public static final String CONTENT_TYPE = "vnd.android.cursor.dir/phone"; + + /** + * The content:// style URI for all data records of the + * {@link Phone.CONTENT_ITEM_TYPE} mimetype, combined with the associated contact + * and aggregate data. + */ + public static final Uri CONTENT_URI = Uri.withAppendedPath(Data.CONTENT_URI, + "phones"); + + /** + * The content:// style URI for filtering data records of the + * {@link Phone.CONTENT_ITEM_TYPE} mimetype, combined with the associated contact + * and aggregate data. The filter argument should be passed + * as an additional path segment after this URI. + */ + public static final Uri CONTENT_FILTER_URI = Uri.withAppendedPath(CONTENT_URI, + "filter"); + public static final int TYPE_HOME = 1; public static final int TYPE_MOBILE = 2; public static final int TYPE_WORK = 3; @@ -714,6 +745,20 @@ public final class ContactsContract { /** Mime-type used when storing this in data table. */ public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/postal-address"; + /** + * The MIME type of {@link #CONTENT_URI} providing a directory of + * postal addresses. + */ + public static final String CONTENT_TYPE = "vnd.android.cursor.dir/postal-address"; + + /** + * The content:// style URI for all data records of the + * {@link Postal.CONTENT_ITEM_TYPE} mimetype, combined with the associated contact + * and aggregate data. + */ + public static final Uri CONTENT_URI = Uri.withAppendedPath(Data.CONTENT_URI, + "postals"); + public static final int TYPE_HOME = 1; public static final int TYPE_WORK = 2; public static final int TYPE_OTHER = 3;