Skip to content

fix(chat): keep a voice recording running while the media viewer is open - #7018

Merged
rapterjet2004 merged 1 commit into
masterfrom
fix/voice-recording-stops-on-media-viewer
Nov 10, 2026
Merged

rapterjet2004 merged 1 commit into
masterfrom
fix/voice-recording-stops-on-media-viewer

Conversation

@rapterjet2004

@rapterjet2004 rapterjet2004 commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

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

  • ⛑️ Tests (unit and/or integration) are included or not needed
  • 🔖 Capability is checked or not needed
  • 🔙 Backport requests are created or not needed: /backport to stable-xx.x
  • 📅 Milestone is set
  • 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

📱 QA build

Download app-qa-debug.apk
QR code Open the QR code for this download
Commit 571ebb9
Version 7018
Available until 7 days after this build

The QA build installs alongside a released Nextcloud app, so you can keep
using your existing install while testing.

Downloading the file requires a GitHub account, so open this link on the
device you want to test on, or transfer the APK to it.

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
rapterjet2004 force-pushed the fix/voice-recording-stops-on-media-viewer branch from e85bc21 to 571ebb9 Compare November 10, 2026 15:43
@github-actions

Copy link
Copy Markdown
Contributor

Codacy

Lint

TypemasterPR
Warnings1717
Errors00

SpotBugs

CategoryBaseNew
Bad practice77
Correctness88
Dodgy code4040
Internationalization33
Malicious code vulnerability33
Performance77
Security1111
Total7979

@mahibi
mahibi self-requested a review November 10, 2026 17:39
@rapterjet2004
rapterjet2004 merged commit 79c0206 into master Nov 10, 2026
20 checks passed
@rapterjet2004
rapterjet2004 deleted the fix/voice-recording-stops-on-media-viewer branch November 10, 2026 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Voice-message recording silently stops when opening an image, while the recording timer keeps running

2 participants