mirror of
https://github.com/AntennaPod/AntennaPod.git
synced 2026-08-18 11:05:49 +00:00
### Description Update play button on wearos instantly by pushing events from the phone to the watch. Also extend documentation around wearos communication ### Checklist <!-- To help us keep the issue tracker clean and work as efficient as possible, please make sure that you have done all of the following. You can tick the boxes below by placing an x inside the brackets like this: [x] --> - [x] I have read the contribution guidelines: https://github.com/AntennaPod/AntennaPod/blob/develop/CONTRIBUTING.md#submit-a-pull-request - [x] I have performed a self-review of my code, going through my changes line by line and carefully considering why this line change is necessary - [x] I have run the automated code checks using `./gradlew checkstyle lint` - [x] My code follows the style guidelines of the AntennaPod project: https://antennapod.org/contribute/develop/app/code-style - [x] I have mentioned the corresponding issue and the relevant keyword (e.g., "Closes: #xy") in the description (see https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) - [x] If it is a core feature, I have added automated tests
1.3 KiB
1.3 KiB
:net:sync:wear-interface
This module contains the shared data paths and serialization logic for communication between the phone app and the Wear OS companion app.
WearDataPaths defines message path constants; WearSerializer handles JSON encoding. Both :app and :app-wearos depend on this module.
Communication
Most requests are watch-initiated: the watch sends a message to a path (e.g. WearDataPaths.QUEUE), the phone responds with data on the same path.
Rarely, the phone proactively sends a message (playback state changes).
Both directions use Wearable.getMessageClient().sendMessage(nodeId, path, payload).
The actual communication is located in :app and :app-wearos, the :net:sync:wear-interface defines the common protocol.
Path constants (WearDataPaths)
NOW_PLAYING: current episode + playing state; pushed by phone on player status changes and returned on watch requestQUEUE,DOWNLOADS,EPISODES,SUBSCRIPTIONS: episode/feed listsPLAY_PREFIX + itemId: watch sends to start playback of an episode on the phonePAUSE: watch sends to pause playback on the phoneFEED_EPISODES_PREFIX + feedId: watch requests episodes for a specific feedOPEN_ON_PHONE_PREFIX + itemId: watch requests the phone to open an episode in the main app