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

Commit e9a3a143 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add ability to show/hide individual settings in Sounds page."

parents 8350682a 921e3d14
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -60,6 +60,27 @@
    <!-- Whether high_power_apps should be shown or not. -->
    <bool name="config_show_high_power_apps">true</bool>

    <!-- Whether media_volume should be shown or not. -->
    <bool name="config_show_media_volume">true</bool>

    <!-- Whether alarm_volume should be shown or not. -->
    <bool name="config_show_alarm_volume">true</bool>

    <!-- Whether notification_volume should be shown or not. -->
    <bool name="config_show_notification_volume">true</bool>

    <!-- Whether notification_ringtone should be shown or not. -->
    <bool name="config_show_notification_ringtone">true</bool>

    <!-- Whether screen_locking_sounds should be shown or not. -->
    <bool name="config_show_screen_locking_sounds">true</bool>

    <!-- Whether charging_sounds should be shown or not. -->
    <bool name="config_show_charging_sounds">true</bool>

    <!-- Whether touch_sounds should be shown or not. -->
    <bool name="config_show_touch_sounds">true</bool>

    <!-- Whether device_administrators should be shown or not. -->
    <bool name="config_show_device_administrators">true</bool>

+3 −1
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.media.AudioManager;

import com.android.internal.annotations.VisibleForTesting;
import com.android.settings.notification.VolumeSeekBarPreference.Callback;
import com.android.settings.R;
import com.android.settingslib.core.lifecycle.Lifecycle;

public class AlarmVolumePreferenceController extends
@@ -43,7 +44,8 @@ public class AlarmVolumePreferenceController extends

    @Override
    public boolean isAvailable() {
        return !mHelper.isSingleVolume();
        return mContext.getResources().getBoolean(R.bool.config_show_alarm_volume)
                && !mHelper.isSingleVolume();
    }

    @Override
+5 −1
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import static com.android.settings.notification.SettingPref.TYPE_GLOBAL;
import android.content.Context;

import android.provider.Settings.Global;
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
import com.android.settingslib.core.lifecycle.Lifecycle;

@@ -33,7 +34,10 @@ public class ChargingSoundPreferenceController extends SettingPrefController {
        super(context, parent, lifecycle);
        mPreference = new SettingPref(
            TYPE_GLOBAL, KEY_CHARGING_SOUNDS, Global.CHARGING_SOUNDS_ENABLED, DEFAULT_ON);

    }

    @Override
    public boolean isAvailable() {
        return mContext.getResources().getBoolean(R.bool.config_show_charging_sounds);
    }
}
+2 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.settings.notification;
import android.content.Context;
import android.media.AudioManager;
import com.android.settings.notification.VolumeSeekBarPreference.Callback;
import com.android.settings.R;
import com.android.settingslib.core.lifecycle.Lifecycle;

public class MediaVolumePreferenceController extends
@@ -32,7 +33,7 @@ public class MediaVolumePreferenceController extends

    @Override
    public boolean isAvailable() {
        return true;
        return mContext.getResources().getBoolean(R.bool.config_show_media_volume);
    }

    @Override
+7 −0
Original line number Diff line number Diff line
@@ -19,6 +19,8 @@ package com.android.settings.notification;
import android.content.Context;
import android.media.RingtoneManager;

import com.android.settings.R;

public class NotificationRingtonePreferenceController extends RingtonePreferenceControllerBase {

    private static final String KEY_NOTIFICATION_RINGTONE = "notification_ringtone";
@@ -27,6 +29,11 @@ public class NotificationRingtonePreferenceController extends RingtonePreference
        super(context);
    }

    @Override
    public boolean isAvailable() {
        return mContext.getResources().getBoolean(R.bool.config_show_notification_ringtone);
    }

    @Override
    public String getPreferenceKey() {
        return KEY_NOTIFICATION_RINGTONE;
Loading