From a25e54fdf625e9e4e2fe65b3b7ca213743091d0c Mon Sep 17 00:00:00 2001 From: Julia Reynolds Date: Wed, 20 Sep 2017 10:00:03 -0400 Subject: [PATCH] Sometimes there's no advanced settings Test: manual Change-Id: Iea69ee04f36be51d073bbbd2c0d643c986eb8e89 Fixes: 65964886 --- .../notification/ChannelNotificationSettings.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/com/android/settings/notification/ChannelNotificationSettings.java b/src/com/android/settings/notification/ChannelNotificationSettings.java index 58599799a09..66e94fa1db4 100644 --- a/src/com/android/settings/notification/ChannelNotificationSettings.java +++ b/src/com/android/settings/notification/ChannelNotificationSettings.java @@ -374,7 +374,9 @@ public class ChannelNotificationSettings extends NotificationSettingsBase { } void updateDependents(boolean banned) { + PreferenceGroup parent; if (mShowLegacyChannelConfig) { + parent = getPreferenceScreen(); setVisible(mImportanceToggle, checkCanBeVisible(NotificationManager.IMPORTANCE_MIN)); } else { setVisible(mAdvanced, checkCanBeVisible(NotificationManager.IMPORTANCE_MIN)); @@ -383,12 +385,13 @@ public class ChannelNotificationSettings extends NotificationSettingsBase { NotificationManager.IMPORTANCE_DEFAULT) && canPulseLight()); setVisible(mVibrate, checkCanBeVisible(NotificationManager.IMPORTANCE_DEFAULT)); setVisible(mRingtone, checkCanBeVisible(NotificationManager.IMPORTANCE_DEFAULT)); + parent = mAdvanced; } - setVisible(mAdvanced, mBadge, checkCanBeVisible(NotificationManager.IMPORTANCE_MIN)); - setVisible(mAdvanced, mPriority, checkCanBeVisible(NotificationManager.IMPORTANCE_DEFAULT) + setVisible(parent, mBadge, checkCanBeVisible(NotificationManager.IMPORTANCE_MIN)); + setVisible(parent, mPriority, checkCanBeVisible(NotificationManager.IMPORTANCE_DEFAULT) || (checkCanBeVisible(NotificationManager.IMPORTANCE_LOW) && mDndVisualEffectsSuppressed)); - setVisible(mAdvanced, mVisibilityOverride, isLockScreenSecure() + setVisible(parent, mVisibilityOverride, isLockScreenSecure() &&checkCanBeVisible(NotificationManager.IMPORTANCE_LOW)); setVisible(mBlockedDesc, mChannel.getImportance() == IMPORTANCE_NONE); if (mAppLink != null) {