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:
Julia Reynolds
2021-02-11 21:29:41 -05:00
parent d7af6821dc
commit 4dc7795eb3
66 changed files with 1067 additions and 333 deletions

View File

@@ -16,6 +16,7 @@
package com.android.settings.notification.app;
import android.app.NotificationChannel;
import android.content.Context;
import androidx.preference.Preference;
@@ -42,11 +43,19 @@ public class NotificationsOffPreferenceController extends NotificationPreference
if (mAppRow == null) {
return false;
}
if (mPreferenceFilter != null && !isIncludedInFilter()) {
return false;
}
// Available only when other controllers are unavailable - this UI replaces the UI that
// would give more detailed notification controls.
return !super.isAvailable();
}
@Override
boolean isIncludedInFilter() {
return mPreferenceFilter.contains(NotificationChannel.EDIT_IMPORTANCE);
}
public void updateState(Preference preference) {
if (mAppRow != null) {
if (mChannel != null) {