am 075a18d6: Turn on haptic feedback by default.
Merge commit '075a18d607c3aa8386b4d06aea22f4bfacbe447b' into eclair-plus-aosp * commit '075a18d607c3aa8386b4d06aea22f4bfacbe447b': Turn on haptic feedback by default.
This commit is contained in:
@@ -30,6 +30,7 @@
|
|||||||
<bool name="def_screen_brightness_automatic_mode">false</bool>
|
<bool name="def_screen_brightness_automatic_mode">false</bool>
|
||||||
<fraction name="def_window_animation_scale">100%</fraction>
|
<fraction name="def_window_animation_scale">100%</fraction>
|
||||||
<fraction name="def_window_transition_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_bluetooth_on">false</bool>
|
||||||
<bool name="def_install_non_market_apps">false</bool>
|
<bool name="def_install_non_market_apps">false</bool>
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ public class DatabaseHelper extends SQLiteOpenHelper {
|
|||||||
// database gets upgraded properly. At a minimum, please confirm that 'upgradeVersion'
|
// 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
|
// is properly propagated through your change. Not doing so will result in a loss of user
|
||||||
// settings.
|
// settings.
|
||||||
private static final int DATABASE_VERSION = 41;
|
private static final int DATABASE_VERSION = 42;
|
||||||
|
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
|
|
||||||
@@ -502,6 +502,25 @@ public class DatabaseHelper extends SQLiteOpenHelper {
|
|||||||
upgradeVersion = 41;
|
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) {
|
if (upgradeVersion != currentVersion) {
|
||||||
Log.w(TAG, "Got stuck trying to upgrade from version " + upgradeVersion
|
Log.w(TAG, "Got stuck trying to upgrade from version " + upgradeVersion
|
||||||
+ ", must wipe the settings provider");
|
+ ", must wipe the settings provider");
|
||||||
@@ -746,6 +765,8 @@ public class DatabaseHelper extends SQLiteOpenHelper {
|
|||||||
loadBooleanSetting(stmt, Settings.System.ACCELEROMETER_ROTATION,
|
loadBooleanSetting(stmt, Settings.System.ACCELEROMETER_ROTATION,
|
||||||
R.bool.def_accelerometer_rotation);
|
R.bool.def_accelerometer_rotation);
|
||||||
|
|
||||||
|
loadDefaultHapticSettings(stmt);
|
||||||
|
|
||||||
stmt.close();
|
stmt.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -756,6 +777,11 @@ public class DatabaseHelper extends SQLiteOpenHelper {
|
|||||||
R.fraction.def_window_transition_scale, 1);
|
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) {
|
private void loadSecureSettings(SQLiteDatabase db) {
|
||||||
SQLiteStatement stmt = db.compileStatement("INSERT OR IGNORE INTO secure(name,value)"
|
SQLiteStatement stmt = db.compileStatement("INSERT OR IGNORE INTO secure(name,value)"
|
||||||
+ " VALUES(?,?);");
|
+ " VALUES(?,?);");
|
||||||
|
|||||||
Reference in New Issue
Block a user