Grant Microphone Permission on First Use
When a peer mentor first taps the microphone icon, the Voice Recording Control checks current permission status via permission_handler. If permission has not been granted, it displays a pre-permission rationale dialog explaining that the microphone is used only for post-visit note dictation and that no audio is stored or transmitted. After the explanation, the system permission dialog is presented. If the mentor denies permission, the microphone icon is disabled with an accessible message explaining how to re-enable it in device settings. Subsequent uses skip the rationale and proceed directly to recording if permission is already granted.
User Story
Acceptance Criteria
- Given the peer mentor has never used speech input, when they tap the microphone icon for the first time, then a rationale dialog appears before the system permission prompt explaining the dictation-only use case
- Given the rationale dialog is shown, when the peer mentor dismisses it and the system prompt appears, then they can grant or deny microphone access
- Given the peer mentor grants microphone permission, when they tap the mic icon on the same or future sessions, then recording begins immediately without repeating the permission flow
- Given the peer mentor denies microphone permission, when they attempt to use speech input, then an accessible error message is shown with a link to device Settings to enable the permission manually
- Given permission is granted, when the app is restarted, then permission status is retained and the feature remains available
Business Value
Permission handling is a prerequisite for all speech input functionality. A clear, non-alarming permission rationale is especially important for an app used by peer mentors who work with sensitive health information — users must trust that enabling the microphone does not record private conversations. Proper handling also prevents the feature being permanently blocked by a reflexive denial.
Components
- Voice Recording Control ui
- Speech API Gateway infrastructure