Fix typo in TelephonyProvider.
Fix it in new version 52 to make sure user upgraded to 51 can get this
fix properly.
Test: unit test
Change-Id: I3697789054536a58d90483dd7dfe336f55a49b46
Merged-In: I3697789054536a58d90483dd7dfe336f55a49b46
diff --git a/src/com/android/providers/telephony/TelephonyProvider.java b/src/com/android/providers/telephony/TelephonyProvider.java
index dac9cde..bb7dd57 100644
--- a/src/com/android/providers/telephony/TelephonyProvider.java
+++ b/src/com/android/providers/telephony/TelephonyProvider.java
@@ -155,7 +155,7 @@
private static final boolean DBG = true;
private static final boolean VDBG = false; // STOPSHIP if true
- private static final int DATABASE_VERSION = 52 << 16;
+ private static final int DATABASE_VERSION = 53 << 16;
private static final int URL_UNKNOWN = 0;
private static final int URL_TELEPHONY = 1;
private static final int URL_CURRENT = 2;
@@ -1694,7 +1694,7 @@
if (oldVersion < (52 << 16 | 6)) {
try {
// Try to update the siminfo table. It might not be there.
- db.execSQL("ALTER TABLE " + SIMINFO_TABLE + " ADD COLUMN "
+ db.execSQL("ALERT TABLE " + SIMINFO_TABLE + " ADD COLUMN "
+ Telephony.SimInfo.COLUMN_NR_ADVANCED_CALLING_ENABLED
+ " INTEGER DEFAULT -1;");
} catch (SQLiteException e) {
@@ -1705,6 +1705,22 @@
}
oldVersion = 52 << 16 | 6;
}
+
+ if (oldVersion < (53 << 16 | 6)) {
+ try {
+ // Try to update the siminfo table. Fix typo error in version 51.
+ db.execSQL("ALTER TABLE " + SIMINFO_TABLE + " ADD COLUMN "
+ + Telephony.SimInfo.COLUMN_D2D_STATUS_SHARING_SELECTED_CONTACTS
+ + " TEXT;");
+ } catch (SQLiteException e) {
+ if (DBG) {
+ log("onUpgrade failed to updated " + SIMINFO_TABLE
+ + " to add d2d status sharing contacts. ");
+ }
+ }
+ oldVersion = 53 << 16 | 6;
+ }
+
if (DBG) {
log("dbh.onUpgrade:- db=" + db + " oldV=" + oldVersion + " newV=" + newVersion);
}
@@ -3509,7 +3525,7 @@
PersistableBundle backedUpSimInfoEntry, int backupDataFormatVersion,
String isoCountryCodeFromDb,
List<String> wfcRestoreBlockedCountries) {
- if (DATABASE_VERSION != 52 << 16) {
+ if (DATABASE_VERSION != 53 << 16) {
throw new AssertionError("The database schema has been updated which might make "
+ "the format of #BACKED_UP_SIM_SPECIFIC_SETTINGS_FILE outdated. Make sure to "
+ "1) review whether any of the columns in #SIM_INFO_COLUMNS_TO_BACKUP have "