Skip to content

feat(android): add communication session focus and routing - #1314

Closed
maciejkucmierz-swm wants to merge 1 commit into
software-mansion:mainfrom
maciejkucmierz-swm:codex/pr2-communication-session
Closed

maciejkucmierz-swm wants to merge 1 commit into
software-mansion:mainfrom
maciejkucmierz-swm:codex/pr2-communication-session

Conversation

@maciejkucmierz-swm

@maciejkucmierz-swm maciejkucmierz-swm commented Sep 24, 2026 •

Copy link
Copy Markdown

Closes #

⚠️ Breaking changes ⚠️

  • None.

Introduced changes

Adds opt-in Android communication-session support through:

  • SessionOptions.androidMode: 'inCommunication'
  • SessionOptions.androidCommunicationDevice
  • AudioManager.setCommunicationDevice()
  • AudioManager.getCommunicationDevice()

Requires Android 12 / API 31 or later.

Scope

  • Requests transient voice-communication focus, enters MODE_IN_COMMUNICATION, registers route callbacks, and applies an initial device preference.
  • Keeps communication-session state on MediaSessionManager's main handler.
  • Suppresses communication-focus callbacks until activation completes and during teardown, while preserving ordinary RNAA focus behavior.
  • Registers route callbacks transactionally and restores routing, focus, and mode even if callback removal fails.
  • systemDefault clears RNAA's explicit device request; it does not mean no Android device is selected.
  • API 30 and below preserve normal behavior unless inCommunication is requested, in which case activation rejects cleanly.
  • Does not add InCallManager behavior, legacy speakerphone fallback, Java AEC/noise-suppression/AGC effects, or a guarantee of acoustic processing.

Validation

  • Pre-commit type, lint, and formatting checks pass.
  • Added JS mock coverage for the communication-device public contract.
  • Direct Android Gradle library build passed.
  • Physical API 30 and API 31+ validation remains required for focus denial/loss/gain, routing, accessories, callback suppression, and repeated activation/deactivation.

Checklist

  • Linked relevant issue — not applicable; no issue was provided.
  • Updated relevant documentation
  • Added/Conducted relevant tests
  • Performed self-review of the code
  • Updated Web Audio API coverage — not applicable; this is Android system-audio behavior.
  • Added support for web — not applicable; Android communication sessions are unavailable on web.
  • Updated old arch android spec file

@maciejkucmierz-swm
maciejkucmierz-swm marked this pull request as ready for review September 24, 2026 15:13
@closetcaiman closetcaiman added feature-request User-submitted proposals or requests for new features android Native Android implementation, C++/Java/Kotlin bindings, or Android-specific issues feature New user-facing features or major capabilities and removed feature-request User-submitted proposals or requests for new features labels Sep 24, 2026
@mdydek

mdydek commented Sep 29, 2026

Copy link
Copy Markdown
Member

closed by #1324

@mdydek mdydek closed this Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

android Native Android implementation, C++/Java/Kotlin bindings, or Android-specific issues feature New user-facing features or major capabilities

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants