diff options
author | kaiyiz <kaiyiz@codeaurora.org> | 2014-10-01 17:34:57 +0800 |
---|---|---|
committer | Adnan Begovic <adnan@cyngn.com> | 2016-01-22 10:46:30 -0800 |
commit | 35671166550919d7db37b2084ca2bc6d9595e71a (patch) | |
tree | a6163ddc11a021ab0988e29f6930335da6b8a3c5 /packages/SettingsProvider | |
parent | 24f2e0445984fe9ffaeb1a7a16616820460c1024 (diff) | |
download | frameworks_base-35671166550919d7db37b2084ca2bc6d9595e71a.zip frameworks_base-35671166550919d7db37b2084ca2bc6d9595e71a.tar.gz frameworks_base-35671166550919d7db37b2084ca2bc6d9595e71a.tar.bz2 |
Support alert type profile default:Vibrator & Ringtone for settings.
Change-Id: I9e2c1efdfabc0ffa0e9cf44cee31781f15e8894a
Diffstat (limited to 'packages/SettingsProvider')
-rw-r--r-- | packages/SettingsProvider/res/values/defaults.xml | 3 | ||||
-rw-r--r-- | packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml index d841573..1346788 100644 --- a/packages/SettingsProvider/res/values/defaults.xml +++ b/packages/SettingsProvider/res/values/defaults.xml @@ -184,6 +184,9 @@ >0 is milliseconds of screen-off time after which battery sounds will not play --> <integer name="def_low_battery_sound_timeout">0</integer> + <!-- Default for Settings.System.VIBRATE_WHEN_RINGING enabled --> + <bool name="def_vibrate_when_ringing_enabled">false</bool> + <!-- Initial value for the Settings.Secure.IMMERSIVE_MODE_CONFIRMATIONS setting, which is a comma separated list of packages that no longer need confirmation for immersive mode. diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java index 9d7328b..1b8ef79 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java @@ -2518,7 +2518,11 @@ class DatabaseHelper extends SQLiteOpenHelper { try { stmt = db.compileStatement("INSERT OR IGNORE INTO system(name,value)" + " VALUES(?,?);"); - loadSetting(stmt, Settings.System.VIBRATE_WHEN_RINGING, vibrateWhenRinging ? 1 : 0); + if (mContext.getResources().getBoolean(R.bool.def_vibrate_when_ringing_enabled)) { + loadSetting(stmt, Settings.System.VIBRATE_WHEN_RINGING, 1); + } else { + loadSetting(stmt, Settings.System.VIBRATE_WHEN_RINGING, vibrateWhenRinging ? 1 : 0); + } } finally { if (stmt != null) stmt.close(); } |