Repository navigation
fix(chat): keep a voice recording running while the media viewer is open - #7018
Merged
Merged
Conversation
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 |
Opening an image stops the chat activity. ChatViewModel.onStop then stopped the MediaRecorder, while the in-progress state of the recording stayed. The screen went on showing a running recording with a growing duration, and the sent voice message only held what was recorded before the image was opened. The recorder now only stops in onStop when the chat is left (the activity is finishing). Other Talk screens on top of the chat keep it running, as the app is still in the foreground and the microphone still captures. When the app goes to the background, Android silences the microphone, so the chat now stops the recording through ProcessLifecycleOwner: a locked recording keeps what was captured and the voice recording view shows the preview with a hint instead of a running duration; a recording that was still held is discarded like on a cancelled touch. The mic input animation is restarted when the view comes back. Assisted-by: Claude-Code:claude-opus-5-5 Signed-off-by: rapterjet2004 <juliuslinus1@gmail.com> linter fix - Screens that don't use the mic keep the recording running. ChatViewModel.onStop no longer stops the recorder, so the media viewer and similar screens don't end it. - The recording ends on a real interruption. VoiceRecordingInterrupter stops it when: - Talk goes to the background; - a call, an incoming call or another chat opens, on every Android version. - Other apps taking the mic also end it (Android 10+). MediaRecorderManager watches for the capture being silenced. - Locked and held recordings are treated differently. An interrupted locked recording becomes a preview with the hint ecording stopped. A held one is discarded. - Leaving the chat discards an active recording, and its .mp3 is deleted. - Stopping always stops the recorder, even if audio focus isn't given back. Signed-off-by: rapterjet2004 <juliuslinus1@gmail.com>
rapterjet2004
force-pushed
the
fix/voice-recording-stops-on-media-viewer
branch
from
November 10, 2026 15:43
e85bc21 to
571ebb9
Compare
Contributor
mahibi
self-requested a review
November 10, 2026 17:39
mahibi
approved these changes
Nov 10, 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.
Opening an image stops the chat activity. ChatViewModel.onStop then stopped the MediaRecorder, while the in-progress state of the recording stayed. The screen went on showing a running recording with a growing duration, and the sent voice message only held what was recorded before the image was opened.
The recorder now only stops in onStop when the chat is left (the activity is finishing). Other Talk screens on top of the chat keep it running, as the app is still in the foreground and the microphone still captures.
When the app goes to the background, Android silences the microphone, so the chat now stops the recording through ProcessLifecycleOwner: a locked recording keeps what was captured and the voice recording view shows the preview with a hint instead of a running duration; a recording that was still held is discarded like on a cancelled touch. The mic input animation is restarted when the view comes back.
Assisted-by: Claude-Code:claude-opus-5-5
🚧 TODO
🏁 Checklist
/backport to stable-xx.x🤖 AI (if applicable)