From d8dfeb5ee82d679f491cd20e776907a69fb4f27c Mon Sep 17 00:00:00 2001
From: Fred Quintana
Date: Thu, 4 Jun 2009 10:28:49 -0700
Subject: [PATCH] - make it easier to add content values to the
ContentProviderOperation - add the group membership common kind as well as
some IM utilities to the ContactsContract
---
api/current.xml | 15 +++
.../content/ContentProviderOperation.java | 51 +++++++-
.../android/provider/ContactsContract.java | 122 +++++++++++++-----
3 files changed, 151 insertions(+), 37 deletions(-)
diff --git a/api/current.xml b/api/current.xml
index b0be4d58b4f1c..6fa5c3a29007b 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -28851,6 +28851,21 @@
+
+
+
+
+
+
Type: INTEGER
+ */
+ public static final String TYPE = "type";
+
+ public static final int TYPE_NEVER_MATCH = 0;
+ public static final int TYPE_ALWAYS_MATCH = 1;
+
+ /**
+ * A reference to the {@link android.provider.ContactsContract.Contacts#_ID} of one of
+ * the contacts that the rule applies to.
+ */
+ public static final String CONTACT_ID1 = "contact_id1";
+
+ /**
+ * A reference to the {@link android.provider.ContactsContract.Contacts#_ID} of the other
+ * contact that the rule applies to.
+ */
+ public static final String CONTACT_ID2 = "contact_id2";
+ }
/**
- * The MIME type of {@link #CONTENT_URI} providing a directory of data.
+ * Group Membership.
*/
- public static final String CONTENT_TYPE = "vnd.android.cursor.dir/aggregation_exception";
+ public static final class GroupMembership implements BaseCommonColumns {
+ private GroupMembership() {}
- /**
- * The type of exception: {@link #TYPE_NEVER_MATCH} or {@link #TYPE_ALWAYS_MATCH}.
- *
- * Type: INTEGER
- */
- public static final String TYPE = "type";
+ /** Mime-type used when storing this in data table. */
+ public static final String CONTENT_ITEM_TYPE =
+ "vnd.android.cursor.item/group_membership";
- public static final int TYPE_NEVER_MATCH = 0;
- public static final int TYPE_ALWAYS_MATCH = 1;
+ /**
+ * The row id of the group that this group membership refers to. Either this or the
+ * GROUP_SOURCE_ID must be set. If they are both set then they must refer to the same
+ * group.
+ * Type: INTEGER
+ */
+ public static final String GROUP_ROW_ID = "data1";
- /**
- * A reference to the {@link android.provider.ContactsContract.Contacts#_ID} of one of
- * the contacts that the rule applies to.
- */
- public static final String CONTACT_ID1 = "contact_id1";
-
- /**
- * A reference to the {@link android.provider.ContactsContract.Contacts#_ID} of the other
- * contact that the rule applies to.
- */
- public static final String CONTACT_ID2 = "contact_id2";
+ /**
+ * The source id of the group that this membership refers to. Either this or the
+ * GROUP_ROW_ID must be set. If they are both set then they must refer to the same
+ * group.
+ * Type: STRING
+ */
+ public static final String GROUP_SOURCE_ID = "data2";
+ }
}
}