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

Commit 1b1e4f84 authored by Bruno Martins's avatar Bruno Martins
Browse files

Settings: Add switch for linked ring and media notification volumes

Change-Id: I900af398f566a5415c44fe883cc214985f4e9cd4
parent 358f7cb9
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -294,6 +294,9 @@
    <string name="increasing_ring_min_volume_title">Start volume</string>
    <string name="increasing_ring_ramp_up_time_title">Ramp-up time</string>

    <!-- Volume link notification -->
    <string name="volume_link_notification_title">Link ring &amp; notification volumes</string>

    <!-- Kill app long-press back -->
    <string name="kill_app_longpress_back">Kill app back button</string>
    <string name="kill_app_longpress_back_summary">Kill the foreground app by long-pressing the back button</string>
+9 −1
Original line number Diff line number Diff line
@@ -79,11 +79,19 @@
        android:order="-140"
        settings:controller="com.android.settings.notification.NotificationVolumePreferenceController"/>

    <!-- Link ringtone and notification volumes -->
    <lineageos.preference.SecureSettingSwitchPreference
        android:key="volume_link_notification"
        android:title="@string/volume_link_notification_title"
        android:defaultValue="true"
        android:order="-138"
        settings:controller="com.android.settings.notification.LinkedVolumesPreferenceController"/>

    <!-- Increasing ring -->
    <lineageos.preference.LineageSystemSettingSwitchPreference
        android:key="increasing_ring"
        android:title="@string/increasing_ring_volume_option_title"
        android:order="-138"
        android:order="-137"
        settings:controller="com.android.settings.notification.IncreasingRingPreferenceController" />

    <!-- Increasing ring volume -->
+33 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 The LineageOS Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.settings.notification;

import android.content.Context;

import com.android.settings.Utils;
import com.android.settings.core.BasePreferenceController;

public class LinkedVolumesPreferenceController extends BasePreferenceController {
    public LinkedVolumesPreferenceController(Context context, String key) {
        super(context, key);
    }

    @Override
    public int getAvailabilityStatus() {
        return Utils.isVoiceCapable(mContext) ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
    }
}
+1 −2
Original line number Diff line number Diff line
@@ -35,8 +35,7 @@ public class NotificationVolumePreferenceController extends
    @Override
    public int getAvailabilityStatus() {
        return mContext.getResources().getBoolean(R.bool.config_show_notification_volume)
                && !Utils.isVoiceCapable(mContext) && !mHelper.isSingleVolume()
                ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
                && !mHelper.isSingleVolume() ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
    }

    @Override