NLS settings polish

- Update strings
- Link to NLS page from notifications
- And fix an ordering issue on that page

Test: manual
Fixes: 181855978
Fixes: 181125178
Change-Id: I93d975763326d1e6d0cd02887abc515ad55329d0
This commit is contained in:
Julia Reynolds
2021-03-04 14:53:26 -05:00
parent 61aa289dac
commit 8aaa9b1b24
5 changed files with 43 additions and 30 deletions

View File

@@ -8773,8 +8773,10 @@
<!-- app summary of notification app list screen [CHAR LIMIT=100] --> <!-- app summary of notification app list screen [CHAR LIMIT=100] -->
<string name="notifications_sent_never">Never</string> <string name="notifications_sent_never">Never</string>
<!-- Sound & notification > Advanced section: Title for managing notification listeners option. [CHAR LIMIT=30] --> <!-- Sound & notification > Advanced section: Title for managing notification listeners option. [CHAR LIMIT=60] -->
<string name="manage_notification_access_title">Notification access</string> <string name="manage_notification_access_title">Device &amp; app notifications</string>
<string name="manage_notification_access_summary">Control which notifications show on your apps and devices</string>
<!-- Notification Access section: Indicates that the work profile admin doesn't allow this <!-- Notification Access section: Indicates that the work profile admin doesn't allow this
notification listener to access work profile notifications [CHAR LIMIT=100] --> notification listener to access work profile notifications [CHAR LIMIT=100] -->
@@ -8833,26 +8835,19 @@
<string name="notification_listener_disable_warning_confirm">Turn off</string> <string name="notification_listener_disable_warning_confirm">Turn off</string>
<string name="notification_listener_disable_warning_cancel">Cancel</string> <string name="notification_listener_disable_warning_cancel">Cancel</string>
<string name="notification_listener_type_title">Allowed notification types</string> <string name="notification_listener_type_title">Allowed notification types</string>
<string name="notif_type_ongoing">Important ongoing notifications</string> <string name="notif_type_ongoing">Real-time</string>
<string name="notif_type_conversation">Conversation notifications</string> <string name="notif_type_ongoing_summary">Real-time communication from apps in use, navigation, phone calls, and more</string>
<string name="notif_type_alerting">Alerting notifications</string> <string name="notif_type_conversation">Conversations</string>
<string name="notif_type_silent">Silent notifications</string> <string name="notif_type_conversation_summary">SMS and other communications</string>
<string name="notif_type_alerting">Default</string>
<!-- Per notification listener, launches a list of apps whose notifications this listener cannot see --> <string name="notif_type_alerting_summary">Notifications that may ring or vibrate based on settings</string>
<string name="notif_listener_excluded_title">Apps that are not bridged to this listener</string> <string name="notif_type_silent">Silent</string>
<string name="notif_type_silent_summary">Notifications that never make sound or vibrations</string>
<!-- Per notification listener, when the listener can see notifications from all apps -->
<string name="notif_listener_excluded_summary_zero">All apps are bridged</string>
<!-- Per notification listener, a summary of how many apps this listener cannot see
notifications from -->
<plurals name="notif_listener_excluded_summary_nonzero">
<item quantity="one">%d app is not bridged</item>
<item quantity="other">%d apps are not bridged</item>
</plurals>
<!-- Per notification listener, a list of apps whose notifications this listener cannot see --> <!-- Per notification listener, a list of apps whose notifications this listener cannot see -->
<string name="notif_listener_excluded_app_title">Bridged apps</string> <string name="notif_listener_excluded_app_title">See all apps</string>
<string name="notif_listener_excluded_app_summary">Change notification settings for each app that can send notifications</string>
<string name="notif_listener_excluded_app_screen_title">Apps shown on device</string>
<!-- Title for managing VR (virtual reality) helper services. [CHAR LIMIT=50] --> <!-- Title for managing VR (virtual reality) helper services. [CHAR LIMIT=50] -->
<string name="vr_listeners_title">VR helper services</string> <string name="vr_listeners_title">VR helper services</string>

View File

