Repository navigation
fix(chat): let the voice message notification go right after a pause - #6932
Open
ToteMeiSter wants to merge 1 commit into
Open
ToteMeiSter wants to merge 1 commit into
ToteMeiSter wants to merge 1 commit into
Conversation
Media3 keeps a media service in the foreground for 10 minutes after the player pauses or the message ends (DEFAULT_FOREGROUND_SERVICE_TIMEOUT_MS), and the notification of a foreground service cannot be swiped away. Set the timeout to 0, so that the service leaves the foreground as soon as playback stops. Assisted-by: Claude-Code:claude-sonnet-5-5 Signed-off-by: Krainov Gleb <krajnov.g@kontentplus.ru>
Contributor
📱 QA build
The QA build installs alongside a released Nextcloud app, so you can keep Downloading the file requires a GitHub account, so open this link on the |
Contributor
rapterjet2004
approved these changes
Oct 19, 2026
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.
Lets the notification of a voice message be swiped away right after the message is paused or ends.
After a pause or the end of a voice message the notification stays for about 10 minutes and cannot be swiped away. Media3 keeps a
MediaSessionServicein the foreground forDEFAULT_FOREGROUND_SERVICE_TIMEOUT_MS(600000 ms) after the player stops, and the notification of a foreground service cannot be dismissed.VoiceMessageMediaServicedoes not change the timeout (media3 1.11.1).The change is
setForegroundServiceTimeoutMs(0)inVoiceMessageMediaService.onCreate. The service leaves the foreground as soon as the playback stops; while a message plays it stays in the foreground, so playback in the background is not affected.To test: play a voice message and let it end, or pause it. The notification can be swiped away at once (before: after about 10 minutes). Play a message and leave the chat: it keeps playing in the background with the notification.
Unit test:
VoiceMessageMediaServiceForegroundTestreads the timeout of the notification manager of the real service (reflection, there is no getter) and fails without the change. It checks the setting, not a live notification.Tested on: Huawei DEL-LX9 (Android 12), on a develop build of the fork that includes this fix.
Overlaps with #6840: both change
VoiceMessageMediaService.kt.🖼️ Screenshots
No UI change.
🚧 TODO
🏁 Checklist
/backport to stable-xx.x🤖 AI (if applicable)
🤖 Generated with Claude Code