CMSettings: Fix upgrade from cm-12.1 after weather changes
* Only the owner can write to the global db Change-Id: Iec7736c28ff0bc7a35dae8bbc85ca2b1c137da49
This commit is contained in:
parent
b77b8b5a70
commit
4a0ad7cfbb
@ -202,17 +202,19 @@ public class CMDatabaseHelper extends SQLiteOpenHelper{
|
||||
}
|
||||
|
||||
if (upgradeVersion < 5) {
|
||||
db.beginTransaction();
|
||||
SQLiteStatement stmt = null;
|
||||
try {
|
||||
stmt = db.compileStatement("INSERT INTO global(name,value)"
|
||||
+ " VALUES(?,?);");
|
||||
loadIntegerSetting(stmt, CMSettings.Global.WEATHER_TEMPERATURE_UNIT,
|
||||
R.integer.def_temperature_unit);
|
||||
db.setTransactionSuccessful();
|
||||
} finally {
|
||||
if (stmt != null) stmt.close();
|
||||
db.endTransaction();
|
||||
if (mUserHandle == UserHandle.USER_OWNER) {
|
||||
db.beginTransaction();
|
||||
SQLiteStatement stmt = null;
|
||||
try {
|
||||
stmt = db.compileStatement("INSERT INTO global(name,value)"
|
||||
+ " VALUES(?,?);");
|
||||
loadIntegerSetting(stmt, CMSettings.Global.WEATHER_TEMPERATURE_UNIT,
|
||||
R.integer.def_temperature_unit);
|
||||
db.setTransactionSuccessful();
|
||||
} finally {
|
||||
if (stmt != null) stmt.close();
|
||||
db.endTransaction();
|
||||
}
|
||||
}
|
||||
upgradeVersion = 5;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user