Bring back SHOULD_SYNC flag, expose CONTACT_ID in entities.

The frist allows sync groups to be edited, and the second
is used when editing contacts to know which aggregate ID to
strongly bind the new RawContact to.
diff --git a/src/com/android/providers/contacts/ContactsProvider2.java b/src/com/android/providers/contacts/ContactsProvider2.java
index fd923db..dbcb25b 100644
--- a/src/com/android/providers/contacts/ContactsProvider2.java
+++ b/src/com/android/providers/contacts/ContactsProvider2.java
@@ -623,6 +623,7 @@
         columns.put(Groups.SYSTEM_ID, Groups.SYSTEM_ID);
         columns.put(Groups.DELETED, Groups.DELETED);
         columns.put(Groups.NOTES, Groups.NOTES);
+        columns.put(Groups.SHOULD_SYNC, Groups.SHOULD_SYNC);
         columns.put(Groups.SYNC1, Tables.GROUPS + "." + Groups.SYNC1 + " AS " + Groups.SYNC1);
         columns.put(Groups.SYNC2, Tables.GROUPS + "." + Groups.SYNC2 + " AS " + Groups.SYNC2);
         columns.put(Groups.SYNC3, Tables.GROUPS + "." + Groups.SYNC3 + " AS " + Groups.SYNC3);
@@ -2526,7 +2527,8 @@
                 RawContacts.SYNC2,
                 RawContacts.SYNC3,
                 RawContacts.SYNC4,
-                RawContacts.DELETED};
+                RawContacts.DELETED,
+                RawContacts.CONTACT_ID};
 
         private static final int COLUMN_ACCOUNT_NAME = 0;
         private static final int COLUMN_ACCOUNT_TYPE = 1;
@@ -2546,6 +2548,7 @@
         private static final int COLUMN_SYNC3 = 33;
         private static final int COLUMN_SYNC4 = 34;
         private static final int COLUMN_DELETED = 35;
+        private static final int COLUMN_CONTACT_ID = 36;
 
         public ContactsEntityIterator(ContactsProvider2 provider, String contactsIdString, Uri uri,
                 String selection, String[] selectionArgs, String sortOrder) {
@@ -2615,6 +2618,7 @@
             contactValues.put(RawContacts.SYNC3, c.getString(COLUMN_SYNC3));
             contactValues.put(RawContacts.SYNC4, c.getString(COLUMN_SYNC4));
             contactValues.put(RawContacts.DELETED, c.getLong(COLUMN_DELETED));
+            contactValues.put(RawContacts.CONTACT_ID, c.getLong(COLUMN_CONTACT_ID));
             Entity contact = new Entity(contactValues);
 
             // read data rows until the contact id changes
diff --git a/src/com/android/providers/contacts/OpenHelper.java b/src/com/android/providers/contacts/OpenHelper.java
index 09935b1..f8fbbff 100644
--- a/src/com/android/providers/contacts/OpenHelper.java
+++ b/src/com/android/providers/contacts/OpenHelper.java
@@ -716,6 +716,7 @@
                 Groups.SYSTEM_ID + " TEXT," +
                 Groups.DELETED + " INTEGER NOT NULL DEFAULT 0," +
                 Groups.GROUP_VISIBLE + " INTEGER," +
+                Groups.SHOULD_SYNC + " INTEGER NOT NULL DEFAULT 1," +
                 Groups.SYNC1 + " TEXT, " +
                 Groups.SYNC2 + " TEXT, " +
                 Groups.SYNC3 + " TEXT, " +