Fix settings db update sequence

The 'global' table only exists in the owner-user db instance; make
sure to apply global-setting update steps only when bringing up that
instance.

Bug 18069830

Change-Id: I843eabe710d9487de94690921d61adb181b45ed2
This commit is contained in:
Christopher Tate
2014-10-22 10:36:42 -07:00
parent 95dc663d18
commit 04e6827ace

View File

@@ -1829,16 +1829,18 @@ public class DatabaseHelper extends SQLiteOpenHelper {
} }
if (upgradeVersion < 114) { if (upgradeVersion < 114) {
db.beginTransaction(); if (mUserHandle == UserHandle.USER_OWNER) {
SQLiteStatement stmt = null; db.beginTransaction();
try { SQLiteStatement stmt = null;
stmt = db.compileStatement("INSERT OR IGNORE INTO global(name,value)" try {
+ " VALUES(?,?);"); stmt = db.compileStatement("INSERT OR IGNORE INTO global(name,value)"
loadSetting(stmt, Settings.Global.VOLTE_VT_ENABLED, ImsConfig.FeatureValueConstants.ON); + " VALUES(?,?);");
db.setTransactionSuccessful(); loadSetting(stmt, Settings.Global.VOLTE_VT_ENABLED, ImsConfig.FeatureValueConstants.ON);
} finally { db.setTransactionSuccessful();
db.endTransaction(); } finally {
if (stmt != null) stmt.close(); db.endTransaction();
if (stmt != null) stmt.close();
}
} }
upgradeVersion = 114; upgradeVersion = 114;
} }