fix(call): end push to talk on ACTION_CANCEL - #6547
Open
tareko wants to merge 1 commit into
Open
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>
Contributor
|
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.
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.
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).