diff options
| author | Gary Mai <garymai@google.com> | 2020-10-27 22:31:42 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-10-27 22:31:42 +0000 |
| commit | 9f0a381c2c806a7ac0f548d8f8d2b1f03f83b265 (patch) | |
| tree | 673407a0b4c2c9d4bc8311f01fd747fb3e7be432 /src | |
| parent | 77a3125d94cbe375bc2403388ed1e66e88af3e81 (diff) | |
| parent | 7109e98e134e3e635d595850ad01e5aaa1ae65e4 (diff) | |
| download | platform_packages_providers_ContactsProvider-9f0a381c2c806a7ac0f548d8f8d2b1f03f83b265.tar.gz platform_packages_providers_ContactsProvider-9f0a381c2c806a7ac0f548d8f8d2b1f03f83b265.tar.bz2 platform_packages_providers_ContactsProvider-9f0a381c2c806a7ac0f548d8f8d2b1f03f83b265.zip | |
Merge "Add new columns to accounts table"
Diffstat (limited to 'src')
| -rw-r--r-- | src/com/android/providers/contacts/ContactsDatabaseHelper.java | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/com/android/providers/contacts/ContactsDatabaseHelper.java b/src/com/android/providers/contacts/ContactsDatabaseHelper.java index d64908d5..35a3b968 100644 --- a/src/com/android/providers/contacts/ContactsDatabaseHelper.java +++ b/src/com/android/providers/contacts/ContactsDatabaseHelper.java @@ -144,7 +144,7 @@ public class ContactsDatabaseHelper extends SQLiteOpenHelper { * 1500-1599 S * </pre> */ - static final int DATABASE_VERSION = 1500; + static final int DATABASE_VERSION = 1501; private static final int MINIMUM_SUPPORTED_VERSION = 700; @VisibleForTesting @@ -700,6 +700,8 @@ public class ContactsDatabaseHelper extends SQLiteOpenHelper { String ACCOUNT_NAME = RawContacts.ACCOUNT_NAME; String ACCOUNT_TYPE = RawContacts.ACCOUNT_TYPE; String DATA_SET = RawContacts.DATA_SET; + String SIM_SLOT_INDEX = "sim_slot_index"; + String SIM_EF_TYPE = "sim_ef_type"; String CONCRETE_ACCOUNT_NAME = Tables.ACCOUNTS + "." + ACCOUNT_NAME; String CONCRETE_ACCOUNT_TYPE = Tables.ACCOUNTS + "." + ACCOUNT_TYPE; @@ -1219,8 +1221,10 @@ public class ContactsDatabaseHelper extends SQLiteOpenHelper { AccountsColumns._ID + " INTEGER PRIMARY KEY AUTOINCREMENT," + AccountsColumns.ACCOUNT_NAME + " TEXT, " + AccountsColumns.ACCOUNT_TYPE + " TEXT, " + - AccountsColumns.DATA_SET + " TEXT" + - ");"); + AccountsColumns.DATA_SET + " TEXT, " + + AccountsColumns.SIM_SLOT_INDEX + " INTEGER, " + + AccountsColumns.SIM_EF_TYPE + " INTEGER" + + ");"); // Note, there are two sets of the usage stat columns: LR_* and RAW_*. // RAW_* contain the real values, which clients can't access. The column names start @@ -2583,6 +2587,12 @@ public class ContactsDatabaseHelper extends SQLiteOpenHelper { oldVersion = 1500; } + if (isUpgradeRequired(oldVersion, newVersion, 1501)) { + upgradeToVersion1501(db); + upgradeViewsAndTriggers = true; + oldVersion = 1501; + } + // We extracted "calls" and "voicemail_status" at this point, but we can't remove them here // yet, until CallLogDatabaseHelper moves the data. @@ -3356,6 +3366,14 @@ public class ContactsDatabaseHelper extends SQLiteOpenHelper { } } + private void upgradeToVersion1501(SQLiteDatabase db) { + try { + db.execSQL("ALTER TABLE accounts ADD sim_slot_index INTEGER;"); + db.execSQL("ALTER TABLE accounts ADD sim_ef_type INTEGER;"); + } catch (SQLException ignore) { + } + } + /** * This method is only used in upgradeToVersion1101 method, and should not be used in other * places now. Because data15 is not used to generate hash_id for photo, and the new generating |
