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

Commit a4727c70 authored by Beverly's avatar Beverly Committed by android-build-merger
Browse files

Merge "Updated dnd secondary text in sound settings" into pi-dev am: c984e492

am: 468ebafd

Change-Id: I4e3351ccd315665383e0776b81d556b3e56b85f3
parents 7b6b2230 468ebafd
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -7026,8 +7026,8 @@
    <!-- [CHAR LIMIT=20] Accessibility string for current zen mode and selected exit condition. A template that simply concatenates existing mode string and the current condition description.  -->
    <string name="zen_mode_and_condition"><xliff:g id="zen_mode" example="Priority interruptions only">%1$s</xliff:g>. <xliff:g id="exit_condition" example="For one hour">%2$s</xliff:g></string>
    <!-- Sound settings screen, summary format of do not disturb when on. [CHAR LIMIT=NONE] -->
    <string name="zen_mode_sound_summary_on">On / <xliff:g name="dnd_summary" example="No sound except alarms and media">%1$s</xliff:g></string>
    <!-- Sound settings screen, summary format of do not disturb when on with extra info. [CHAR LIMIT=NONE] -->
    <string name="zen_mode_sound_summary_on_with_info">On / <xliff:g name="dnd_summary" example="No sound except alarms and media">%1$s</xliff:g></string>
    <!-- Sound settings screen, summary format of do not disturb when off with extra information. [CHAR LIMIT=NONE] -->
    <string name="zen_mode_sound_summary_off_with_info">Off / <xliff:g name="dnd_summary" example="1 rule can turn on automatically">%1$s</xliff:g></string>
@@ -7035,6 +7035,9 @@
    <!-- Sound settings screen, summary format of do not disturb when off with no extra information. [CHAR LIMIT=NONE] -->
    <string name="zen_mode_sound_summary_off">Off</string>
    <!-- Sound settings screen, summary format of do not disturb when on with no extra information. [CHAR LIMIT=NONE] -->
    <string name="zen_mode_sound_summary_on">On</string>
    <!-- Summary for the Sound Do not Disturb option when at least one automatic rules is enabled. [CHAR LIMIT=NONE]-->
    <plurals name="zen_mode_sound_summary_summary_off_info">
        <item quantity="one">1 rule can turn on automatically</item>
+10 −3
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.app.NotificationManager.Policy;
import android.content.Context;
import android.provider.SearchIndexableResource;
import android.provider.Settings;
import android.service.notification.ZenModeConfig;
import android.support.annotation.VisibleForTesting;

import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
@@ -122,9 +123,15 @@ public class ZenModeSettings extends ZenModeSettingsBase {
            int zenMode = NotificationManager.from(mContext).getZenMode();

            if (zenMode != Settings.Global.ZEN_MODE_OFF) {
                Policy policy = NotificationManager.from(mContext).getNotificationPolicy();
                return mContext.getString(R.string.zen_mode_sound_summary_on,
                        getBehaviorSettingSummary(policy, zenMode));
                ZenModeConfig config = NotificationManager.from(mContext).getZenModeConfig();
                String description = ZenModeConfig.getDescription(mContext, true, config);

                if (description == null) {
                    return mContext.getString(R.string.zen_mode_sound_summary_on);
                } else {
                    return mContext.getString(R.string.zen_mode_sound_summary_on_with_info,
                            description);
                }
            } else {
                final int count = getEnabledAutomaticRulesCount();
                if (count > 0) {