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

@@ -21,6 +21,7 @@ import android.app.NotificationChannel;
import android.app.NotificationChannelGroup;
import android.app.NotificationManager;
import android.content.Intent;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.provider.Settings;
@@ -168,7 +169,8 @@ public class AppNotificationSettings extends NotificationSettingsBase {
} else {
populateGroupList();
int deletedChannelCount = mBackend.getDeletedChannelCount(mAppRow.pkg, mAppRow.uid);
if (deletedChannelCount > 0) {
if (deletedChannelCount > 0 &&
getPreferenceScreen().findPreference(KEY_DELETED) == null) {
mDeletedChannels = new FooterPreference(getPrefContext());
mDeletedChannels.setSelectable(false);
mDeletedChannels.setTitle(getResources().getQuantityString(
@@ -322,6 +324,7 @@ public class AppNotificationSettings extends NotificationSettingsBase {
}
}
private Comparator<NotificationChannelGroup> mChannelGroupComparator =
new Comparator<NotificationChannelGroup>() {