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

Commit 6430dbd2 authored by Danesh M's avatar Danesh M Committed by Zhao Wei Liew
Browse files

Settings: Add volume link notification switch

Change-Id: I06027bc4f13c8a60b19a2b7ded73ce76da4e4f02

Tablets don't need to link volumes they don't have

This feature broke the notification volume slider in settings for
devices without telephony service (tablets) and isn't applicable
anyways since they don't have ringtone volume streams.

Change-Id: Ifff10ecd35b53f5fc08a36332814fb00d20b4350

Settings: Fix linked volume crash + inconsistent state

- Ensure we fetch from Secure, not System
- Don't initialize every time we toggle
- Set the checkbox state from Settings value since
  the preference assumes a default of 0

CYNGNOS-1638

Change-Id: Ia519cef2295a6b6083b2b168f4c16df78f423cee
parent 88707f03
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -435,4 +435,7 @@
    <string name="data_usage_app_restrict_all_wifi_title">Disable all Wi\u2011Fi data access</string>
    <!-- Summary for switch to block app data usage [CHAR LIMIT=NONE] -->
    <string name="data_usage_app_restrict_all_wifi_summary">Prevent any use of data access via Wi\u2011Fi networks</string>

    <!-- Volume link notification -->
    <string name="volume_link_notification_title">Link ringtone &amp; notification volumes</string>
</resources>
+6 −0
Original line number Diff line number Diff line
@@ -44,6 +44,12 @@
                android:icon="@*android:drawable/ic_audio_ring_notif"
                android:title="@string/notification_volume_option_title" />

        <!-- Link ringtone and notification volumes -->
        <cyanogenmod.preference.SecureSettingSwitchPreference
                android:key="volume_link_notification"
                android:title="@string/volume_link_notification_title"
                android:defaultValue="true" />

        <!-- Increasing ring -->
        <cyanogenmod.preference.CMSystemSettingSwitchPreference
                android:key="increasing_ring"
+3 −4
Original line number Diff line number Diff line
@@ -158,16 +158,15 @@ public class SoundSettings extends SettingsPreferenceFragment implements Indexab
                com.android.internal.R.drawable.ic_audio_media_mute);
        initVolumePreference(KEY_ALARM_VOLUME, AudioManager.STREAM_ALARM,
                com.android.internal.R.drawable.ic_audio_alarm_mute);
        initVolumePreference(KEY_NOTIFICATION_VOLUME, AudioManager.STREAM_NOTIFICATION,
                com.android.internal.R.drawable.ic_audio_ring_notif_mute);
        if (mVoiceCapable) {
            mRingOrNotificationPreference =
                    initVolumePreference(KEY_RING_VOLUME, AudioManager.STREAM_RING,
                            com.android.internal.R.drawable.ic_audio_ring_notif_mute);
            removePreference(KEY_NOTIFICATION_VOLUME);
        } else {
            mRingOrNotificationPreference =
                    initVolumePreference(KEY_NOTIFICATION_VOLUME, AudioManager.STREAM_NOTIFICATION,
                            com.android.internal.R.drawable.ic_audio_ring_notif_mute);
            removePreference(KEY_RING_VOLUME);
            removePreference("volume_link_notification");
        }

        initRingtones();