Use nonblocking AudioRecord reads with data and timestamp deadlines. Serialize idempotent close, finish interrupted joins before release, isolate callback failures, and abort stereo fallback when partial-record cleanup fails.
Close failed shared readers to new subscriptions, roll back worker startup, isolate observers, preserve interrupt state, and release the last consumer exactly once. Add an independent capture-tests JVM module to the standard Android unit-test task.
Validation: 38 capture scenarios (25 AudioRecord plus 13 PCM/PTT), 455 JVM tests, assembleDebug, core build, and full check.sh (225 tests plus proxy/burst/load) passed.
Retry monitor and capture setup after invalidating failed attempts. Bind output leases and callbacks to registration identity, cancel confirmation timers, and keep hardware cleanup independent from device enumeration during call handoff.
Commit profiles only after successful storage writes, acquire mode ownership before Android side effects, and reject blocking operations on main or the control worker. Keep the app singleton backed by an isolated MediaAudioSession with a single executor.
Validation: 30 media session scenarios, 420 JVM tests, assembleDebug, core build, and full check.sh (225 tests plus proxy/burst/load) passed.
Roll back failed startup, finish independent stop cleanup, invalidate stale device and Telecom callbacks, and serialize router mutations. Publish input/output targets after accepted selection and support retries of rejected requests.
Separate modern communication device selection from legacy SCO, refresh replaced descriptors, and support A2DP and USB input-only devices in per-track mode. Clarify routing and observer ownership contracts.
Validation: 45 router scenarios, 390 JVM tests, assembleDebug, core build, and full check.sh (225 tests plus proxy/burst/load) passed. Previous router fails 25 of the 30 new cases.
Bind notification tokens to full call IDs and call kinds, cancel actions on stop, and reject decline callbacks after ringing ends. Serialize alert state on main and recover notification channel setup after Android API failures.
Keep sound independent of wake-lock and notification failures. Remove orphaned notifications on cold start, preserve idempotent alerts during duplicate delivery and language changes, and document lifecycle contracts.
Validation: 32 new lifecycle cases, 360 JVM tests, assembleDebug, core build, and full check.sh (225 tests plus proxy/burst/load) passed.
Configure audio attributes before MediaPlayer preparation, keep vibration independent from sound failures, and guard loop/focus cleanup against stale callbacks. Preserve ringback players on repeated phase requests.
Add 35 alert lifecycle tests against real Kotlin sources with controlled Android API failures. Validation: 328 JVM tests, assembleDebug, core build, and full check.sh (225 tests plus proxy/burst/load) passed. Previous sources fail 32 of the 35 new cases.