Merge "Updated dnd secondary text in sound settings" into pi-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
c984e49262
@@ -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. -->
|
<!-- [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>
|
<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] -->
|
<!-- Sound settings screen, summary format of do not disturb when on with extra info. [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>
|
<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] -->
|
<!-- 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>
|
<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] -->
|
<!-- 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>
|
<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]-->
|
<!-- 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">
|
<plurals name="zen_mode_sound_summary_summary_off_info">
|
||||||
<item quantity="one">1 rule can turn on automatically</item>
|
<item quantity="one">1 rule can turn on automatically</item>
|
||||||
|
@@ -23,6 +23,7 @@ import android.app.NotificationManager.Policy;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.provider.SearchIndexableResource;
|
import android.provider.SearchIndexableResource;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
|
import android.service.notification.ZenModeConfig;
|
||||||
import android.support.annotation.VisibleForTesting;
|
import android.support.annotation.VisibleForTesting;
|
||||||
|
|
||||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||||
@@ -122,9 +123,15 @@ public class ZenModeSettings extends ZenModeSettingsBase {
|
|||||||
int zenMode = NotificationManager.from(mContext).getZenMode();
|
int zenMode = NotificationManager.from(mContext).getZenMode();
|
||||||
|
|
||||||
if (zenMode != Settings.Global.ZEN_MODE_OFF) {
|
if (zenMode != Settings.Global.ZEN_MODE_OFF) {
|
||||||
Policy policy = NotificationManager.from(mContext).getNotificationPolicy();
|
ZenModeConfig config = NotificationManager.from(mContext).getZenModeConfig();
|
||||||
return mContext.getString(R.string.zen_mode_sound_summary_on,
|
String description = ZenModeConfig.getDescription(mContext, true, config);
|
||||||
getBehaviorSettingSummary(policy, zenMode));
|
|
||||||
|
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 {
|
} else {
|
||||||
final int count = getEnabledAutomaticRulesCount();
|
final int count = getEnabledAutomaticRulesCount();
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
|
Reference in New Issue
Block a user