Loading packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +24 −14 Original line number Diff line number Diff line Loading @@ -61,7 +61,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 = 61; private static final int DATABASE_VERSION = 62; private Context mContext; Loading Loading @@ -793,22 +793,15 @@ public class DatabaseHelper extends SQLiteOpenHelper { } if (upgradeVersion == 60) { // Increase screen timeout for tablet db.beginTransaction(); SQLiteStatement stmt = null; try { stmt = db.compileStatement("INSERT OR REPLACE INTO system(name,value)" + " VALUES(?,?);"); loadIntegerSetting(stmt, Settings.System.SCREEN_OFF_TIMEOUT, R.integer.def_screen_off_timeout); db.setTransactionSuccessful(); } finally { db.endTransaction(); if (stmt != null) stmt.close(); } upgradeScreenTimeout(db); upgradeVersion = 61; } if (upgradeVersion == 61) { upgradeScreenTimeout(db); upgradeVersion = 62; } // *** Remember to update DATABASE_VERSION above! if (upgradeVersion != currentVersion) { Loading Loading @@ -914,6 +907,23 @@ public class DatabaseHelper extends SQLiteOpenHelper { } } private void upgradeScreenTimeout(SQLiteDatabase db) { // Change screen timeout to current default db.beginTransaction(); SQLiteStatement stmt = null; try { stmt = db.compileStatement("INSERT OR REPLACE INTO system(name,value)" + " VALUES(?,?);"); loadIntegerSetting(stmt, Settings.System.SCREEN_OFF_TIMEOUT, R.integer.def_screen_off_timeout); db.setTransactionSuccessful(); } finally { db.endTransaction(); if (stmt != null) stmt.close(); } } /** * Loads the default set of bookmarked shortcuts from an xml file. * Loading Loading
packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +24 −14 Original line number Diff line number Diff line Loading @@ -61,7 +61,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 = 61; private static final int DATABASE_VERSION = 62; private Context mContext; Loading Loading @@ -793,22 +793,15 @@ public class DatabaseHelper extends SQLiteOpenHelper { } if (upgradeVersion == 60) { // Increase screen timeout for tablet db.beginTransaction(); SQLiteStatement stmt = null; try { stmt = db.compileStatement("INSERT OR REPLACE INTO system(name,value)" + " VALUES(?,?);"); loadIntegerSetting(stmt, Settings.System.SCREEN_OFF_TIMEOUT, R.integer.def_screen_off_timeout); db.setTransactionSuccessful(); } finally { db.endTransaction(); if (stmt != null) stmt.close(); } upgradeScreenTimeout(db); upgradeVersion = 61; } if (upgradeVersion == 61) { upgradeScreenTimeout(db); upgradeVersion = 62; } // *** Remember to update DATABASE_VERSION above! if (upgradeVersion != currentVersion) { Loading Loading @@ -914,6 +907,23 @@ public class DatabaseHelper extends SQLiteOpenHelper { } } private void upgradeScreenTimeout(SQLiteDatabase db) { // Change screen timeout to current default db.beginTransaction(); SQLiteStatement stmt = null; try { stmt = db.compileStatement("INSERT OR REPLACE INTO system(name,value)" + " VALUES(?,?);"); loadIntegerSetting(stmt, Settings.System.SCREEN_OFF_TIMEOUT, R.integer.def_screen_off_timeout); db.setTransactionSuccessful(); } finally { db.endTransaction(); if (stmt != null) stmt.close(); } } /** * Loads the default set of bookmarked shortcuts from an xml file. * Loading