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

Commit 5dedf28f authored by Matías Hernández's avatar Matías Hernández Committed by Android (Google) Code Review
Browse files

Merge "Remove "Do Not Disturb" from Sound summary in Settings top screen" into main

parents 46744e40 dd9b17b0
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -7867,7 +7867,9 @@
    <string name="keywords_keyboard_vibration">keyboard, haptics, vibrate,</string>
    <!-- Summary for sound settings, explaining a few important settings under it [CHAR LIMIT=NONE]-->
    <string name="sound_dashboard_summary">Volume, vibration, Do Not Disturb</string>
    <string name="sound_dashboard_summary">Volume and vibration</string>
    <!-- Summary for sound settings, explaining a few important settings under it [CHAR LIMIT=NONE]-->
    <string name="sound_dashboard_summary_with_dnd">Volume, vibration, Do Not Disturb</string>
    <!-- Sound: Title for the option managing media volume. [CHAR LIMIT=30] -->
    <string name="media_volume_option_title">Media volume</string>
+3 −2
Original line number Diff line number Diff line
@@ -104,8 +104,9 @@
        android:key="top_level_sound"
        android:order="-90"
        android:title="@string/sound_settings"
        android:summary="@string/sound_dashboard_summary"
        settings:highlightableMenuKey="@string/menu_key_sound"/>
        android:summary="@string/sound_dashboard_summary_with_dnd"
        settings:highlightableMenuKey="@string/menu_key_sound"
        settings:controller="com.android.settings.sound.TopLevelSoundPreferenceController"/>

    <com.android.settings.widget.HomepagePreference
        android:fragment="com.android.settings.DisplaySettings"
+3 −2
Original line number Diff line number Diff line
@@ -79,8 +79,9 @@
            android:key="top_level_sound"
            android:order="-40"
            android:title="@string/sound_settings"
            android:summary="@string/sound_dashboard_summary"
            settings:highlightableMenuKey="@string/menu_key_sound"/>
            android:summary="@string/sound_dashboard_summary_with_dnd"
            settings:highlightableMenuKey="@string/menu_key_sound"
            settings:controller="com.android.settings.sound.TopLevelSoundPreferenceController"/>

        <com.android.settings.widget.RestrictedHomepagePreference
            android:fragment="com.android.settings.notification.modes.ZenModesListFragment"
+45 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2024 The Android Open Source 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.sound;

import android.app.Flags;
import android.content.Context;

import androidx.preference.Preference;

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

public class TopLevelSoundPreferenceController extends BasePreferenceController {

    public TopLevelSoundPreferenceController(Context context, String preferenceKey) {
        super(context, preferenceKey);
    }

    @Override
    public void updateState(Preference preference) {
        super.updateState(preference);
        preference.setSummary(Flags.modesApi() && Flags.modesUi()
                ? R.string.sound_dashboard_summary
                : R.string.sound_dashboard_summary_with_dnd);
    }

    @Override
    public int getAvailabilityStatus() {
        return AVAILABLE;
    }
}