@@ -23,12 +23,14 @@
android:title="@string/conversation_notifs_category"> android:title="@string/conversation_notifs_category">
<Preference <Preference
android:key="conversations" android:key="conversations"
android:order="1"
android:title="@string/conversations_category_title" android:title="@string/conversations_category_title"
settings:controller="com.android.settings.notification.ConversationListSummaryPreferenceController" settings:controller="com.android.settings.notification.ConversationListSummaryPreferenceController"
android:fragment="com.android.settings.notification.app.ConversationListSettings" android:fragment="com.android.settings.notification.app.ConversationListSettings"
/> />
<Preference <Preference
android:key="notification_bubbles" android:key="notification_bubbles"
android:order="2"
android:title="@string/notification_bubbles_title" android:title="@string/notification_bubbles_title"
android:summary="@string/notifications_bubble_setting_on_summary" android:summary="@string/notifications_bubble_setting_on_summary"
settings:controller="com.android.settings.notification.BubbleSummaryNotificationPreferenceController" settings:controller="com.android.settings.notification.BubbleSummaryNotificationPreferenceController"
@@ -44,6 +46,7 @@
<!-- See all apps button --> <!-- See all apps button -->
<Preference <Preference
android:key="all_notifications" android:key="all_notifications"
android:order="10"
android:title="@string/notifications_title" android:title="@string/notifications_title"
android:fragment="com.android.settings.applications.manageapplications.ManageApplications" android:fragment="com.android.settings.applications.manageapplications.ManageApplications"
settings:searchable="false"> settings:searchable="false">
@@ -58,6 +61,7 @@
android:title="@string/lock_screen_notifications_title"> android:title="@string/lock_screen_notifications_title">
<Preference <Preference
android:key="notification_history" android:key="notification_history"
android:order="11"
android:title="@string/notification_history" android:title="@string/notification_history"
android:summary="@string/notification_history_summary"> android:summary="@string/notification_history_summary">
<intent <intent
@@ -65,27 +69,38 @@
android:targetPackage="com.android.settings" android:targetPackage="com.android.settings"
android:targetClass="com.android.settings.notification.history.NotificationHistoryActivity" /> android:targetClass="com.android.settings.notification.history.NotificationHistoryActivity" />
</Preference> </Preference>
<Preference
android:key="notification_access"
android:order="12"
android:title="@string/manage_notification_access_title"
android:summary="@string/manage_notification_access_summary"
android:fragment="com.android.settings.notification.NotificationAccessSettings"
settings:controller="com.android.settings.applications.specialaccess.notificationaccess.NotificationAccessController" />
<!-- When device is locked --> <!-- When device is locked -->
<com.android.settings.RestrictedListPreference <com.android.settings.RestrictedListPreference
android:key="lock_screen_notifications" android:key="lock_screen_notifications"
android:order="13"
android:title="@string/lock_screen_notifs_title" android:title="@string/lock_screen_notifs_title"
android:singleLineTitle="false" android:singleLineTitle="false"
android:summary="@string/summary_placeholder" /> android:summary="@string/summary_placeholder" />
<SwitchPreference <SwitchPreference
android:key="lock_screen_redact" android:key="lock_screen_redact"
android:order="14"
android:title="@string/lock_screen_notifs_redact" android:title="@string/lock_screen_notifs_redact"
android:summary="@string/lock_screen_notifs_redact_summary" android:summary="@string/lock_screen_notifs_redact_summary"
settings:controller="com.android.settings.notification.RedactNotificationPreferenceController" /> settings:controller="com.android.settings.notification.RedactNotificationPreferenceController" />
<SwitchPreference <SwitchPreference
android:key="lock_screen_work_redact" android:key="lock_screen_work_redact"
android:order="15"
android:title="@string/lock_screen_notifs_redact_work" android:title="@string/lock_screen_notifs_redact_work"
android:summary="@string/lock_screen_notifs_redact_work_summary" android:summary="@string/lock_screen_notifs_redact_work_summary"
settings:controller="com.android.settings.notification.RedactNotificationPreferenceController" /> settings:controller="com.android.settings.notification.RedactNotificationPreferenceController" />
<SwitchPreference <SwitchPreference
android:key="notification_lockscreen_bypass" android:key="notification_lockscreen_bypass"
android:order="16"
android:title="@string/lockscreen_bypass_title" android:title="@string/lockscreen_bypass_title"
android:summary="@string/lockscreen_bypass_summary" android:summary="@string/lockscreen_bypass_summary"
settings:searchable="false" settings:searchable="false"
@@ -98,6 +113,7 @@
android:title="@string/advanced_section_header"> android:title="@string/advanced_section_header">
<com.android.settingslib.RestrictedPreference <com.android.settingslib.RestrictedPreference
android:key="zen_mode_notifications" android:key="zen_mode_notifications"
android:order="17"
android:title="@string/zen_mode_settings_title" android:title="@string/zen_mode_settings_title"
settings:useAdminDisabledSummary="true" settings:useAdminDisabledSummary="true"
android:fragment="com.android.settings.notification.zen.ZenModeSettings" android:fragment="com.android.settings.notification.zen.ZenModeSettings"
@@ -105,6 +121,7 @@
/> />
<com.android.settingslib.RestrictedPreference <com.android.settingslib.RestrictedPreference
android:key="app_and_notif_cell_broadcast_settings" android:key="app_and_notif_cell_broadcast_settings"
android:order="18"
android:title="@string/cell_broadcast_settings" android:title="@string/cell_broadcast_settings"
settings:useAdminDisabledSummary="true"> settings:useAdminDisabledSummary="true">
<intent <intent
@@ -115,23 +132,27 @@
<SwitchPreference <SwitchPreference
android:key="silent_icons" android:key="silent_icons"
android:order="19"
android:title="@string/silent_notifications_status_bar" android:title="@string/silent_notifications_status_bar"
settings:controller="com.android.settings.notification.SilentStatusBarPreferenceController"/> settings:controller="com.android.settings.notification.SilentStatusBarPreferenceController"/>
<SwitchPreference <SwitchPreference
android:key="show_snooze_options" android:key="show_snooze_options"
android:order="20"
android:title="@string/snooze_options_title" android:title="@string/snooze_options_title"
settings:controller="com.android.settings.notification.SnoozeNotificationPreferenceController" /> settings:controller="com.android.settings.notification.SnoozeNotificationPreferenceController" />
<!-- Notification badging --> <!-- Notification badging -->
<SwitchPreference <SwitchPreference
android:key="notification_badging" android:key="notification_badging"
android:order="21"
android:title="@string/notification_badging_title" android:title="@string/notification_badging_title"
settings:controller="com.android.settings.notification.BadgingNotificationPreferenceController"/> settings:controller="com.android.settings.notification.BadgingNotificationPreferenceController"/>
<!-- Pulse notification light, on devices that support it --> <!-- Pulse notification light, on devices that support it -->
<SwitchPreference <SwitchPreference
android:key="notification_pulse" android:key="notification_pulse"
android:order="22"
android:title="@string/notification_pulse_title" android:title="@string/notification_pulse_title"
settings:controller="com.android.settings.notification.PulseNotificationPreferenceController"/> settings:controller="com.android.settings.notification.PulseNotificationPreferenceController"/>
</PreferenceCategory> </PreferenceCategory>

