# Android Matrix Parity With Replaceable Terminal And Google Speech

## Summary
- Build Android into a first-class Matrix host with shared platform contracts, Android service controls, deep links, runtime health checks, and plugin parity surfaces.
- Keep Termux behind a replaceable Android terminal backend so the future in-house terminal can replace it without changing product or plugin logic.
- Use Android Google Speech for Matrix Whispr dictation by reusing the existing Whispr mobile Google Speech patterns.

## Key Changes
- Add platform-neutral Matrix bridge/service contracts in `flow/contracts` and use a shared web bridge facade instead of direct desktop bridge imports.
- Add an Android terminal backend abstraction and keep existing Termux command execution in a `TermuxTerminalBackend`.
- Extend Android WebView bridge capabilities for clipboard, port snapshots, service start/stop/open, section navigation, deep-link relay, and Whispr dictation events.
- Add Android Google Speech dictation using `SpeechRecognizer`, partial/final transcript events, foreground microphone service behavior, and provider id `google-speech`.
- Keep large upstream plugin sources out of the APK; expose real Android status/start/open behavior when backend capabilities exist and blocked-honest diagnostics otherwise.

## Public Interfaces
- `MatrixPortSnapshot.source` includes `"android"`.
- New shared Matrix platform bridge covers host metadata, clipboard, service controls, section navigation, Whispr events, and status queries.
- New Android terminal backend contract hides Termux details behind probe/setup/command/service operations.
- Shared speech provider ids include `"apple-speech"` for Mac and `"google-speech"` for Android.

## Verification
- Tests first for each new shared contract and Android behavior.
- Focused web/contract tests for bridge selection, port snapshots, plugin runtime panels, and Whispr transcript/status events.
- Android JVM/source tests for backend isolation, manifest permissions/queries, Google Speech service behavior, deep links, stale runtime blocking, and health validation.
- Final checks: `npm run check:boundaries`, `npm --prefix flow/web run typecheck`, `npm --prefix flow/web run build`, `npm run android:test`, `npm run android:build`, `npm run docs:check`.
- Physical QA evidence goes under `project-testing/project-test-zonegaze-matrix-android-parity-001`.

## Assumptions
- Android branding becomes ZoneGaze Matrix, while `com.zonegazeflow.app` remains for install compatibility.
- Termux is a temporary backend and must not leak into web/plugin/domain code.
- If Google recognition is unavailable, Android Whispr reports a clear unavailable state and does not default to Termux or a cloud API model.
