diff options
author | Oscar Montemayor <oam@google.com> | 2010-02-22 16:12:07 -0800 |
---|---|---|
committer | Oscar Montemayor <oam@google.com> | 2010-02-22 16:23:19 -0800 |
commit | f1cbfff03ac53be9475f419d16a2e79b6c28a494 (patch) | |
tree | f1c5ef7ef327802c3284d058fa034ac9b01a796b /packages | |
parent | 582ae172a4e9784f377c9935b47160fba1764142 (diff) | |
download | frameworks_base-f1cbfff03ac53be9475f419d16a2e79b6c28a494.zip frameworks_base-f1cbfff03ac53be9475f419d16a2e79b6c28a494.tar.gz frameworks_base-f1cbfff03ac53be9475f419d16a2e79b6c28a494.tar.bz2 |
Fix bug when adding SET_INSTALL_LOCATION to SettingsProvider database, upgrade path.
Diffstat (limited to 'packages')
-rw-r--r-- | packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java index 5b616b3..8036e52 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java @@ -76,7 +76,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 = 50; + private static final int DATABASE_VERSION = 51; private Context mContext; @@ -642,6 +642,25 @@ public class DatabaseHelper extends SQLiteOpenHelper { upgradeVersion = 50; } + if (upgradeVersion == 50) { + /* + * New settings for set install location UI. + */ + db.beginTransaction(); + try { + SQLiteStatement stmt = db.compileStatement("INSERT INTO system(name,value)" + + " VALUES(?,?);"); + loadBooleanSetting(stmt, Settings.System.SET_INSTALL_LOCATION, + R.bool.set_install_location); + stmt.close(); + db.setTransactionSuccessful(); + } finally { + db.endTransaction(); + } + + upgradeVersion = 51; + } + if (upgradeVersion != currentVersion) { Log.w(TAG, "Got stuck trying to upgrade from version " + upgradeVersion + ", must wipe the settings provider"); |