Skip to content

Let the user turn off conversation notifications - #7548

Open
hayaksi1 wants to merge 5 commits into
element-hq:developfrom
hayaksi1:fix/7471-conversation-notifications
Open

Let the user turn off conversation notifications#7548
hayaksi1 wants to merge 5 commits into
element-hq:developfrom
hayaksi1:fix/7471-conversation-notifications

Conversation

@hayaksi1

Copy link
Copy Markdown
Contributor

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 setShortcutId being called on new notifications, stops a shortcut
being 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 shortcut
were logged not_intercepted … new:conversationAnyone while the shortcut-less group summary was
intercepted. Their device's ROM exposes no conversation settings, so the system-side control the
feature 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.xml per AGENTS.md.

Tests

libraries/push/impl/.../factories/DefaultNotificationCreatorTest.kt asserts the notification carries
a shortcut id with the setting on and none with it off.
DefaultNotificationConversationServiceTest covers the two shortcut paths: none is published while
the 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

  • Physical
  • Emulator
  • OS version(s):

Checklist

  • I am aware of the etiquette.
  • This PR was made with the help of AI:
    • Yes. In this case, please request a review by Copilot.
    • No.
  • Changes have been tested on an Android device or Android emulator with API 24
  • UI change has been tested on both light and dark themes
  • Accessibility has been taken into account. See https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
  • Pull request is based on the develop branch
  • Pull request title will be used in the release note, it clearly defines what will change for the user
  • Pull request includes screenshots or videos if containing UI changes
  • You've made a self review of your PR

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.
@hayaksi1
hayaksi1 requested a review from a team as a code owner August 25, 2026 13:44
@hayaksi1
hayaksi1 requested review from bmarty and removed request for a team August 25, 2026 13:44
@github-actions

Copy link
Copy Markdown
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:

  • If your pull request adds a feature or modifies the UI, this should have an equivalent pull request in the Element X iOS repo unless it only affects an Android-only behaviour or is behind a disabled feature flag, since we need parity in both clients to consider a feature done. It will also need to be approved by our product and design teams before being merged, so it's usually a good idea to discuss the changes in a Github issue first and then start working on them once the approach has been validated.
  • Your branch should be based on origin/develop, at least when it was created.
  • The title of the PR will be used for release notes, so it needs to describe the change visible to the user.
  • The test pass locally running ./gradlew test.
  • The code quality check suite pass locally running ./gradlew runQualityChecks.
  • If you modified anything related to the UI, including previews, you'll have to run the Record screenshots GH action in your forked repo: that will generate compatible new screenshots. However, given Github Actions limitations, it will prevent the CI from running temporarily, until you upload a new commit after that one. To do so, just pull the latest changes and push an empty commit.

@github-actions github-actions Bot added the Z-Community-PR Issue is solved by a community member's PR label Aug 25, 2026
# 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Z-Community-PR Issue is solved by a community member's PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow opting out of Android conversation notifications (they bypass Do Not Disturb with no in-app control)

1 participant