summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Bestas <mikeioannina@gmail.com>2014-12-18 00:19:27 +0200
committerAdnan Begovic <adnan@cyngn.com>2015-10-29 17:36:32 -0700
commit090c727e9fea698aee8a2712cc8ee488c5e2f2c2 (patch)
tree6800e1d2bd090c5bbd9e25ba95a744e89efe959b
parentd2d9f45236308fc9f722bf897030d1aacfbc8be8 (diff)
downloadpackages_apps_Settings-090c727e9fea698aee8a2712cc8ee488c5e2f2c2.zip
packages_apps_Settings-090c727e9fea698aee8a2712cc8ee488c5e2f2c2.tar.gz
packages_apps_Settings-090c727e9fea698aee8a2712cc8ee488c5e2f2c2.tar.bz2
Feature : Volume adjust sound preference 2/2
This patch allows the users to choose if they want the audible tone when adjusting the volume Change-Id: I6d43cba83bf4cf10f2d50502e7cee5408a73c520
-rw-r--r--res/values/cm_strings.xml3
-rw-r--r--res/xml/other_sound_settings.xml8
-rw-r--r--src/com/android/settings/notification/OtherSoundSettings.java11
3 files changed, 22 insertions, 0 deletions
diff --git a/res/values/cm_strings.xml b/res/values/cm_strings.xml
index 218284e..12fabd3 100644
--- a/res/values/cm_strings.xml
+++ b/res/values/cm_strings.xml
@@ -438,6 +438,9 @@
multiple font sizes in a limited amount of space. -->
<string name="font_size_sample">Sample</string>
+ <!-- Volume settings - Volume adjustment sound -->
+ <string name="volume_adjust_sounds_title">Volume adjustment sounds</string>
+
<!-- Hardware tunables - Vibrator intensity -->
<string name="vibrator_intensity_title">Vibrator intensity</string>
<string name="vibrator_warning">Values higher than %1$d are not recommended</string>
diff --git a/res/xml/other_sound_settings.xml b/res/xml/other_sound_settings.xml
index 328c0a5..115a8ea 100644
--- a/res/xml/other_sound_settings.xml
+++ b/res/xml/other_sound_settings.xml
@@ -43,6 +43,14 @@
android:title="@string/docking_sounds_title"
android:persistent="false" />
+ <!-- Volume adjust sounds -->
+ <SwitchPreference
+ android:key="volume_adjust_sounds"
+ android:title="@string/volume_adjust_sounds_title"
+ android:switchTextOff=""
+ android:switchTextOn=""
+ android:persistent="false" />
+
<!-- Touch sounds -->
<SwitchPreference
android:key="touch_sounds"
diff --git a/src/com/android/settings/notification/OtherSoundSettings.java b/src/com/android/settings/notification/OtherSoundSettings.java
index a907a19..a41f6f2 100644
--- a/src/com/android/settings/notification/OtherSoundSettings.java
+++ b/src/com/android/settings/notification/OtherSoundSettings.java
@@ -63,6 +63,7 @@ public class OtherSoundSettings extends SettingsPreferenceFragment implements In
private static final String KEY_SCREEN_LOCKING_SOUNDS = "screen_locking_sounds";
private static final String KEY_CHARGING_SOUNDS = "charging_sounds";
private static final String KEY_DOCKING_SOUNDS = "docking_sounds";
+ private static final String KEY_VOLUME_ADJUST_SOUNDS = "volume_adjust_sounds";
private static final String KEY_TOUCH_SOUNDS = "touch_sounds";
private static final String KEY_VIBRATE_ON_TOUCH = "vibrate_on_touch";
private static final String KEY_DOCK_AUDIO_MEDIA = "dock_audio_media";
@@ -91,6 +92,15 @@ public class OtherSoundSettings extends SettingsPreferenceFragment implements In
}
};
+ private static final SettingPref PREF_VOLUME_ADJUST_SOUNDS = new SettingPref(
+ TYPE_SYSTEM, KEY_VOLUME_ADJUST_SOUNDS, System.VOLUME_ADJUST_SOUNDS_ENABLED,
+ DEFAULT_ON) {
+ @Override
+ public boolean isApplicable(Context context) {
+ return Utils.hasVolumeRocker(context);
+ }
+ };
+
private static final SettingPref PREF_TOUCH_SOUNDS = new SettingPref(
TYPE_SYSTEM, KEY_TOUCH_SOUNDS, System.SOUND_EFFECTS_ENABLED, DEFAULT_ON) {
@Override
@@ -172,6 +182,7 @@ public class OtherSoundSettings extends SettingsPreferenceFragment implements In
PREF_SCREEN_LOCKING_SOUNDS,
PREF_CHARGING_SOUNDS,
PREF_DOCKING_SOUNDS,
+ PREF_VOLUME_ADJUST_SOUNDS,
PREF_TOUCH_SOUNDS,
PREF_VIBRATE_ON_TOUCH,
PREF_DOCK_AUDIO_MEDIA,