Conversation
…trols after call Telecom (callkeep) already manages audio focus for self-managed VoIP calls. AudioSwitch holding a concurrent permanent AUDIOFOCUS_GAIN kept Android in call audio mode after the call ended on older MIUI devices, causing volume buttons to control call volume instead of media volume. Disabling manageAudioFocus prevents AudioSwitch from requesting focus while leaving device routing (earpiece/speaker/bluetooth) intact. Fixes WT-1429
digiboridev
approved these changes
Apr 30, 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.
Summary
manageAudioFocus: false) so Telecom is the sole owner of Android audio focus during VoIP callsCallMediaManager._configure()— no flutter-webrtc changes neededRoot cause
Two independent audio focus clients competed for
AUDIOFOCUS_GAIN:AudioFocus_For_Phone_Ring_And_Calls) — always correctly abandoned focus on call endcom.cloudwebrtc.webrtc.audio.c) — requested permanentAUDIOFOCUS_GAINon call start but did not always release itWhen Telecom abandoned focus, Android dispatched
AUDIOFOCUS_GAINback to AudioSwitch, which held it permanently. Android keptMODE_IN_COMMUNICATIONactive, so volume buttons controlled call volume instead of media/ring volume. Only Force Stop (which triggersremoveFocusStackEntryOnDeath) restored normal behaviour.Setting
manageAudioFocus: falseprevents AudioSwitch from requesting focus at all. Telecom becomes the sole manager and reliably releases focus on every call end. Device routing (earpiece / speakerphone / bluetooth) andMODE_IN_COMMUNICATIONare unaffected — AudioSwitch still handles them regardless of the focus flag.Test plan