DND ixD changes

- Subtext in Settings > Sound updated
- new icons for automatic dnd rules
- no toast when toggling on/off dnd rules
- dnd dialog has a warning if dnd will cause user to miss next alarm

Test: make ROBOTEST_FILTER=ZenModePreferenceControllerTest RunSettingsRoboTests -j40
Fixes: 72494029
Fixes: 72655216
Fixes: 72655609
Change-Id: I9d86d82529079f35e362f93e10914f0a60229cd8
This commit is contained in:
Beverly
2018-02-01 18:14:33 -05:00
committed by Beverly Tai
parent 1297029728
commit 036d7e0bd9
20 changed files with 306 additions and 670 deletions

View File

@@ -115,6 +115,26 @@ public class ZenModeSettings extends ZenModeSettingsBase {
return mContext.getString(R.string.zen_mode_behavior_summary_custom);
}
String getSoundSummary() {
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));
} else {
final int count = getEnabledAutomaticRulesCount();
if (count > 0) {
return mContext.getString(R.string.zen_mode_sound_summary_off_with_info,
mContext.getResources().getQuantityString(
R.plurals.zen_mode_sound_summary_summary_off_info,
count, count));
}
return mContext.getString(R.string.zen_mode_sound_summary_off);
}
}
String getAutomaticRulesSummary() {
final int count = getEnabledAutomaticRulesCount();
return count == 0 ? mContext.getString(R.string.zen_mode_settings_summary_off)