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

Bug: 361140177
Test: manual
Flag: android.app.modes_ui
Change-Id: I11f808319bbcc2645e593f70003611f70a3fc930
This commit is contained in:
Matías Hernández
2024-09-10 18:23:24 +02:00
parent 1ffafd365e
commit dd9b17b083
4 changed files with 54 additions and 5 deletions

View File

@@ -7829,7 +7829,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>

View File

@@ -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"

View File

@@ -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"

View File

@@ -0,0 +1,45 @@
/*
* 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;
}
}