am 1a9c0dfd: Mark all settings upgrade transactions as successful along the way
* commit '1a9c0dfdbbeba1bc498170be283394ba3e0e9752': Mark all settings upgrade transactions as successful along the way
This commit is contained in:
@@ -67,7 +67,7 @@ public class DatabaseHelper extends SQLiteOpenHelper {
|
||||
// database gets upgraded properly. At a minimum, please confirm that 'upgradeVersion'
|
||||
// is properly propagated through your change. Not doing so will result in a loss of user
|
||||
// settings.
|
||||
private static final int DATABASE_VERSION = 84;
|
||||
private static final int DATABASE_VERSION = 85;
|
||||
|
||||
private Context mContext;
|
||||
private int mUserHandle;
|
||||
@@ -1241,6 +1241,8 @@ public class DatabaseHelper extends SQLiteOpenHelper {
|
||||
loadBooleanSetting(stmt,
|
||||
Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE,
|
||||
R.bool.def_accessibility_display_magnification_auto_update);
|
||||
|
||||
db.setTransactionSuccessful();
|
||||
} finally {
|
||||
db.endTransaction();
|
||||
if (stmt != null) stmt.close();
|
||||
@@ -1248,6 +1250,28 @@ public class DatabaseHelper extends SQLiteOpenHelper {
|
||||
upgradeVersion = 84;
|
||||
}
|
||||
|
||||
if (upgradeVersion == 84) {
|
||||
db.beginTransaction();
|
||||
SQLiteStatement stmt = null;
|
||||
try {
|
||||
// Patch up the slightly-wrong key migration from 82 -> 83
|
||||
String[] settingsToMove = {
|
||||
Settings.Secure.ADB_ENABLED,
|
||||
Settings.Secure.BLUETOOTH_ON,
|
||||
Settings.Secure.DATA_ROAMING,
|
||||
Settings.Secure.DEVICE_PROVISIONED,
|
||||
Settings.Secure.INSTALL_NON_MARKET_APPS,
|
||||
Settings.Secure.USB_MASS_STORAGE_ENABLED
|
||||
};
|
||||
moveSettingsToNewTable(db, TABLE_SECURE, TABLE_GLOBAL, settingsToMove);
|
||||
db.setTransactionSuccessful();
|
||||
} finally {
|
||||
db.endTransaction();
|
||||
if (stmt != null) stmt.close();
|
||||
}
|
||||
upgradeVersion = 85;
|
||||
}
|
||||
|
||||
// *** Remember to update DATABASE_VERSION above!
|
||||
|
||||
if (upgradeVersion != currentVersion) {
|
||||
|
||||
Reference in New Issue
Block a user