From 3d340e70e510258a02dbc458bb7cd8478247ff09 Mon Sep 17 00:00:00 2001 From: Daisuke Miyakawa Date: Sun, 23 Oct 2011 10:46:30 -0700 Subject: [PATCH] Introduce Callable URI as hidden API New Phone UI wants both phone numbers and Sip addresses, which are all "callable" data. This API allows ContactsProvider to return both as one unified Cursor. There are a few caveats: - There's no MIMETYPE for callable, since it is not an actual data type. - Each row may require different interpretation for each column. For example, the meaning of type (data2) would be very different between Phone and Sip. Caller applications must absorb those minor differences by themselves (at least for now). Bug: 5039627 Change-Id: I4729c87ecd11296599ed0313e8ad1f5aeabbd32b --- .../android/provider/ContactsContract.java | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/core/java/android/provider/ContactsContract.java b/core/java/android/provider/ContactsContract.java index 4bc0892d3d755..902eb557c513c 100644 --- a/core/java/android/provider/ContactsContract.java +++ b/core/java/android/provider/ContactsContract.java @@ -6736,6 +6736,39 @@ public final class ContactsContract { */ public static final String NAMESPACE = DataColumns.DATA2; } + + /** + *

+ * Convenient functionalities for "callable" data. Note that, this is NOT a separate data + * kind. + *

+ *

+ * This URI allows the ContactsProvider to return a unified result for "callable" data + * that users can use for calling purposes. {@link Phone} and {@link SipAddress} are the + * current examples for "callable", but may be expanded to the other types. + *

+ *

+ * Each returned row may have a different MIMETYPE and thus different interpretation for + * each column. For example the meaning for {@link Phone}'s type is different than + * {@link SipAddress}'s. + *

+ * + * @hide + */ + public static final class Callable implements DataColumnsWithJoins, CommonColumns { + /** + * Similar to {@link Phone#CONTENT_URI}, but returns callable data instead of only + * phone numbers. + */ + public static final Uri CONTENT_URI = Uri.withAppendedPath(Data.CONTENT_URI, + "callables"); + /** + * Similar to {@link Phone#CONTENT_FILTER_URI}, but allows users to filter callable + * data. + */ + public static final Uri CONTENT_FILTER_URI = Uri.withAppendedPath(CONTENT_URI, + "filter"); + } } /**