Skip to content

Music: add watch output device selection - #422

Open
TheFallen058 wants to merge 6 commits into
coredevices:masterfrom
TheFallen058:feature/music-output-device-selection
Open

TheFallen058 wants to merge 6 commits into
coredevices:masterfrom
TheFallen058:feature/music-output-device-selection

Conversation

@TheFallen058

@TheFallen058 TheFallen058 commented Sep 13, 2026 •

Copy link
Copy Markdown

Goal

Allow Pebble users to change the active Android media output from the watch, including the phone, Bluetooth devices, and Cast targets such as Google Nest.

This PR implements the Android side of the feature. It is intentionally paired with a PebbleOS PR because route discovery and transfer happen on the phone, while the watch provides the picker UI.

Companion PebbleOS PR: coredevices/PebbleOS#2056

Behavior

  • advertises music output-routing support on Android 15 and newer
  • requests media-routing special access only when a paired watch advertises compatible firmware support
  • discovers routes for the active media package with MediaRouter2, including screen-off scanning
  • returns a bounded, generation-tagged route snapshot to the watch
  • validates selections against the original package and generation to reject stale requests
  • waits for transfer success or failure callbacks and applies a timeout
  • cleans up activity-result and router callbacks safely

Compatibility

Older Android versions do not advertise the capability. Watches without the companion firmware capability do not trigger the new permission request. Existing music controls and iOS behavior remain unchanged.

The complete feature requires the companion PebbleOS PR. Either side independently gates unsupported peers through Pebble Protocol capabilities.

Validation

  • :androidApp:assembleDebug
  • testDebugUnitTest
  • testAndroidHostTest
  • jvmTest
  • lintDebug
  • manual route switching between phone, Bluetooth headphones, and Google Nest Mini using a Galaxy S25 and Pebble Time 2

All listed local checks passed.

AI disclosure

AI assistance was used for implementation and review. Usage is disclosed in the relevant commit trailers.

@CLAassistant

CLAassistant commented Sep 21, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

TheFallen058 and others added 4 commits September 29, 2026 15:59
Add Android media route discovery, permission handling, and protocol
support for selecting phone, Bluetooth, and Cast outputs from a Pebble.

Co-authored-by: GPT-5.6 Sol <noreply@openai.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Aliaksandr Karnilovich <thefallen058@gmail.com>
Keep route generations independent across players and wait for confirmed
transfers. Preserve valid snapshots so stale watch selections cannot target
new routes.

Co-authored-by: GPT-5.6 Sol <noreply@openai.com>
Signed-off-by: Aliaksandr Karnilovich <thefallen058@gmail.com>
Request special access only when Android and the paired watch support output
routing. Clean up activity result launchers and avoid Settings crashes.

Co-authored-by: GPT-5.6 Sol <noreply@openai.com>
Signed-off-by: Aliaksandr Karnilovich <thefallen058@gmail.com>
Use MediaRoute2Info deduplication IDs when combining output routes.

This keeps one entry for each physical receiver.

Co-authored-by: GPT-5.6 Sol <noreply@openai.com>

Signed-off-by: Aliaksandr Karnilovich <thefallen058@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@TheFallen058
TheFallen058 force-pushed the feature/music-output-device-selection branch from 2aacaef to b53d3fa Compare September 29, 2026 13:59
TheFallen058 and others added 2 commits October 4, 2026 21:16
…put-device-selection

Upstream now assigns protocol capability bit 25 to
SupportsUnknownTimelineAttributes, matching PebbleOS main. Move
SupportsMusicOutputRouting to bit 26 so the two flags no longer collide.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants