WearOS support: Bluetooth transport, notifications, and media controls (#2843) - #3798
Open
juliofarah wants to merge 1 commit into
Open
WearOS support: Bluetooth transport, notifications, and media controls (#2843)#3798juliofarah wants to merge 1 commit into
juliofarah wants to merge 1 commit into
Conversation
|
Can you please provide a video of you pairing a physical device (or at least an emulator) using this code? |
Author
Hey @TobiPeterG |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
UnsupportedOperationExceptionor immediateRESULT_CANCELEDfrom the Wear OS terms flow.What changed
Wear OS terms / pairing unblock
TermsOfServiceActivityto show an accept/decline dialog so companion apps (Galaxy Wearable, Wear OS) are not blocked by an immediate cancel result (Cant set up Galaxy Watch with Samsung wearable due to missing google TOS screen #2444).Client API implementation
NodeApi,DataApi, andMessageApifacades so they delegate toWearableServiceImplinstead of throwing.Bluetooth RFCOMM transport
BluetoothConnectionThreadusing 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
ConnectionConfigurationwith a Bluetooth MAC is enabled, microG starts a WearableBt client connection and ensures Flow/Flow15 listeners are running. The legacy TCP server on port5601remains for emulator use.Notification mirroring
WearableNotificationListenerServiceto forward posted/removed notifications to connected peers on/wearable/notification/{posted,removed}.Media controls
WearableMediaSessionBridgefor playback state on/wearable/media/stateand watch commands under/wearable/media/control/*(play, pause, toggle, next, previous, seek, rate).Testing
Unit tests cover:
Manual verification notes
Bounty context
Checklist