fix(happy-app): block voice session when microphone permission is denied#861
Open
kod4284 wants to merge 1 commit intoslopus:mainfrom
Open
fix(happy-app): block voice session when microphone permission is denied#861kod4284 wants to merge 1 commit intoslopus:mainfrom
kod4284 wants to merge 1 commit intoslopus:mainfrom
Conversation
On Android, denying the microphone permission popup still allowed the
ElevenLabs session to connect and play the TTS greeting ("hello I am
Happy") because speaker output doesn't require RECORD_AUDIO permission.
The existing permission check in startRealtimeSession() should prevent
this, but edge cases (stale cached permission state, SDK race conditions)
could let it through. Adding a secondary permission verification in
RealtimeVoiceSessionImpl.startSession() right before the ElevenLabs
SDK call ensures the session is never started without confirmed
microphone access.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
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.
Fixes #860
Summary
checkMicrophonePermission()verification inRealtimeVoiceSessionImpl.startSession()right before the ElevenLabs SDK calldisconnectedContext
The ElevenLabs SDK sends a TTS greeting from the server immediately upon WebSocket connection. Speaker output works regardless of
RECORD_AUDIOpermission, so in edge cases where the existing permission check instartRealtimeSession()is bypassed, the greeting plays even when the user denied microphone access.Test plan