Allow to block/unblock Conversation Notifications from Settings

The user can end up in a state where the Channel of a Conversation is
blocked (has an importance of 0).
Currently there was no way to unblock it, because we didn't allow it from
the Settings. Therefore now the option to block/unblock is added to the
Conversation Settings page.

Fixes: 255062535
Test: Block/Unblock a Conversation from Settings
Test: Mark a notification blocked and conversation by clicking the “Show
notifications” toggle and the “This is a conversation” button at once.
Now unblock it from the Settings.

Change-Id: I06778d259155d87d6af4bdb7013cd3b6c9a2e5ee
This commit is contained in:
András Kurucz
2022-11-23 13:24:36 +00:00
parent 6f908bae6f
commit 0fa99226e1
2 changed files with 4 additions and 0 deletions

View File

@@ -25,6 +25,9 @@
android:layout="@layout/settings_entity_header"
settings:allowDividerBelow="true"/>
<com.android.settings.widget.SettingsMainSwitchPreference
android:key="block" />
<!-- important conversation -->
<com.android.settings.notification.app.ConversationPriorityPreference
android:key="priority"

View File

@@ -83,6 +83,7 @@ public class ConversationNotificationSettings extends NotificationSettings {
protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
mControllers = new ArrayList<>();
mControllers.add(new ConversationHeaderPreferenceController(context, this));
mControllers.add(new BlockPreferenceController(context, mDependentFieldListener, mBackend));
mControllers.add(new ConversationPriorityPreferenceController(
context, mBackend, mDependentFieldListener));
mControllers.add(new HighImportancePreferenceController(