View File

@@ -19,7 +19,7 @@
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res-auto" xmlns:settings="http://schemas.android.com/apk/res-auto"
android:key="nonbridged_apps" android:key="nonbridged_apps"
android:title="@string/notif_listener_excluded_app_title" android:title="@string/notif_listener_excluded_app_screen_title"
settings:controller="com.android.settings.applications.specialaccess.notificationaccess.BridgedAppsPreferenceController" settings:controller="com.android.settings.applications.specialaccess.notificationaccess.BridgedAppsPreferenceController"
settings:searchable="false"> settings:searchable="false">
</PreferenceScreen> </PreferenceScreen>

View File

@@ -34,27 +34,32 @@
<CheckBoxPreference <CheckBoxPreference
android:key="type_filter_ongoing" android:key="type_filter_ongoing"
android:title="@string/notif_type_ongoing" android:title="@string/notif_type_ongoing"
android:summary="@string/notif_type_ongoing_summary"
android:icon="@drawable/ic_ongoing_notification" android:icon="@drawable/ic_ongoing_notification"
settings:controller="com.android.settings.applications.specialaccess.notificationaccess.OngoingTypeFilterPreferenceController"/> settings:controller="com.android.settings.applications.specialaccess.notificationaccess.OngoingTypeFilterPreferenceController"/>
<CheckBoxPreference <CheckBoxPreference
android:key="type_filter_conversation" android:key="type_filter_conversation"
android:title="@string/notif_type_conversation" android:title="@string/notif_type_conversation"
android:summary="@string/notif_type_conversation_summary"
android:icon="@drawable/ic_promote_conversation" android:icon="@drawable/ic_promote_conversation"
settings:controller="com.android.settings.applications.specialaccess.notificationaccess.ConversationTypeFilterPreferenceController"/> settings:controller="com.android.settings.applications.specialaccess.notificationaccess.ConversationTypeFilterPreferenceController"/>
<CheckBoxPreference <CheckBoxPreference
android:key="type_filter_alerting" android:key="type_filter_alerting"
android:title="@string/notif_type_alerting" android:title="@string/notif_type_alerting"
android:summary="@string/notif_type_alerting_summary"
android:icon="@drawable/ic_notification_alert" android:icon="@drawable/ic_notification_alert"
settings:controller="com.android.settings.applications.specialaccess.notificationaccess.AlertingTypeFilterPreferenceController"/> settings:controller="com.android.settings.applications.specialaccess.notificationaccess.AlertingTypeFilterPreferenceController"/>
<CheckBoxPreference <CheckBoxPreference
android:key="type_filter_silent" android:key="type_filter_silent"
android:title="@string/notif_type_silent" android:title="@string/notif_type_silent"
android:summary="@string/notif_type_silent_summary"
android:icon="@drawable/ic_notification_silence" android:icon="@drawable/ic_notification_silence"
settings:controller="com.android.settings.applications.specialaccess.notificationaccess.SilentTypeFilterPreferenceController"/> settings:controller="com.android.settings.applications.specialaccess.notificationaccess.SilentTypeFilterPreferenceController"/>
<Preference <Preference
android:key="bridged_apps" android:key="bridged_apps"
android:title="@string/notif_listener_excluded_app_title" android:title="@string/notif_listener_excluded_app_title"
android:summary="@string/notif_listener_excluded_app_summary"
android:fragment="com.android.settings.applications.specialaccess.notificationaccess.BridgedAppsSettings" android:fragment="com.android.settings.applications.specialaccess.notificationaccess.BridgedAppsSettings"
settings:searchable="false" settings:searchable="false"
settings:controller="com.android.settings.applications.specialaccess.notificationaccess.BridgedAppsPreferenceController" /> settings:controller="com.android.settings.applications.specialaccess.notificationaccess.BridgedAppsPreferenceController" />

