Loading packages/SettingsProvider/res/values/defaults.xml +1 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ <bool name="def_screen_brightness_automatic_mode">false</bool> <fraction name="def_window_animation_scale">100%</fraction> <fraction name="def_window_transition_scale">100%</fraction> <bool name="def_haptic_feedback">true</bool> <bool name="def_bluetooth_on">false</bool> <bool name="def_install_non_market_apps">false</bool> Loading packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +27 −1 Original line number Diff line number Diff line Loading @@ -71,7 +71,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 = 41; private static final int DATABASE_VERSION = 42; private Context mContext; Loading Loading @@ -502,6 +502,25 @@ public class DatabaseHelper extends SQLiteOpenHelper { upgradeVersion = 41; } if (upgradeVersion == 41) { /* * Initialize newly public haptic feedback setting */ db.beginTransaction(); try { db.execSQL("DELETE FROM system WHERE name='" + Settings.System.HAPTIC_FEEDBACK_ENABLED + "'"); SQLiteStatement stmt = db.compileStatement("INSERT INTO system(name,value)" + " VALUES(?,?);"); loadDefaultHapticSettings(stmt); stmt.close(); db.setTransactionSuccessful(); } finally { db.endTransaction(); } upgradeVersion = 42; } if (upgradeVersion != currentVersion) { Log.w(TAG, "Got stuck trying to upgrade from version " + upgradeVersion + ", must wipe the settings provider"); Loading Loading @@ -746,6 +765,8 @@ public class DatabaseHelper extends SQLiteOpenHelper { loadBooleanSetting(stmt, Settings.System.ACCELEROMETER_ROTATION, R.bool.def_accelerometer_rotation); loadDefaultHapticSettings(stmt); stmt.close(); } Loading @@ -756,6 +777,11 @@ public class DatabaseHelper extends SQLiteOpenHelper { R.fraction.def_window_transition_scale, 1); } private void loadDefaultHapticSettings(SQLiteStatement stmt) { loadBooleanSetting(stmt, Settings.System.HAPTIC_FEEDBACK_ENABLED, R.bool.def_haptic_feedback); } private void loadSecureSettings(SQLiteDatabase db) { SQLiteStatement stmt = db.compileStatement("INSERT OR IGNORE INTO secure(name,value)" + " VALUES(?,?);"); Loading Loading
packages/SettingsProvider/res/values/defaults.xml +1 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ <bool name="def_screen_brightness_automatic_mode">false</bool> <fraction name="def_window_animation_scale">100%</fraction> <fraction name="def_window_transition_scale">100%</fraction> <bool name="def_haptic_feedback">true</bool> <bool name="def_bluetooth_on">false</bool> <bool name="def_install_non_market_apps">false</bool> Loading
packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +27 −1 Original line number Diff line number Diff line Loading @@ -71,7 +71,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 = 41; private static final int DATABASE_VERSION = 42; private Context mContext; Loading Loading @@ -502,6 +502,25 @@ public class DatabaseHelper extends SQLiteOpenHelper { upgradeVersion = 41; } if (upgradeVersion == 41) { /* * Initialize newly public haptic feedback setting */ db.beginTransaction(); try { db.execSQL("DELETE FROM system WHERE name='" + Settings.System.HAPTIC_FEEDBACK_ENABLED + "'"); SQLiteStatement stmt = db.compileStatement("INSERT INTO system(name,value)" + " VALUES(?,?);"); loadDefaultHapticSettings(stmt); stmt.close(); db.setTransactionSuccessful(); } finally { db.endTransaction(); } upgradeVersion = 42; } if (upgradeVersion != currentVersion) { Log.w(TAG, "Got stuck trying to upgrade from version " + upgradeVersion + ", must wipe the settings provider"); Loading Loading @@ -746,6 +765,8 @@ public class DatabaseHelper extends SQLiteOpenHelper { loadBooleanSetting(stmt, Settings.System.ACCELEROMETER_ROTATION, R.bool.def_accelerometer_rotation); loadDefaultHapticSettings(stmt); stmt.close(); } Loading @@ -756,6 +777,11 @@ public class DatabaseHelper extends SQLiteOpenHelper { R.fraction.def_window_transition_scale, 1); } private void loadDefaultHapticSettings(SQLiteStatement stmt) { loadBooleanSetting(stmt, Settings.System.HAPTIC_FEEDBACK_ENABLED, R.bool.def_haptic_feedback); } private void loadSecureSettings(SQLiteDatabase db) { SQLiteStatement stmt = db.compileStatement("INSERT OR IGNORE INTO secure(name,value)" + " VALUES(?,?);"); Loading