fix(call): end push to talk on ACTION_CANCEL - #6547
Conversation
The microphone button's touch listener only released push to talk on ACTION_UP. When the long-press ended with ACTION_CANCEL instead (finger dragged into a system gesture edge, notification shade pulled), the release branch never ran: isPushToTalkActive stayed true, the WebRTC audio track stayed enabled, and the device kept transmitting room audio while the button showed "muted" - a hot-mic privacy bug. The release logic is extracted into stopPushToTalk() and now runs for both ACTION_UP and ACTION_CANCEL. Assisted-by: opencode:ox-alpha Signed-off-by: Tarek Loubani <tarek@tarek.org>
|
APK file: https://github.com/nextcloud/talk-android/actions/runs/32628493666/artifacts/9490447059 |
There was a problem hiding this comment.
Pull request overview
Fixes a privacy-critical push-to-talk edge case in CallActivity where touch sequences ending in MotionEvent.ACTION_CANCEL could leave the microphone transmitting indefinitely while the UI appeared muted.
Changes:
- Treat
ACTION_CANCELthe same asACTION_UPfor push-to-talk release detection. - Extract push-to-talk release logic into
stopPushToTalk()for reuse and clarity. - Add unit tests covering push-to-talk release detection (
ACTION_UP,ACTION_CANCEL, and non-release actions).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| app/src/main/java/com/nextcloud/talk/activities/CallActivity.kt | Adds a shared stop helper and ends PTT on both ACTION_UP and ACTION_CANCEL. |
| app/src/test/java/com/nextcloud/talk/activities/CallActivityPushToTalkTest.kt | Adds unit tests to pin expected release-action behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
/backport to stable-25.0.x |
fix(call): end push to talk on ACTION_CANCEL
Description
The microphone button's touch listener only released push to talk on
ACTION_UP. When the long-press ended withMotionEvent.ACTION_CANCELinstead — finger dragged into the system back-gesture edge or navigation bar, notification shade pulled while holding, or any other touch interception — the release branch never ran:isPushToTalkActivestayedtrueA hot-mic privacy bug, and a source of "they hear me although I'm muted" reports.
The release logic is extracted into
stopPushToTalk()and now runs for bothACTION_UPandACTION_CANCEL, pinned by unit tests.Steps to reproduce / How to test
ACTION_CANCEL— e.g. drag the finger into the back-gesture edge or pull down the notification shade while holdingWithout this PR: remote keeps hearing you; the button shows "muted".
With this PR: the mic is muted as soon as the gesture ends, regardless of how it ends.
Also verify regular PTT behavior is unchanged: long-press to talk, release to mute; tap toggles mute as before.
CallActivityPushToTalkTest)Note: This PR was developed with AI assistance (opencode / Kimi-K3).