Permalink
Browse files

Settings: Add Volume adjust sound preference

This patch allows the users to choose if they want the audible tone when adjusting the volume

Change-Id: I6d43cba83bf4cf10f2d50502e7cee5408a73c520
  • Loading branch information...
mikeNG authored and akhilnarang committed Dec 17, 2014
1 parent 50d78f8 commit 2ae7f2d4281e4777edf35de0103a895090017879
@@ -250,4 +250,7 @@
<string name="camera_sounds_summary">Enable camera shutter sound</string>
<string name="camera_sound_warning_dialog_text">Disabling the camera shutter sound is illegal in some areas! Please check the applicable law in your country</string>
<!-- Volume settings - Volume adjustment sound -->
<string name="volume_adjust_sounds_title">Volume adjustment sounds</string>
</resources>
@@ -45,6 +45,13 @@
android:title="@string/docking_sounds_title" />
<!-- Touch sounds -->
<SwitchPreference
android:key="volume_adjust_sounds"
android:title="@string/volume_adjust_sounds_title"
android:switchTextOff=""
android:switchTextOn=""
android:persistent="true" />
<SwitchPreference
android:key="touch_sounds"
android:title="@string/touch_sounds_title" />
@@ -21,6 +21,8 @@
import android.content.res.Resources;
import android.database.ContentObserver;
import android.media.AudioManager;
import android.media.Ringtone;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
@@ -66,6 +68,7 @@
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";
@@ -97,6 +100,11 @@ public boolean isApplicable(Context context) {
}
};
private static final SettingPref PREF_VOLUME_ADJUST_SOUNDS = new SettingPref(
TYPE_SYSTEM, KEY_VOLUME_ADJUST_SOUNDS, System.VOLUME_ADJUST_SOUNDS_ENABLED,
DEFAULT_ON) {
};
private static final SettingPref PREF_TOUCH_SOUNDS = new SettingPref(
TYPE_SYSTEM, KEY_TOUCH_SOUNDS, System.SOUND_EFFECTS_ENABLED, DEFAULT_ON) {
@Override
@@ -175,6 +183,7 @@ protected String getCaption(Resources res, int value) {
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,

0 comments on commit 2ae7f2d

Please sign in to comment.