[stable-25.0.x] fix(call): restore call audio mode after audio focus interruptions - #6566
Merged
Merged
Conversation
The audio focus change listener in WebRtcAudioManager only logged changes. A transient focus holder such as the telephony stack switches the global audio mode and restores its own saved mode on release, clobbering MODE_IN_COMMUNICATION. After an incoming GSM call the Talk call therefore continued without hardware echo cancellation and proper VoIP routing: remote parties heard echo, quiet audio, or nothing until the call was restarted. - Re-assert MODE_IN_COMMUNICATION and the selected audio route when focus returns after a transient loss (new AudioFocusState tracks this) - Request focus with AUDIOFOCUS_GAIN via AudioFocusRequest (voice communication attributes, delayed gain accepted) instead of the deprecated AUDIOFOCUS_GAIN_TRANSIENT hint meant for short use - Abandon focus via abandonAudioFocusRequest on stop Fixes #6541 Assisted-by: opencode:ox-alpha Signed-off-by: Tarek Loubani <tarek@tarek.org>
AndyScherzinger
approved these changes
Aug 24, 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.
Backport of PR #6546