Loading res/values/strings.xml +19 −0 Original line number Diff line number Diff line Loading @@ -5699,7 +5699,26 @@ <!-- Sound & notification > Notification section: Title for the option managing notifications per topic. [CHAR LIMIT=30] --> <string name="topic_notifications_title">Topic notifications</string> <!-- [CHAR LIMIT=100] Notification topic list header --> <string name="notification_topic_categories">Categories</string> <!-- [CHAR LIMIT=100] Notification importance slider title --> <string name="notification_importance_title">Importance</string> <!-- [CHAR LIMIT=100] Notification Importance slider: blocked importance level description --> <string name="notification_importance_blocked">Blocked: Never show these notifications</string> <!-- [CHAR LIMIT=100] Notification Importance slider: low importance level description --> <string name="notification_importance_low">Low: Silently show at the bottom of the notification list</string> <!-- [CHAR LIMIT=100] Notification Importance slider: normal importance level description --> <string name="notification_importance_default">Normal: Silently show these notifications</string> <!-- [CHAR LIMIT=100] Notification Importance slider: high importance level description --> <string name="notification_importance_high">High: Show at the top of the notifications list and make sound</string> <!-- [CHAR LIMIT=100] Notification Importance slider: max importance level description --> <string name="notification_importance_max">Urgent: Peek onto the screen and make sound</string> <!-- Sound & notification > Advanced section: Title for managing notification listeners option. [CHAR LIMIT=30] --> <string name="manage_notification_access_title">Notification access</string> Loading res/xml/app_notification_settings.xml +6 −1 Original line number Diff line number Diff line Loading @@ -30,7 +30,12 @@ <Preference android:key="app_settings" android:title="@string/app_notification_preferences" android:order="5" android:order="2" android:persistent="false" /> <PreferenceCategory android:key="categories" android:title="@string/notification_topic_categories" android:order="3" /> </PreferenceScreen> res/xml/topic_notification_settings.xml +1 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ <!-- Importance --> <com.android.settings.notification.ImportanceSeekBarPreference android:key="importance" android:title="@string/app_notification_importance_title" android:title="@string/notification_importance_title" android:order="1" android:persistent="false" /> Loading src/com/android/settings/notification/AppNotificationSettings.java +9 −2 Original line number Diff line number Diff line Loading @@ -28,10 +28,12 @@ import android.content.pm.ResolveInfo; import android.os.Bundle; import android.os.UserHandle; import android.provider.Settings; import android.service.notification.NotificationListenerService; import android.support.v14.preference.SwitchPreference; import android.support.v7.preference.Preference; import android.support.v7.preference.Preference.OnPreferenceChangeListener; import android.support.v7.preference.Preference.OnPreferenceClickListener; import android.support.v7.preference.PreferenceCategory; import android.text.TextUtils; import android.util.ArrayMap; import android.util.Log; Loading @@ -55,6 +57,7 @@ public class AppNotificationSettings extends SettingsPreferenceFragment { private static final String KEY_BLOCK = "block"; private static final String KEY_APP_SETTINGS = "app_settings"; private static final String KEY_CATEGORIES = "categories"; private static final Intent APP_NOTIFICATION_PREFS_CATEGORY_INTENT = new Intent(Intent.ACTION_MAIN) Loading @@ -64,6 +67,7 @@ public class AppNotificationSettings extends SettingsPreferenceFragment { private Context mContext; private SwitchPreference mBlock; private PreferenceCategory mCategories; private AppRow mAppRow; private boolean mCreated; private boolean mIsSystemPackage; Loading Loading @@ -136,6 +140,7 @@ public class AppNotificationSettings extends SettingsPreferenceFragment { // Add topics List<Notification.Topic> topics = mBackend.getTopics(pkg, mUid); mCategories = (PreferenceCategory) getPreferenceScreen().findPreference(KEY_CATEGORIES); for (Notification.Topic topic : topics) { Preference topicPreference = new Preference(mContext); topicPreference.setKey(topic.getId()); Loading @@ -151,8 +156,7 @@ public class AppNotificationSettings extends SettingsPreferenceFragment { TopicNotificationSettings.class.getName(), topicArgs, null, R.string.topic_notifications_title, null, false); topicPreference.setIntent(topicIntent); // Add preference to the settings menu. getPreferenceScreen().addPreference(topicPreference); mCategories.addPreference(topicPreference); } mBlock.setChecked(mAppRow.banned); Loading Loading @@ -198,6 +202,9 @@ public class AppNotificationSettings extends SettingsPreferenceFragment { private void updateDependents(boolean banned) { setVisible(mBlock, !mIsSystemPackage); if (mCategories != null) { setVisible(mCategories, !banned); } } private void setVisible(Preference p, boolean visible) { Loading src/com/android/settings/notification/ImportanceSeekBarPreference.java +5 −10 Original line number Diff line number Diff line Loading @@ -90,20 +90,15 @@ public class ImportanceSeekBarPreference extends SeekBarPreference implements private String getProgressSummary(int progress) { switch (progress) { case NotificationListenerService.Ranking.IMPORTANCE_NONE: return getContext().getString( com.android.internal.R.string.notification_importance_blocked); return getContext().getString(R.string.notification_importance_blocked); case NotificationListenerService.Ranking.IMPORTANCE_LOW: return getContext().getString( com.android.internal.R.string.notification_importance_low); return getContext().getString(R.string.notification_importance_low); case NotificationListenerService.Ranking.IMPORTANCE_DEFAULT: return getContext().getString( com.android.internal.R.string.notification_importance_default); return getContext().getString(R.string.notification_importance_default); case NotificationListenerService.Ranking.IMPORTANCE_HIGH: return getContext().getString( com.android.internal.R.string.notification_importance_high); return getContext().getString(R.string.notification_importance_high); case NotificationListenerService.Ranking.IMPORTANCE_MAX: return getContext().getString( com.android.internal.R.string.notification_importance_max); return getContext().getString(R.string.notification_importance_max); default: return ""; } Loading Loading
res/values/strings.xml +19 −0 Original line number Diff line number Diff line Loading @@ -5699,7 +5699,26 @@ <!-- Sound & notification > Notification section: Title for the option managing notifications per topic. [CHAR LIMIT=30] --> <string name="topic_notifications_title">Topic notifications</string> <!-- [CHAR LIMIT=100] Notification topic list header --> <string name="notification_topic_categories">Categories</string> <!-- [CHAR LIMIT=100] Notification importance slider title --> <string name="notification_importance_title">Importance</string> <!-- [CHAR LIMIT=100] Notification Importance slider: blocked importance level description --> <string name="notification_importance_blocked">Blocked: Never show these notifications</string> <!-- [CHAR LIMIT=100] Notification Importance slider: low importance level description --> <string name="notification_importance_low">Low: Silently show at the bottom of the notification list</string> <!-- [CHAR LIMIT=100] Notification Importance slider: normal importance level description --> <string name="notification_importance_default">Normal: Silently show these notifications</string> <!-- [CHAR LIMIT=100] Notification Importance slider: high importance level description --> <string name="notification_importance_high">High: Show at the top of the notifications list and make sound</string> <!-- [CHAR LIMIT=100] Notification Importance slider: max importance level description --> <string name="notification_importance_max">Urgent: Peek onto the screen and make sound</string> <!-- Sound & notification > Advanced section: Title for managing notification listeners option. [CHAR LIMIT=30] --> <string name="manage_notification_access_title">Notification access</string> Loading
res/xml/app_notification_settings.xml +6 −1 Original line number Diff line number Diff line Loading @@ -30,7 +30,12 @@ <Preference android:key="app_settings" android:title="@string/app_notification_preferences" android:order="5" android:order="2" android:persistent="false" /> <PreferenceCategory android:key="categories" android:title="@string/notification_topic_categories" android:order="3" /> </PreferenceScreen>
res/xml/topic_notification_settings.xml +1 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ <!-- Importance --> <com.android.settings.notification.ImportanceSeekBarPreference android:key="importance" android:title="@string/app_notification_importance_title" android:title="@string/notification_importance_title" android:order="1" android:persistent="false" /> Loading
src/com/android/settings/notification/AppNotificationSettings.java +9 −2 Original line number Diff line number Diff line Loading @@ -28,10 +28,12 @@ import android.content.pm.ResolveInfo; import android.os.Bundle; import android.os.UserHandle; import android.provider.Settings; import android.service.notification.NotificationListenerService; import android.support.v14.preference.SwitchPreference; import android.support.v7.preference.Preference; import android.support.v7.preference.Preference.OnPreferenceChangeListener; import android.support.v7.preference.Preference.OnPreferenceClickListener; import android.support.v7.preference.PreferenceCategory; import android.text.TextUtils; import android.util.ArrayMap; import android.util.Log; Loading @@ -55,6 +57,7 @@ public class AppNotificationSettings extends SettingsPreferenceFragment { private static final String KEY_BLOCK = "block"; private static final String KEY_APP_SETTINGS = "app_settings"; private static final String KEY_CATEGORIES = "categories"; private static final Intent APP_NOTIFICATION_PREFS_CATEGORY_INTENT = new Intent(Intent.ACTION_MAIN) Loading @@ -64,6 +67,7 @@ public class AppNotificationSettings extends SettingsPreferenceFragment { private Context mContext; private SwitchPreference mBlock; private PreferenceCategory mCategories; private AppRow mAppRow; private boolean mCreated; private boolean mIsSystemPackage; Loading Loading @@ -136,6 +140,7 @@ public class AppNotificationSettings extends SettingsPreferenceFragment { // Add topics List<Notification.Topic> topics = mBackend.getTopics(pkg, mUid); mCategories = (PreferenceCategory) getPreferenceScreen().findPreference(KEY_CATEGORIES); for (Notification.Topic topic : topics) { Preference topicPreference = new Preference(mContext); topicPreference.setKey(topic.getId()); Loading @@ -151,8 +156,7 @@ public class AppNotificationSettings extends SettingsPreferenceFragment { TopicNotificationSettings.class.getName(), topicArgs, null, R.string.topic_notifications_title, null, false); topicPreference.setIntent(topicIntent); // Add preference to the settings menu. getPreferenceScreen().addPreference(topicPreference); mCategories.addPreference(topicPreference); } mBlock.setChecked(mAppRow.banned); Loading Loading @@ -198,6 +202,9 @@ public class AppNotificationSettings extends SettingsPreferenceFragment { private void updateDependents(boolean banned) { setVisible(mBlock, !mIsSystemPackage); if (mCategories != null) { setVisible(mCategories, !banned); } } private void setVisible(Preference p, boolean visible) { Loading
src/com/android/settings/notification/ImportanceSeekBarPreference.java +5 −10 Original line number Diff line number Diff line Loading @@ -90,20 +90,15 @@ public class ImportanceSeekBarPreference extends SeekBarPreference implements private String getProgressSummary(int progress) { switch (progress) { case NotificationListenerService.Ranking.IMPORTANCE_NONE: return getContext().getString( com.android.internal.R.string.notification_importance_blocked); return getContext().getString(R.string.notification_importance_blocked); case NotificationListenerService.Ranking.IMPORTANCE_LOW: return getContext().getString( com.android.internal.R.string.notification_importance_low); return getContext().getString(R.string.notification_importance_low); case NotificationListenerService.Ranking.IMPORTANCE_DEFAULT: return getContext().getString( com.android.internal.R.string.notification_importance_default); return getContext().getString(R.string.notification_importance_default); case NotificationListenerService.Ranking.IMPORTANCE_HIGH: return getContext().getString( com.android.internal.R.string.notification_importance_high); return getContext().getString(R.string.notification_importance_high); case NotificationListenerService.Ranking.IMPORTANCE_MAX: return getContext().getString( com.android.internal.R.string.notification_importance_max); return getContext().getString(R.string.notification_importance_max); default: return ""; } Loading