Notification importance/selected sound conflict fixes.

- When you've selected "Silent" as your sound, update notification
importance messaging to match.
- When you explicitly move from a silent type of notifications to a
loud type, but have "Silent" selected as the sound, change the
sound to the default notification sound also.

Change-Id: I462785d593e1d6c7d1e87388aeee1bdcbcf6aa3d
Fixes: 63109928
Test: RunSettingsRoboTests, manual
This commit is contained in:
Alison Cichowlas
2017-09-14 15:01:29 -04:00
parent 744ff5c607
commit bff0e971ca
4 changed files with 39 additions and 10 deletions

View File

@@ -304,15 +304,19 @@ public class ChannelNotificationSettings extends NotificationSettingsBase {
break;
case NotificationManager.IMPORTANCE_DEFAULT:
title = getContext().getString(R.string.notification_importance_default_title);
if (hasValidSound()) {
if (hasValidSound(mChannel)) {
summary = getContext().getString(R.string.notification_importance_default);
} else {
summary = getContext().getString(R.string.notification_importance_low);
}
break;
case NotificationManager.IMPORTANCE_HIGH:
case NotificationManager.IMPORTANCE_MAX:
title = getContext().getString(R.string.notification_importance_high_title);
if (hasValidSound()) {
if (hasValidSound(mChannel)) {
summary = getContext().getString(R.string.notification_importance_high);
} else {
summary = getContext().getString(R.string.notification_importance_high_silent);
}
break;
default:
@@ -355,10 +359,6 @@ public class ChannelNotificationSettings extends NotificationSettingsBase {
Settings.System.NOTIFICATION_LIGHT_PULSE, 0) == 1;
}
boolean hasValidSound() {
return mChannel.getSound() != null && !Uri.EMPTY.equals(mChannel.getSound());
}
void updateDependents(boolean banned) {
PreferenceGroup parent;
if (mShowLegacyChannelConfig) {