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

@@ -60,7 +60,6 @@ public class NotificationAccessDetails extends DashboardFragment {
private static final String TAG = "NotifAccessDetails";
private NotificationBackend mNm = new NotificationBackend();
private NotificationListenerFilter mNlf;
private ComponentName mComponentName;
private CharSequence mServiceName;
protected ServiceInfo mServiceInfo;
@@ -157,13 +156,6 @@ public class NotificationAccessDetails extends DashboardFragment {
Preference apps = getPreferenceScreen().findPreference(
use(BridgedAppsPreferenceController.class).getPreferenceKey());
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 -> {
final Bundle args = new Bundle();
@@ -174,7 +166,7 @@ public class NotificationAccessDetails extends DashboardFragment {
new SubSettingLauncher(getContext())
.setDestination(BridgedAppsSettings.class.getName())
.setSourceMetricsCategory(getMetricsCategory())
.setTitleRes(R.string.notif_listener_excluded_app_title)
.setTitleRes(R.string.notif_listener_excluded_app_screen_title)
.setArguments(args)
.setUserHandle(UserHandle.of(mUserId))
.launch();