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:
@@ -22,12 +22,12 @@ import static android.app.NotificationManager.IMPORTANCE_HIGH;
|
||||
import android.app.NotificationChannel;
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.preference.Preference;
|
||||
|
||||
import com.android.settings.core.PreferenceControllerMixin;
|
||||
import com.android.settings.notification.NotificationBackend;
|
||||
import com.android.settingslib.RestrictedSwitchPreference;
|
||||
|
||||
import androidx.preference.Preference;
|
||||
|
||||
public class HighImportancePreferenceController extends NotificationPreferenceController
|
||||
implements PreferenceControllerMixin, Preference.OnPreferenceChangeListener {
|
||||
|
||||
@@ -60,6 +60,11 @@ public class HighImportancePreferenceController extends NotificationPreferenceCo
|
||||
return mChannel.getImportance() >= IMPORTANCE_DEFAULT;
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean isIncludedInFilter() {
|
||||
return mPreferenceFilter.contains(NotificationChannel.EDIT_IMPORTANCE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateState(Preference preference) {
|
||||
if (mAppRow != null && mChannel != null) {
|
||||
|
Reference in New Issue
Block a user