From 57ac3d59c139ebc7d5ef470cbfb8bd315eff7a3e Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Mon, 15 Jun 2009 14:51:07 -0700 Subject: [PATCH] Moved owning package and restricted flag to Contact. Instead of having unique owner packages and restriction flags being enforced on each Data item, I moved these columns up to the Contact level. This approach greatly simplifies the provider logic. --- .../android/provider/ContactsContract.java | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/core/java/android/provider/ContactsContract.java b/core/java/android/provider/ContactsContract.java index 48dc3aecaa105..1ed0574046e49 100644 --- a/core/java/android/provider/ContactsContract.java +++ b/core/java/android/provider/ContactsContract.java @@ -260,6 +260,19 @@ public final class ContactsContract { */ private Contacts() {} + /** + * The package name that owns this contact and all of its details. This + * package has control over the {@link #IS_RESTRICTED} flag, and can + * grant {@link RestrictionExceptions} to other packages. + */ + public static final String PACKAGE = "package"; + + /** + * Flag indicating that this data entry has been restricted by the owner + * {@link #PACKAGE}. + */ + public static final String IS_RESTRICTED = "is_restricted"; + /** * A reference to the {@link Accounts#_ID} that this data belongs to. */ @@ -331,11 +344,6 @@ public final class ContactsContract { } private interface DataColumns { - /** - * The package name that defines this type of data. - */ - public static final String PACKAGE = "package"; - /** * The mime-type of the item represented by this row. */ @@ -360,12 +368,6 @@ public final class ContactsContract { */ public static final String IS_SUPER_PRIMARY = "is_super_primary"; - /** - * Flag indicating that this data entry has been restricted by the owner - * {@link #PACKAGE}. - */ - public static final String IS_RESTRICTED = "is_restricted"; - /** * The version of this data record. This is a read-only value. The data column is * guaranteed to not change without the version going up. This value is monotonically