Voice: the listen between replies uses the call microphone on the speaker (bugfix, fixes #408) #465
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.48) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 516 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.374
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #465"
general
weight: 0.35
Giton22
What and why
On the phone's own speaker, a chained voice chat with talk-over on runs as call audio (#369, for the echo cancelling that #264 needed). But the listen between replies still opened a speech-recognition (
VOICE_RECOGNITION) stream. In the reporter's logcat, the speakerphone route handed that stream the back microphone (AUDIO_DEVICE_IN_BACK_MIC), which heard next to nothing, so the recording ran until the 12 s idle wait ended it. Only the stream after that, opened once the system had dropped call mode, landed on the bottom mic. That is the 8–12 s of "Listening" that ignores speech.AndroidVoiceRecorder.record()opens the same call microphone the reply is listened over with (VOICE_COMMUNICATION, echo cancelling and noise suppression), but only while call routing is held. Outside it (headphones, Bluetooth, talk-over off, dictation without a chat) it staysVOICE_RECOGNITIONwith noise suppression only, as before. The reporter's logs show the call microphone hears them on that phone, since cutting in over the reply works.ChatAudioRouteis a small shared hook (one Koinsingle).AndroidSpeechPlayersets it, and the recorder asks it before each listen.reroute()now notices this before each listen and each reply and takes call mode up again. If the speaker can no longer be the call device, it lets the routing go, so the app no longer believes it still holds call routing.I didn't add a preferred device (
setPreferredDeviceon the bottom mic). It could switch off Samsung's dual-mic call processing, and the plain call microphone already works for talk-over on the reporter's phone. If the call microphone still misses speech on some phone, pinning is the next step.Fixes #408
How I tested it
shared/ui/src/androidHostTest):-
AndroidVoiceRecorderTest.recordUsesTheCallMicrophoneOnlyWhileCallRoutingIsHeld-
AndroidChainedAudioTest.aModeTheSystemResetIsTakenUpAgainForTheNextListen-
AndroidChainedAudioTest.aResetRouteThatWontTakeAgainIsLetGo-
AndroidChainedAudioTest.noCallAudioWithoutCallRoutingThe first three fail with the source switch and the re-check taken out.
- Added in review, each failing without its fix:
AndroidChainedAudioTest.aPhoneCallsModeIsLeftAlone,AndroidChainedAudioTest.aRouteThatDidntTakeIsntTriedAgainEachTurn,AndroidVoiceRecorderTest.listenOverTakesCallModeUpAgainFirst:desktopApp:compileKotlinJvm: BUILD SUCCESSFUL.dumpsys audio): five listens in a row openedVOICE_COMMUNICATIONwithMODE_IN_COMMUNICATIONheld on the speaker, andMODE_NORMALcame back on leaving the chat.getInputForAttr/selectedDeviceIdfor each recorder. That is the check this needs before release.Checklist
master, and the command under "Tests" in CONTRIBUTING.md passes./gradlew :desktopApp:compileKotlinJvm)Reviewed with a feedback loop: 2 rounds with Gemini 4 Neon (
gemini-4-neon-high). Verdict: approved.