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

Commit 9e354a60 authored by Dave Kessler's avatar Dave Kessler Committed by Gerrit Code Review
Browse files

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
parent 3151a510
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -63,6 +63,7 @@ public class NotificationSettings extends SettingsPreferenceFragment implements
    private static final String KEY_ALARM_VOLUME = "alarm_volume";
    private static final String KEY_RING_VOLUME = "ring_volume";
    private static final String KEY_NOTIFICATION_VOLUME = "notification_volume";
    private static final String KEY_VOLUME_LINK_NOTIFICATION = "volume_link_notification";
    private static final String KEY_PHONE_RINGTONE = "ringtone";
    private static final String KEY_NOTIFICATION_RINGTONE = "notification_ringtone";
    private static final String KEY_VIBRATE_WHEN_RINGING = "vibrate_when_ringing";
@@ -130,6 +131,7 @@ public class NotificationSettings extends SettingsPreferenceFragment implements
                    initVolumePreference(KEY_RING_VOLUME, AudioManager.STREAM_RING);
        } else {
            sound.removePreference(sound.findPreference(KEY_RING_VOLUME));
            sound.removePreference(sound.findPreference(KEY_VOLUME_LINK_NOTIFICATION));
        }

        initRingtones(sound);
@@ -419,14 +421,16 @@ public class NotificationSettings extends SettingsPreferenceFragment implements
        mNotificationPreference = initVolumePreference(KEY_NOTIFICATION_VOLUME,
                AudioManager.STREAM_NOTIFICATION);

        if (mVoiceCapable) {
            final boolean enabled = Settings.System.getInt(getContentResolver(),
                    Settings.Secure.VOLUME_LINK_NOTIFICATION, 1) == 1;

            if (mNotificationPreference != null) {
            boolean show = !enabled && mVoiceCapable;
                boolean show = !enabled;
                mNotificationPreference.setEnabled(show);
            }
        }
    }

    private boolean getLockscreenNotificationsEnabled() {
        return Settings.Secure.getInt(getContentResolver(),