From 19c4ea4da15f418e132edf49596bbcd4bee32fdd Mon Sep 17 00:00:00 2001 From: Julia Reynolds Date: Wed, 12 Jun 2019 11:39:39 -0400 Subject: [PATCH] Fix launching of work profile notif settings Test: manual Fixes: 132289017 Change-Id: I3c177aae1f4dd46556b652253d24b225d01987eb (cherry picked from commit 142920e0c228427000a46e13aa2945796f2ef626) --- ...centNotifyingAppsPreferenceController.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/com/android/settings/notification/RecentNotifyingAppsPreferenceController.java b/src/com/android/settings/notification/RecentNotifyingAppsPreferenceController.java index 8b5b7617fe9..9b20e7a4fd1 100644 --- a/src/com/android/settings/notification/RecentNotifyingAppsPreferenceController.java +++ b/src/com/android/settings/notification/RecentNotifyingAppsPreferenceController.java @@ -266,14 +266,17 @@ public class RecentNotifyingAppsPreferenceController extends AbstractPreferenceC Bundle args = new Bundle(); args.putString(AppInfoBase.ARG_PACKAGE_NAME, pkgName); args.putInt(AppInfoBase.ARG_PACKAGE_UID, appEntry.info.uid); - pref.setIntent(new SubSettingLauncher(mHost.getActivity()) - .setDestination(AppNotificationSettings.class.getName()) - .setTitleRes(R.string.notifications_title) - .setArguments(args) - .setUserHandle(new UserHandle(UserHandle.getUserId(appEntry.info.uid))) - .setSourceMetricsCategory( - SettingsEnums.MANAGE_APPLICATIONS_NOTIFICATIONS) - .toIntent()); + pref.setOnPreferenceClickListener(preference -> { + new SubSettingLauncher(mHost.getActivity()) + .setDestination(AppNotificationSettings.class.getName()) + .setTitleRes(R.string.notifications_title) + .setArguments(args) + .setUserHandle(new UserHandle(UserHandle.getUserId(appEntry.info.uid))) + .setSourceMetricsCategory( + SettingsEnums.MANAGE_APPLICATIONS_NOTIFICATIONS) + .launch(); + return true; + }); pref.setSwitchEnabled(mNotificationBackend.isBlockable(mContext, appEntry.info)); pref.setOnPreferenceChangeListener((preference, newValue) -> { boolean blocked = !(Boolean) newValue;