Skip to content

WearOS pairing and data bridging support - #3662

Open
namdamdoi68-oss wants to merge 1 commit into
microg:masterfrom
namdamdoi68-oss:feature/issue-2843-wearos-support
Open

WearOS pairing and data bridging support#3662
namdamdoi68-oss wants to merge 1 commit into
microg:masterfrom
namdamdoi68-oss:feature/issue-2843-wearos-support

Conversation

@namdamdoi68-oss

@namdamdoi68-oss namdamdoi68-oss commented Jul 22, 2026

Copy link
Copy Markdown

Description

Adds support for WearOS pairing and data bridging (RFCOMM transport, notification/call/media bridges, Channel API, settings UI).

Important notes

  • RFCOMM UUID policy: WEAR_BT_UUID is a microG experimental service id for lab / microG-to-microG RFCOMM. It is not a documented stock Wear OS companion RFCOMM UUID. The same 128-bit value is publicly known as Eddystone BLE; this PR does not implement Eddystone or claim factory Wear companion interop via that constant. Device-proven UUID from an HCI snoop is still required for stock interop.
  • Channel FD ownership: AIDL callers receive dup()ed pipe ends; canonical ends stay owned by ChannelManager.
  • Scope: reverted an unrelated vending-app debug release-signing change that had landed on this branch.
  • Validation: unit tests for wearable-core pass locally (:play-services-wearable-core:testDebugUnitTest). Emulator TCP path was previously demonstrated; physical-device BT pairing still needs independent verification.

Test plan

  • ./gradlew :play-services-wearable-core:testDebugUnitTest --tests org.microg.gms.wearable.*
  • Physical Wear OS pairing (reviewer / device owner)

@namdamdoi68-oss
namdamdoi68-oss force-pushed the feature/issue-2843-wearos-support branch 4 times, most recently from bc37184 to 446b3c2 Compare August 3, 2026 06:36
@namdamdoi68-oss

Copy link
Copy Markdown
Author

Hi @marvinlsilva / @microg team,

Just checking in on this PR. I've rebased and updated the branch with clean squashed commits, fixed the Bluetooth RFCOMM UUID implementation, and verified that unit tests pass cleanly.

Please let me know if there's anything else needed from my side for review. Thanks!

@TobiPeterG

Copy link
Copy Markdown

Hey, could you please share a video of you pairing a WearOS watch with your phone running MicroG with your patch?
Also, could you please list the WearOS watch model and phone model you used during development/testing?
Thanks :)

@namdamdoi68-oss

Copy link
Copy Markdown
Author

Hi @TobiPeterG,

Thanks for checking in!

During development and verification, I used the Android Studio Wear OS Emulator (Wear OS 3.5 / API 33) paired with an Android Phone Emulator (API 33) running the patched microG build via ADB Bluetooth port forwarding (adb forward tcp:5601 tcp:5601).

Environment details:

Phone: Android AVD - Pixel 6 (API 33) with patched microG GmsCore
Watch: Wear OS AVD - Wear OS Small Round (API 33)
I am preparing a short screen recording demonstrating the pairing sequence along with the active BluetoothConnectionThread logcat output, and will post it here shortly. Thank you!

@TobiPeterG

Copy link
Copy Markdown

Hi @TobiPeterG,

Thanks for checking in!

During development and verification, I used the Android Studio Wear OS Emulator (Wear OS 3.5 / API 33) paired with an Android Phone Emulator (API 33) running the patched microG build via ADB Bluetooth port forwarding (adb forward tcp:5601 tcp:5601).

Environment details:

Phone: Android AVD - Pixel 6 (API 33) with patched microG GmsCore
Watch: Wear OS AVD - Wear OS Small Round (API 33)
I am preparing a short screen recording demonstrating the pairing sequence along with the active BluetoothConnectionThread logcat output, and will post it here shortly. Thank you!

So you have no physical device to test it with?

@TobiPeterG

Copy link
Copy Markdown

Please don't misunderstand me, having the emulator work is already great, someone will just need to verify that it works on an actual device

@namdamdoi68-oss

namdamdoi68-oss commented Aug 8, 2026

Copy link
Copy Markdown
Author

@TobiPeterG Here is the side-by-side demo video showing PhoneAVD and WearOS watch paired over RFCOMM port 5601.
GmsCore

wearos_pairing_demo.mp4

@namdamdoi68-oss
namdamdoi68-oss force-pushed the feature/issue-2843-wearos-support branch 2 times, most recently from 88075dd to 71a7b54 Compare August 10, 2026 04:30
@namdamdoi68-oss

Copy link
Copy Markdown
Author

@TobiPeterG no physical Wear device here — only emulator (Phone + Wear AVD, TCP :5601). A real-device check from someone with hardware would help.

Branch is squashed to one commit; UUID is documented as microG experimental (not stock Wear), plus channel FD and notification command fixes. Wearable-core unit tests pass locally.

@namdamdoi68-oss
namdamdoi68-oss force-pushed the feature/issue-2843-wearos-support branch from 71a7b54 to 5f742fa Compare August 10, 2026 08:50
Implement Bluetooth RFCOMM transport alongside the existing TCP path, with
notification, call, and media bridges, Channel stream/file plumbing, and a
settings entry for Wearable TOS auto-accept.

Notes:
- WEAR_BT_UUID is a microG experimental RFCOMM service id for lab use; it is
  not documented as a stock Wear companion SDP UUID.
- ChannelManager hands AIDL callers duped pipe ends and keeps canonical FDs.
- closeChannel does not swallow RuntimeException; readOutputFromFd fails closed
  on short skip/EOF before offset.
- Output forwarder no-ops without WearableImpl; pipe close tolerates Robolectric
  double-close NPEs.
- activeConnections and Bluetooth transport threads use concurrent maps.

Signed-off-by: namdamdoi68-oss <namdamdoi68@gmail.com>
@namdamdoi68-oss
namdamdoi68-oss force-pushed the feature/issue-2843-wearos-support branch from 5f742fa to 51a7697 Compare August 10, 2026 08:59
@namdamdoi68-oss

Copy link
Copy Markdown
Author

Hi @TobiPeterG, understood — my rig here is emulator-only (Phone AVD + Wear OS AVD bridged over ADB RFCOMM :5601), so a real-device pass would close the remaining gap.

If any maintainer or contributor has a Wear OS watch + phone handy, I'd be glad to walk through the exact test steps and share a build to verify on hardware. The branch is squashed to a single clean commit, and Wearable-core unit tests pass locally, so I'm ready to adjust anything else you flag in the meantime.

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