View File

@@ -60,7 +60,6 @@ public class NotificationAccessDetails extends DashboardFragment {
private static final String TAG = "NotifAccessDetails"; private static final String TAG = "NotifAccessDetails";
private NotificationBackend mNm = new NotificationBackend(); private NotificationBackend mNm = new NotificationBackend();
private NotificationListenerFilter mNlf;
private ComponentName mComponentName; private ComponentName mComponentName;
private CharSequence mServiceName; private CharSequence mServiceName;
protected ServiceInfo mServiceInfo; protected ServiceInfo mServiceInfo;
@@ -157,13 +156,6 @@ public class NotificationAccessDetails extends DashboardFragment {
Preference apps = getPreferenceScreen().findPreference( Preference apps = getPreferenceScreen().findPreference(
use(BridgedAppsPreferenceController.class).getPreferenceKey()); use(BridgedAppsPreferenceController.class).getPreferenceKey());
if (apps != null) { if (apps != null) {
mNlf = mNm.getListenerFilter(mComponentName, mUserId);
int nonBridgedCount = mNlf.getDisallowedPackages().size();
apps.setSummary(nonBridgedCount == 0 ?
getString(R.string.notif_listener_excluded_summary_zero)
: getResources().getQuantityString(
R.plurals.notif_listener_excluded_summary_nonzero,
nonBridgedCount, nonBridgedCount));
apps.setOnPreferenceClickListener(preference -> { apps.setOnPreferenceClickListener(preference -> {
final Bundle args = new Bundle(); final Bundle args = new Bundle();
@@ -174,7 +166,7 @@ public class NotificationAccessDetails extends DashboardFragment {
new SubSettingLauncher(getContext()) new SubSettingLauncher(getContext())
.setDestination(BridgedAppsSettings.class.getName()) .setDestination(BridgedAppsSettings.class.getName())
.setSourceMetricsCategory(getMetricsCategory()) .setSourceMetricsCategory(getMetricsCategory())
.setTitleRes(R.string.notif_listener_excluded_app_title) .setTitleRes(R.string.notif_listener_excluded_app_screen_title)
.setArguments(args) .setArguments(args)
.setUserHandle(UserHandle.of(mUserId)) .setUserHandle(UserHandle.of(mUserId))
.launch(); .launch();