Add filtering to notification channel settings
Allow apps that are launching this page to specify targeted subsets of settings that should be shown. Test: settings notification robotests Bug: 177246841 Change-Id: Ib491c43f1861a9775e3b25f39134cdbe105a7ff8
This commit is contained in:
@@ -74,6 +74,7 @@ abstract public class NotificationSettings extends DashboardFragment {
|
||||
protected NotificationBackend.AppRow mAppRow;
|
||||
protected Drawable mConversationDrawable;
|
||||
protected ShortcutInfo mConversationInfo;
|
||||
protected List<String> mPreferenceFilter;
|
||||
|
||||
protected boolean mShowLegacyChannelConfig = false;
|
||||
protected boolean mListeningToPackageRemove;
|
||||
@@ -119,6 +120,7 @@ abstract public class NotificationSettings extends DashboardFragment {
|
||||
loadChannel();
|
||||
loadAppRow();
|
||||
loadChannelGroup();
|
||||
loadPreferencesFilter();
|
||||
collectConfigActivities();
|
||||
|
||||
if (use(HeaderPreferenceController.class) != null) {
|
||||
@@ -131,7 +133,7 @@ abstract public class NotificationSettings extends DashboardFragment {
|
||||
|
||||
for (NotificationPreferenceController controller : mControllers) {
|
||||
controller.onResume(mAppRow, mChannel, mChannelGroup, null, null,
|
||||
mSuspendedAppsAdmin);
|
||||
mSuspendedAppsAdmin, mPreferenceFilter);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -181,9 +183,17 @@ abstract public class NotificationSettings extends DashboardFragment {
|
||||
loadChannel();
|
||||
loadConversation();
|
||||
loadChannelGroup();
|
||||
loadPreferencesFilter();
|
||||
collectConfigActivities();
|
||||
}
|
||||
|
||||
private void loadPreferencesFilter() {
|
||||
Intent intent = getActivity().getIntent();
|
||||
mPreferenceFilter = intent != null
|
||||
? intent.getStringArrayListExtra(Settings.EXTRA_CHANNEL_FILTER_LIST)
|
||||
: null;
|
||||
}
|
||||
|
||||
private void loadChannel() {
|
||||
Intent intent = getActivity().getIntent();
|
||||
String channelId = intent != null ? intent.getStringExtra(Settings.EXTRA_CHANNEL_ID) : null;
|
||||
|
Reference in New Issue
Block a user