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:
Michael Bestas 2016-05-08 01:14:37 +03:00
parent b77b8b5a70
commit 4a0ad7cfbb
1 changed files with 13 additions and 11 deletions

View File

@ -202,6 +202,7 @@ public class CMDatabaseHelper extends SQLiteOpenHelper{
}
if (upgradeVersion < 5) {
if (mUserHandle == UserHandle.USER_OWNER) {
db.beginTransaction();
SQLiteStatement stmt = null;
try {
@ -214,6 +215,7 @@ public class CMDatabaseHelper extends SQLiteOpenHelper{
if (stmt != null) stmt.close();
db.endTransaction();
}
}
upgradeVersion = 5;
}