summaryrefslogtreecommitdiffstats
path: root/src/com/android/providers/contacts/ContactsDatabaseHelper.java
diff options
context:
space:
mode:
authorTingting <tingtingw@google.com>2015-03-17 10:15:13 -0700
committerTingting <tingtingw@google.com>2015-03-17 14:53:19 -0700
commit3a9b227565f9cf1eccb736b764d34dba6f20bdac (patch)
treefd08c918ba42179573d218ca1987eff1cdf2fffc /src/com/android/providers/contacts/ContactsDatabaseHelper.java
parentd11be3979d9b810908938b1a621eaa1fd65d4870 (diff)
downloadpackages_providers_ContactsProvider-3a9b227565f9cf1eccb736b764d34dba6f20bdac.zip
packages_providers_ContactsProvider-3a9b227565f9cf1eccb736b764d34dba6f20bdac.tar.gz
packages_providers_ContactsProvider-3a9b227565f9cf1eccb736b764d34dba6f20bdac.tar.bz2
Make contacts backup schema change accessible.
raw_contacts.backup_id and data.hash_id have been added to schema. To make them accessible, they need to be added to projection map. BUG 19667203 Change-Id: I7d122843668d7ed31fc998a2c7f00dc909181fc8
Diffstat (limited to 'src/com/android/providers/contacts/ContactsDatabaseHelper.java')
-rw-r--r--src/com/android/providers/contacts/ContactsDatabaseHelper.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/com/android/providers/contacts/ContactsDatabaseHelper.java b/src/com/android/providers/contacts/ContactsDatabaseHelper.java
index 7cdda65..8cd1c64 100644
--- a/src/com/android/providers/contacts/ContactsDatabaseHelper.java
+++ b/src/com/android/providers/contacts/ContactsDatabaseHelper.java
@@ -121,7 +121,7 @@ public class ContactsDatabaseHelper extends SQLiteOpenHelper {
* 1000-1099 M
* </pre>
*/
- static final int DATABASE_VERSION = 1005;
+ static final int DATABASE_VERSION = 1006;
public interface Tables {
public static final String CONTACTS = "contacts";
@@ -413,6 +413,8 @@ public class ContactsDatabaseHelper extends SQLiteOpenHelper {
public static final String CONCRETE_ACCOUNT_ID = Tables.RAW_CONTACTS + "." + ACCOUNT_ID;
public static final String CONCRETE_SOURCE_ID =
Tables.RAW_CONTACTS + "." + RawContacts.SOURCE_ID;
+ public static final String CONCRETE_BACKUP_ID =
+ Tables.RAW_CONTACTS + "." + RawContacts.BACKUP_ID;
public static final String CONCRETE_VERSION =
Tables.RAW_CONTACTS + "." + RawContacts.VERSION;
public static final String CONCRETE_DIRTY =
@@ -1884,6 +1886,7 @@ public class ContactsDatabaseHelper extends SQLiteOpenHelper {
+ AccountsColumns.CONCRETE_DATA_SET + " END) AS "
+ RawContacts.ACCOUNT_TYPE_AND_DATA_SET + ","
+ RawContactsColumns.CONCRETE_SOURCE_ID + " AS " + RawContacts.SOURCE_ID + ","
+ + RawContactsColumns.CONCRETE_BACKUP_ID + " AS " + RawContacts.BACKUP_ID + ","
+ RawContactsColumns.CONCRETE_VERSION + " AS " + RawContacts.VERSION + ","
+ RawContactsColumns.CONCRETE_DIRTY + " AS " + RawContacts.DIRTY + ","
+ RawContactsColumns.CONCRETE_SYNC1 + " AS " + RawContacts.SYNC1 + ","
@@ -2006,7 +2009,6 @@ public class ContactsDatabaseHelper extends SQLiteOpenHelper {
+ RawContactsColumns.PHONEBOOK_BUCKET_ALTERNATIVE + ", "
+ dbForProfile() + " AS " + RawContacts.RAW_CONTACT_IS_USER_PROFILE + ", "
+ rawContactOptionColumns + ", "
- + RawContacts.BACKUP_ID + ", "
+ syncColumns
+ " FROM " + Tables.RAW_CONTACTS
+ " JOIN " + Tables.ACCOUNTS + " ON ("
@@ -2897,6 +2899,11 @@ public class ContactsDatabaseHelper extends SQLiteOpenHelper {
oldVersion = 1005;
}
+ if (oldVersion < 1006) {
+ upgradeViewsAndTriggers = true;
+ oldVersion = 1006;
+ }
+
if (oldVersion < 1000) {
upgradeToVersion1000(db);
oldVersion = 1000;