Skip to content

fix(android): set the audio mode when manageAudioFocus is false - #1307

Open
S-Sebb wants to merge 1 commit into
livekit:mainfrom
S-Sebb:03-android-audio-mode-without-focus
Open

S-Sebb wants to merge 1 commit into
livekit:mainfrom
S-Sebb:03-android-audio-mode-without-focus

Conversation

@S-Sebb

@S-Sebb S-Sebb commented Nov 22, 2026

Copy link
Copy Markdown

Fixes #1306

LKAudioSwitchManager sets AudioManager.mode = audioMode after switch.activate() when manageAudioFocus is false, in start() and in the live reconfigure path. audioswitch only sets the mode while it takes focus. deactivate() still restores the mode saved at activate(). The AudioManager comes from getSystemService(Context.AUDIO_SERVICE), which works on API 21.

Apps that pass manageAudioFocus: false without an audioMode now get the default MODE_IN_COMMUNICATION; pass audioMode: AndroidAudioMode.normal to keep the old behaviour.

An alternative is to fix this in audioswitch, setting the mode in activate() whether or not focus is managed.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Devin Review: 2 flags

Not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)

Devin Review

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Android: with manageAudioFocus false, the audio mode is never set

1 participant