Phone-to-Watch Config Sync
Relevant source files
The following files were used as context for generating this wiki page:
The Phone-to-Watch Config Sync is a specialized synchronization system within Ownkey Keyboard designed to bridge AI dictation settings between a primary Android phone and a Wear OS companion device. Its primary purpose is to ensure that the Wear OS IME can leverage the same ASR (Automated Speech Recognition) configuration—including API keys and custom endpoints—defined on the phone, providing a consistent "transcript-first" input experience on the watch.
Architecture and Data Flow
The synchronization architecture relies on the Google Play Services Wearable API to communicate across devices. The system is split into a "Push" component on the mobile application side and a "Listener" component on the Wear OS application side. Communication occurs over a specific path identified as /ownkey/voxtral-config.
Sources: app/src/main/kotlin/dev/patrickgold/florisboard/app/settings/voxtral/WearVoxtralSync.kt:15, wear/src/main/kotlin/nl/bartvandermeeren/ownkey/wear/VoxtralWearListenerService.kt
Synchronized Data Model
Configuration data is encapsulated in a serializable data class that includes authentication and connection details.
| Field | Type | Description |
|---|---|---|
apiKey | String | The BYOK API key used for Mistral or OpenAI-compatible services. |
endpointUrl | String | The transcription API URL (e.g., https://api.mistral.ai/v1/audio/transcriptions). |
model | String | The specific AI model identifier (e.g., voxtral-mini-latest). |
languageHint | String | Optional ISO language code to improve recognition accuracy. |
Sources: app/src/main/kotlin/dev/patrickgold/florisboard/app/settings/voxtral/WearVoxtralSync.kt:17-23, README.md
Communication Sequence
The synchronization flow is initiated by the user on the phone through the "Sync to Wear" action in the AI settings. The following diagram illustrates the lifecycle of a configuration update.
The process involves resolving connected nodes, iterating through them, and dispatching a byte-array payload.
Sources: app/src/main/kotlin/dev/patrickgold/florisboard/app/settings/voxtral/WearVoxtralSync.kt:25-72, wear/src/main/kotlin/nl/bartvandermeeren/ownkey/wear/VoxtralWearListenerService.kt
Mobile Implementation (app)
On the phone, synchronization is handled by the WearVoxtralSync singleton. It utilizes Json.encodeToString to prepare the WearVoxtralConfig for transport. The implementation is asynchronous, providing feedback via an onResult callback that returns the count of successful deliveries.
Key methods include:
pushConfig(context, config, onResult): The entry point for the sync process. It first checks for connected nodes viaNodeClient. If no nodes are found, it returns anIllegalStateException.
Sources: app/src/main/kotlin/dev/patrickgold/florisboard/app/settings/voxtral/WearVoxtralSync.kt:26-30, app/src/main/kotlin/dev/patrickgold/florisboard/app/settings/voxtral/WearVoxtralSync.kt:37-41
Wear OS Implementation (wear)
On the watch, a VoxtralWearListenerService (extending WearableListenerService) remains active to intercept messages on the synchronization path. Upon receiving a message, the service parses the JSON payload and updates the watch's local preferences. Consistent with Ownkey's privacy model, sensitive data such as API keys are handled securely.
Sources: wear/src/main/kotlin/nl/bartvandermeeren/ownkey/wear/VoxtralWearListenerService.kt, README.md, AGENTS.md
User Interface Elements
The synchronization feature is exposed to the user through specific labels and actions defined in the application's resources.
| String Resource ID | Text | Context |
|---|---|---|
pref__voxtral__sync_wear__action | Sync to Wear | Button in AI settings screen. |
settings__voxtral__title | AI | Category containing sync options. |
pref__voxtral__api_key__summary | Stored encrypted on this device... | Security context for synced keys. |
Sources: app/src/main/res/values/strings.xml:518, app/src/main/res/values/strings.xml:502, app/src/main/res/values/strings.xml:506
Summary
The Phone-to-Watch Config Sync is a critical utility for Ownkey Keyboard users who utilize the Wear OS companion IME. By synchronizing the Mistral/Voxtral ASR parameters—specifically the API key, endpoint, model, and language hint—the system removes the friction of manual configuration on small watch screens while ensuring that voice input remains functional and secure across the user's mobile ecosystem.