Fix/bluetooth call routing - #6774
Merged
Merged
Conversation
1 of 7 tasks
Prefer call-capable Bluetooth communication devices and preserve selection across reconnects. Assisted-by: Codex:gpt-5 Signed-off-by: Oleg Cherry <80347136+flake92@users.noreply.github.com>
Assisted-by: Codex:gpt-5 Signed-off-by: Oleg Cherry <80347136+flake92@users.noreply.github.com>
Keep the working route when a device switch is rejected, preserve bounded retry state across focus changes, reject stale callbacks, and share wired-device detection. Convert the new policy and tests to Kotlin. Assisted-by: Codex:gpt-5 Signed-off-by: flake92 <flake92@live.com>
Preserve the active route until a non-Bluetooth replacement is confirmed. Keep automatic retry limits across focus recovery, reject stale callbacks, and reconcile wired and USB devices consistently. Assisted-by: OpenAI Codex:gpt-5.6-sol Signed-off-by: flake92 <flake92@live.com>
Extract modern Bluetooth focus recovery into a dedicated helper to keep the public dispatcher below the Codacy PMD NPath threshold without changing behavior. Assisted-by: OpenAI Codex:gpt-5.6-sol Signed-off-by: flake92 <flake92@live.com>
Delay ringback and remote audio playout until Android confirms the selected communication route. Keep reconnects silent and preserve the working privacy build behavior while retaining the hardened Bluetooth transition policy. Assisted-by: OpenAI Codex:gpt-5.6-sol Signed-off-by: flake92 <80347136+flake92@users.noreply.github.com>
Stop logging Bluetooth device names and hardware addresses; the adapter log now only reports its state and the number of paired devices. Only enumerate or select Bluetooth communication devices while the Bluetooth permission (BLUETOOTH_CONNECT on Android 12+) is granted, and fall back to another route otherwise. Guard the remote audio playout flag and the registration of new peer connection wrappers with one lock, so a wrapper created on the signaling thread cannot pick up a stale "playout enabled" value after the audio route was lost on the main thread. Assisted-by: Claude:claude-opus-5 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KPHB1yxj4sVtsGoQhtbfCy Signed-off-by: flake92 <80347136+flake92@users.noreply.github.com>
With speaker selected, the proximity sensor switched the route to the earpiece directly. On Android 12+ that switch triggers the communication device callback, which re-ran the route selection and switched straight back to the speaker because it did not know about the proximity state. Apply the proximity override inside the route selection so every route update keeps the earpiece while the phone is near the ear. Assisted-by: Claude Code:claude-opus-5 Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
mahibi
force-pushed
the
fix/bluetooth-call-routing
branch
from
September 24, 2026 14:26
fecedc6 to
ee36990
Compare
mahibi
marked this pull request as ready for review
September 24, 2026 14:27
Remote audio waited for Android to confirm the selected communication route without a limit. If a device never confirmed it, the call stayed silent. After 10 seconds, play remote audio on the current route instead. The audio manager's own Bluetooth fallback finishes before that. Also drop the Bluetooth device name from the legacy headset log and correct the comment on which Bluetooth permission the Android 12+ route needs. Assisted-by: Claude Code:claude-opus-5 Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Collaborator
Author
|
works fine for me. One lesson learned (again): Testing with older bluetooth devices is a pain. Many issues are caused by the devices theirself, without that there is a bug in the talk code. |
Collaborator
Author
|
@rapterjet2004 if you approve if can be merged from my point of view |
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 |
rapterjet2004
approved these changes
Sep 24, 2026
Collaborator
Author
|
Thank you @flake92 馃憤 馃憤 |
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.
continuing PR #6567 in Nextcloud repo. Kudos to @flake92
馃弫 Checklist
/backport to stable-xx.x馃 AI (if applicable)