diff --git a/res/values/strings.xml b/res/values/strings.xml index deb1cb3bc2a..2a439d933cc 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -5946,17 +5946,20 @@ Blocked: Never show these notifications + + Min: Silently show at the bottom of the notification list + - Low: Silently show at the bottom of the notification list + Low: Silently show these notifications - Normal: Silently show these notifications + Normal: Allow these notification to make sounds - High: Show at the top of the notifications list and allow sound + High: Peek onto the screen and allow sound and allow sound - Urgent: Peek onto the screen and allow sound + Urgent: Show at the top of the notifications list, peek onto the screen and allow sound Reset diff --git a/src/com/android/settings/notification/AppNotificationSettings.java b/src/com/android/settings/notification/AppNotificationSettings.java index f04cf2fe61b..c82ad198426 100644 --- a/src/com/android/settings/notification/AppNotificationSettings.java +++ b/src/com/android/settings/notification/AppNotificationSettings.java @@ -106,12 +106,12 @@ public class AppNotificationSettings extends NotificationSettingsBase { final boolean allowPrivate = getLockscreenAllowPrivateNotifications(); if (getPreferenceScreen().findPreference(mBlock.getKey()) != null) { - setVisible(mSilent, checkCanBeVisible(Ranking.IMPORTANCE_LOW, importance)); - mSilent.setChecked(importance == Ranking.IMPORTANCE_DEFAULT); + setVisible(mSilent, checkCanBeVisible(Ranking.IMPORTANCE_MIN, importance)); + mSilent.setChecked(importance == Ranking.IMPORTANCE_LOW); } - setVisible(mPriority, checkCanBeVisible(Ranking.IMPORTANCE_LOW, importance) + setVisible(mPriority, checkCanBeVisible(Ranking.IMPORTANCE_DEFAULT, importance) && !mDndVisualEffectsSuppressed); - setVisible(mSensitive, checkCanBeVisible(Ranking.IMPORTANCE_HIGH, importance) + setVisible(mSensitive, checkCanBeVisible(Ranking.IMPORTANCE_MIN, importance) && lockscreenSecure && lockscreenNotificationsEnabled && allowPrivate); } diff --git a/src/com/android/settings/notification/NotificationSettingsBase.java b/src/com/android/settings/notification/NotificationSettingsBase.java index 895d38dbd8e..ee0cac076bf 100644 --- a/src/com/android/settings/notification/NotificationSettingsBase.java +++ b/src/com/android/settings/notification/NotificationSettingsBase.java @@ -175,7 +175,7 @@ abstract public class NotificationSettingsBase extends SettingsPreferenceFragmen mImportanceTitle.setSummary(getProgressSummary(importance)); mImportance.setSystemApp(isSystemApp); mImportance.setMinimumProgress( - isSystemApp ? Ranking.IMPORTANCE_LOW : Ranking.IMPORTANCE_NONE); + isSystemApp ? Ranking.IMPORTANCE_MIN : Ranking.IMPORTANCE_NONE); mImportance.setMax(Ranking.IMPORTANCE_MAX); mImportance.setProgress(importance); mImportance.setCallback(new ImportanceSeekBarPreference.Callback() { @@ -230,7 +230,7 @@ abstract public class NotificationSettingsBase extends SettingsPreferenceFragmen public boolean onPreferenceChange(Preference preference, Object newValue) { final boolean silenced = (Boolean) newValue; final int importance = - silenced ? Ranking.IMPORTANCE_DEFAULT : Ranking.IMPORTANCE_UNSPECIFIED; + silenced ? Ranking.IMPORTANCE_LOW : Ranking.IMPORTANCE_UNSPECIFIED; mBackend.setImportance(mPkgInfo.packageName, mUid, importance); updateDependents(importance); return true; @@ -244,6 +244,8 @@ abstract public class NotificationSettingsBase extends SettingsPreferenceFragmen switch (progress) { case Ranking.IMPORTANCE_NONE: return mContext.getString(R.string.notification_importance_blocked); + case Ranking.IMPORTANCE_MIN: + return mContext.getString(R.string.notification_importance_min); case Ranking.IMPORTANCE_LOW: return mContext.getString(R.string.notification_importance_low); case Ranking.IMPORTANCE_DEFAULT: diff --git a/src/com/android/settings/notification/NotificationStation.java b/src/com/android/settings/notification/NotificationStation.java index 7c79e8b0bab..b8718488ab9 100644 --- a/src/com/android/settings/notification/NotificationStation.java +++ b/src/com/android/settings/notification/NotificationStation.java @@ -109,6 +109,11 @@ public class NotificationStation extends SettingsPreferenceFragment { public void onNotificationRankingUpdate(RankingMap ranking) { mRanking = ranking; } + + @Override + public void onListenerConnected() { + mRanking = getCurrentRanking(); + } }; private Context mContext;