Let the user turn off conversation notifications - #7548
Open
hayaksi1 wants to merge 5 commits into
Open
Conversation
Every room notification carries a shortcut id, which makes it an Android conversation, and a conversation is exempt from Do Not Disturb whenever the system policy allows conversations from anyone. There was no way to opt out from inside the app, and some OEM ROMs expose no conversation controls of their own either. Notification settings gain a switch, on by default so nothing changes for anyone who wants today's behaviour. Turning it off stops the shortcut being set on new notifications, stops shortcuts being published when sending a message, and removes the shortcuts already published, since those are what make the existing notifications conversations.
Contributor
|
Thank you for your contribution! Here are a few things to check in the PR to ensure it's reviewed as quickly as possible:
|
# Conflicts: # libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/notifications/conversations/DefaultNotificationConversationServiceTest.kt
…tions test. runCurrent() is experimental; the merge of develop into this PR kept the existing opted-in tests and added a new one that needs the same annotation. Fork-Feature: fix/7471-conversation-notifications
# Conflicts: # tests/uitests/src/test/snapshots/images/features.preferences.impl.notifications_NotificationSettingsView_Day_18_en.png # tests/uitests/src/test/snapshots/images/features.preferences.impl.notifications_NotificationSettingsView_Day_19_en.png # tests/uitests/src/test/snapshots/images/features.preferences.impl.notifications_NotificationSettingsView_Day_20_en.png # tests/uitests/src/test/snapshots/images/features.preferences.impl.notifications_NotificationSettingsView_Night_18_en.png # tests/uitests/src/test/snapshots/images/features.preferences.impl.notifications_NotificationSettingsView_Night_19_en.png # tests/uitests/src/test/snapshots/images/features.preferences.impl.notifications_NotificationSettingsView_Night_20_en.png
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Content
Every room notification carries a shortcut id, which is what makes it an Android conversation, and a
conversation is exempt from Do Not Disturb whenever the system policy allows conversations from
anyone. The channel does not ask for a bypass — the exemption comes purely from conversation status —
and there is no way to opt out from inside the app.
Notification settings gain a switch, on by default so nothing changes for anyone who wants today's
behaviour. Turning it off stops
setShortcutIdbeing called on new notifications, stops a shortcutbeing published when a message is sent, and clears the shortcuts already published, since those are
what make the notifications already on screen conversations.
Motivation and context
Closes #7471. The reporter measured it with
adb: with DND active, the records carrying a shortcutwere logged
not_intercepted … new:conversationAnyonewhile the shortcut-less group summary wasintercepted. Their device's ROM exposes no conversation settings, so the system-side control thefeature relies on does not exist for them.
The default stays on deliberately: #1547 asked for conversation notifications and #7056 reports their
loss as a regression, so this is an escape hatch rather than a change of behaviour.
The new strings are in
temporary.xmlper AGENTS.md.Tests
libraries/push/impl/.../factories/DefaultNotificationCreatorTest.ktasserts the notification carriesa shortcut id with the setting on and none with it off.
DefaultNotificationConversationServiceTestcovers the two shortcut paths: none is published whilethe setting is off, and the existing ones are cleared when it is turned off.
All three fail on develop, which always sets the shortcut.
Run with
./gradlew :libraries:push:impl:testDebugUnitTest.Tested devices
Checklist