From 918007b75539f5eabfd173a369c2da628c607ba7 Mon Sep 17 00:00:00 2001 From: Dmitri Plotnikov Date: Wed, 20 Jan 2010 12:12:11 -0800 Subject: [PATCH] Introducing the notion of "verified name" on a raw contact. This flag can be set by a sync adapter if it is certain that the name is correct (a social network sync adapter would be a good example of this). It can also be explicitly set by the user in the Contact Edit UI. Bug: 2164422 Change-Id: Id46e04c28eeb0dc386adfc6ad8988dda50824e2b --- .../android/provider/ContactsContract.java | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/core/java/android/provider/ContactsContract.java b/core/java/android/provider/ContactsContract.java index 5819b59e4bb09..16746d47ee9e7 100644 --- a/core/java/android/provider/ContactsContract.java +++ b/core/java/android/provider/ContactsContract.java @@ -1102,6 +1102,33 @@ public final class ContactsContract { *

Type: INTEGER

*/ public static final String DELETED = "deleted"; + + /** + * The "name_verified" flag: "1" means that the name fields on this raw + * contact can be trusted and therefore should be used for the entire + * aggregated contact. + *

+ * If an aggregated contact contains more than one raw contact with a + * verified name, one of those verified names is chosen at random. + * If an aggregated contact contains no verified names, the + * name is chosen randomly from the constituent raw contacts. + *

+ *

+ * Updating this flag from "0" to "1" automatically resets it to "0" on + * all other raw contacts in the same aggregated contact. + *

+ *

+ * Sync adapters should only specify a value for this column when + * inserting a raw contact and leave it out when doing an update. + *

+ *

+ * The default value is "0" + *

+ *

Type: INTEGER

+ * + * @hide + */ + public static final String NAME_VERIFIED = "name_verified"; } /** @@ -1673,6 +1700,7 @@ public final class ContactsContract { DatabaseUtils.cursorLongToContentValuesIfPresent(cursor, cv, CONTACT_ID); DatabaseUtils.cursorLongToContentValuesIfPresent(cursor, cv, STARRED); DatabaseUtils.cursorIntToContentValuesIfPresent(cursor, cv, IS_RESTRICTED); + DatabaseUtils.cursorIntToContentValuesIfPresent(cursor, cv, NAME_VERIFIED); android.content.Entity contact = new android.content.Entity(cv); // read data rows until the contact id changes