Skip to content

WearOS support: Bluetooth transport, notifications, and media controls (#2843) - #3798

Open
juliofarah wants to merge 1 commit into
microg:masterfrom
juliofarah:bounty/2843
Open

WearOS support: Bluetooth transport, notifications, and media controls (#2843)#3798
juliofarah wants to merge 1 commit into
microg:masterfrom
juliofarah:bounty/2843

Conversation

@juliofarah

Copy link
Copy Markdown

Fixes #2843

Summary

This adds foundational Wear OS phone-side support in microG so modern companion apps can pair and use basic watch functionality: notifications, media controls, and Data Layer messaging over Bluetooth.

Closes the long-standing gap discussed in #4 and #2444 by implementing client APIs, a Bluetooth RFCOMM transport, and bridge services instead of returning UnsupportedOperationException or immediate RESULT_CANCELED from the Wear OS terms flow.

What changed

Wear OS terms / pairing unblock

Client API implementation

  • Implemented NodeApi, DataApi, and MessageApi facades so they delegate to WearableServiceImpl instead of throwing.

Bluetooth RFCOMM transport

  • Added BluetoothConnectionThread using the length-prefixed protobuf wire format and UUIDs documented in teccheck/wearos-research:
    • 5e8945b0-9525-11e3-a5e2-0800200c9a66 — WearableBt (watch server; phone connects)
    • fafbdd20-83f0-4389-addf-917ac9dae5b2 — Flow (phone server)
    • 6a1eafb1-61c0-42a0-8bb0-a336fb1c3f00 — Flow15 (phone server)

When a ConnectionConfiguration with a Bluetooth MAC is enabled, microG starts a WearableBt client connection and ensures Flow/Flow15 listeners are running. The legacy TCP server on port 5601 remains for emulator use.

Notification mirroring

  • Added WearableNotificationListenerService to forward posted/removed notifications to connected peers on /wearable/notification/{posted,removed}.

Media controls

  • Added WearableMediaSessionBridge for playback state on /wearable/media/state and watch commands under /wearable/media/control/* (play, pause, toggle, next, previous, seek, rate).

Testing

./gradlew :play-services-wearable-core:testDebugUnitTest

Unit tests cover:

  • RFCOMM UUID selection (rejecting known-wrong values)
  • Notification payload encoding
  • Media control parsing
  • Bluetooth connection thread behavior

Manual verification notes

  • Enable the Wear OS notification bridge notification listener in system settings for notification mirroring and media-session access.
  • OEM companion pairing wizards (Galaxy Wearable / Wear OS by Google) may still need physical-device verification; stock watch UI can expect additional OEM-specific protocols beyond these Data Layer paths.

Bounty context

Checklist

  • Unit tests added/updated for new wearable bridge code
  • Verified on physical Wear OS device + companion app
  • CI green

@TobiPeterG

Copy link
Copy Markdown

Can you please provide a video of you pairing a physical device (or at least an emulator) using this code?

@juliofarah

Copy link
Copy Markdown
Author

Can you please provide a video of you pairing a physical device (or at least an emulator) using this code?

Hey @TobiPeterG
yes, I am working on it. I'm sorry for the delay on my end, I should be able to record a quick video tonight

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.

[BOUNTY] WearOS Support [$2340]

2 participants