Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f19fbbdf authored by StevenHarperUK's avatar StevenHarperUK Committed by Gerrit Code Review
Browse files

Feature : Volume adjust sound preference 1/2

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

The new preference is in
Settings | Sound
    Volume adjust sound
        Play sound when adjusting volume with hard keys
The Checkbox is defaulted to ON (1 in defaults.xml)

Look for 2/2 for the Settings, Sound Panel Change

Change-Id: I705c23065706317760ba60efc1a71f3ba6082bbd
parent c89cb6ab
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1783,6 +1783,13 @@ public final class Settings {
        /** @hide */
        public static final int VOLUME_OVERLAY_NONE = 3;

        /**
         * Volume Adjust Sounds Enable, This is the noise made when using volume hard buttons
         * Defaults to 1 - sounds enabled
         * @hide
         */
        public static final String VOLUME_ADJUST_SOUNDS_ENABLED = "volume_adjust_sounds_enabled";

        /**
         * Determines which streams are affected by ringer mode changes. The
         * stream type's bit should be set to 1 if it should be muted when going
+6 −0
Original line number Diff line number Diff line
@@ -825,6 +825,12 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie

    protected void onPlaySound(int streamType, int flags) {

        // If preference is no sound - just exit here
        if (Settings.System.getInt(mContext.getContentResolver(),
                 Settings.System.VOLUME_ADJUST_SOUNDS_ENABLED, 1) == 0) {
             return;
         }

        if (hasMessages(MSG_STOP_SOUNDS)) {
            removeMessages(MSG_STOP_SOUNDS);
            // Force stop right now
+0 −1
Original line number Diff line number Diff line
@@ -1984,7 +1984,6 @@ public class DatabaseHelper extends SQLiteOpenHelper {
                R.bool.def_sound_effects_enabled);
        loadBooleanSetting(stmt, Settings.System.HAPTIC_FEEDBACK_ENABLED,
                R.bool.def_haptic_feedback);

        loadIntegerSetting(stmt, Settings.System.LOCKSCREEN_SOUNDS_ENABLED,
            R.integer.def_lockscreen_sounds_enabled);
    }