Don't update global table when upgrading secondary users' database.

Bug: 7722149
Change-Id: I0c1373cba316b924701136579083274eb6c9b1da
This commit is contained in:
Amith Yamasani
2012-12-12 09:52:26 -08:00
parent 2735795f5a
commit 2d43fabaf7

View File

@@ -1507,17 +1507,19 @@ public class DatabaseHelper extends SQLiteOpenHelper {
if (upgradeVersion == 94) {
// Add wireless charging started sound setting
db.beginTransaction();
SQLiteStatement stmt = null;
try {
stmt = db.compileStatement("INSERT OR REPLACE INTO global(name,value)"
+ " VALUES(?,?);");
loadStringSetting(stmt, Settings.Global.WIRELESS_CHARGING_STARTED_SOUND,
R.string.def_wireless_charging_started_sound);
db.setTransactionSuccessful();
} finally {
db.endTransaction();
if (stmt != null) stmt.close();
if (mUserHandle == UserHandle.USER_OWNER) {
db.beginTransaction();
SQLiteStatement stmt = null;
try {
stmt = db.compileStatement("INSERT OR REPLACE INTO global(name,value)"
+ " VALUES(?,?);");
loadStringSetting(stmt, Settings.Global.WIRELESS_CHARGING_STARTED_SOUND,
R.string.def_wireless_charging_started_sound);
db.setTransactionSuccessful();
} finally {
db.endTransaction();
if (stmt != null) stmt.close();
}
}
upgradeVersion = 95;
}