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

Commit 620aa112 authored by Danny Baumann's avatar Danny Baumann Committed by Gerrit Code Review
Browse files

Increasing ringtone volume option (1/3)

- Extend volume preference to be able to intercept volume changes
- Add settings to provider

Change-Id: Iec36c1ea0c9cc389e0c752d74a80694d62055fd1
parent e4343f96
Loading
Loading
Loading
Loading
+13 −4
Original line number Diff line number Diff line
@@ -146,6 +146,11 @@ public class VolumePreference extends SeekBarDialogPreference implements
        }
    }

    /** @hide */
    protected boolean onVolumeChange(SeekBarVolumizer volumizer, int value) {
        return true;
    }

    @Override
    protected Parcelable onSaveInstanceState() {
        final Parcelable superState = super.onSaveInstanceState();
@@ -307,10 +312,14 @@ public class VolumePreference extends SeekBarDialogPreference implements
        }

        void postSetVolume(int progress) {
            if (onVolumeChange(this, progress)) {
                // Do the volume changing separately to give responsive UI
                mLastProgress = progress;
                mHandler.removeCallbacks(this);
                mHandler.post(this);
            } else {
                mSeekBar.setProgress(mLastProgress);
            }
        }

        public void onStartTrackingTouch(SeekBar seekBar) {
+18 −0
Original line number Diff line number Diff line
@@ -1660,6 +1660,24 @@ public final class Settings {
        public static final String NOTIFICATIONS_USE_RING_VOLUME =
            "notifications_use_ring_volume";

        /**
         * Whether the phone ringtone should be played in an increasing manner
         * @hide
         */
        public static final String INCREASING_RING = "increasing_ring";

        /**
         * Minimum volume index for increasing ring volume
         * @hide
         */
        public static final String INCREASING_RING_MIN_VOLUME = "increasing_ring_min_vol";

        /**
         * Time (in ms) between ringtone volume increases
         * @hide
         */
        public static final String INCREASING_RING_INTERVAL = "increasing_ring_interval";

        /**
         * Whether silent mode should allow vibration feedback. This is used
         * internally in AudioService and the Sound settings activity to