FireOSTranscriptionProvider has no real FireOS implementation — just wraps Android provider and catches SecurityException #4

Closed
opened 2026-05-13 05:38:08 +00:00 by Mark · 1 comment
Owner

Problem

FireOSTranscriptionProvider (lines 154-201 in TranscriptionProvider.kt) is a thin wrapper that delegates entirely to AndroidTranscriptionProvider. The only FireOS-specific logic is catching the SecurityException from AlexaVoiceInteractionService. There is no actual FireOS speech path.

Per dumpsys on FireOS, the system has amazon.speech.sim/com.amazon.alexa.multimodal.assistant.AlexaVoiceInteractionService which is a VoiceInteractionService requiring BIND_VOICE_INTERACTION (a signature-level permission that third-party apps cannot obtain). So the existing approach of wrapping Android's SpeechRecognizer will never work on FireOS tablets.

Root Cause

FireOS's voice interaction system is locked to system apps via signature permissions. There is no public STT API on FireOS equivalent to Android's SpeechRecognizer that third-party apps can call.

Revised Implementation Spec

Approach: MediaRecorder + Cloud Fallback

Since FireOS tablets always have internet, the simplest & most reliable approach is to bypass device-level STT entirely and route through the cloud backend.

What to Build

1. FireOSTranscriptionProvider Rewrite
Replace the current Android-transcription wrapper with a dedicated implementation that:

  • Uses MediaRecorder directly (Android's standard audio capture)
  • Records to a temp file during the recording session
  • On stop: passes the audio file to CloudTranscriptionProvider for transcription
  • No SpeechRecognizer, no Alexa SDK, no Amazon-specific APIs
FireOSTranscriptionProvider.recognize(audioFile)
  ↓
MediaRecorderCapture(audioFile)  ← handles the recording lifecycle
  ↓
CloudTranscriptionProvider.transcribe(audioFile)  ← reuses existing cloud code
  ↓
return result

2. Files Changed

File Action
app/.../service/TranscriptionProvider.kt MODIFY — rewrite FireOSTranscriptionProvider (lines 154-201)
app/.../service/CloudTranscriptionProvider.kt MODIFY — expose a transcribe(audioFile) method callable by FireOS provider (currently it reads from its own recording pipeline)

3. Why Not Other Approaches

  • Alexa Voice SDK: Requires Amazon developer account, AVS API access, OAuth flow — adds a full SDK dependency and account requirement for end users, overkill for transcription-only use
  • Local on-device model: Covered by LOCAL_WHISPER (#2) when/if implemented — not FireOS-specific
  • MediaRecorder + Cloud: Zero new dependencies, reuses existing cloud infrastructure, works on any FireOS version

Edge Cases

  • No internet → return error with "requires network" message
  • Recording permission denied → present rationale dialog
  • Multiple rapid recordings → queue with max 2 concurrent
## Problem `FireOSTranscriptionProvider` (lines 154-201 in TranscriptionProvider.kt) is a thin wrapper that delegates entirely to `AndroidTranscriptionProvider`. The only FireOS-specific logic is catching the `SecurityException` from `AlexaVoiceInteractionService`. There is no actual FireOS speech path. Per `dumpsys` on FireOS, the system has `amazon.speech.sim/com.amazon.alexa.multimodal.assistant.AlexaVoiceInteractionService` which is a `VoiceInteractionService` requiring `BIND_VOICE_INTERACTION` (a signature-level permission that third-party apps cannot obtain). So the existing approach of wrapping Android's `SpeechRecognizer` will **never** work on FireOS tablets. ## Root Cause FireOS's voice interaction system is locked to system apps via signature permissions. There is no public STT API on FireOS equivalent to Android's `SpeechRecognizer` that third-party apps can call. ## Revised Implementation Spec ### Approach: MediaRecorder + Cloud Fallback Since FireOS tablets always have internet, the simplest & most reliable approach is to bypass device-level STT entirely and route through the cloud backend. ### What to Build **1. FireOSTranscriptionProvider Rewrite** Replace the current Android-transcription wrapper with a dedicated implementation that: - Uses `MediaRecorder` directly (Android's standard audio capture) - Records to a temp file during the recording session - On stop: passes the audio file to `CloudTranscriptionProvider` for transcription - No SpeechRecognizer, no Alexa SDK, no Amazon-specific APIs ``` FireOSTranscriptionProvider.recognize(audioFile) ↓ MediaRecorderCapture(audioFile) ← handles the recording lifecycle ↓ CloudTranscriptionProvider.transcribe(audioFile) ← reuses existing cloud code ↓ return result ``` **2. Files Changed** | File | Action | |------|--------| | `app/.../service/TranscriptionProvider.kt` | **MODIFY** — rewrite FireOSTranscriptionProvider (lines 154-201) | | `app/.../service/CloudTranscriptionProvider.kt` | **MODIFY** — expose a `transcribe(audioFile)` method callable by FireOS provider (currently it reads from its own recording pipeline) | **3. Why Not Other Approaches** - **Alexa Voice SDK**: Requires Amazon developer account, AVS API access, OAuth flow — adds a full SDK dependency and account requirement for end users, overkill for transcription-only use - **Local on-device model**: Covered by LOCAL_WHISPER (#2) when/if implemented — not FireOS-specific - **MediaRecorder + Cloud**: Zero new dependencies, reuses existing cloud infrastructure, works on any FireOS version ### Edge Cases - No internet → return error with "requires network" message - Recording permission denied → present rationale dialog - Multiple rapid recordings → queue with max 2 concurrent
Author
Owner

Fixed in commit. Closing.

Fixed in commit. Closing.
Mark closed this issue 2026-05-14 03:19:09 +00:00
Sign in to join this conversation.
No description provided.