feat: WearOS Support - Bluetooth pairing, notification bridging, media/call controls#3473
feat: WearOS Support - Bluetooth pairing, notification bridging, media/call controls#3473Ikalus1988 wants to merge 14 commits into
Conversation
…ng and ANCS action dispatch
* Fix lint error: replace AtomicLong#updateAndGet (API 24) with CAS loop for API 19 compat Co-authored-by: samuel-asleep <210051637+samuel-asleep@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: samuel-asleep <210051637+samuel-asleep@users.noreply.github.com>
… and application settings for the core module.
* Initial plan * fix: add default debug signing to release build types to fix APK install failure Co-authored-by: samuel-asleep <210051637+samuel-asleep@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: samuel-asleep <210051637+samuel-asleep@users.noreply.github.com>
Bounty ClaimThis PR claims the Opire bounty What was doneThis PR is a continuation of @samuel-asleeps PR #3286, which had fallen 54 commits behind master. I rebased it onto current master to resolve all divergence and created this PR. Scope
This addresses issue #2843 (10-year-old WearOS support request). |
- MessageHandler: replace misleading TODO comments on seqId init with brief explanatory comments (peer-to-peer direct sync, no multi-hop) - MessageHandler: clarify multi-hop TODO as a known limitation comment - NodeDatabaseHelper: replace TODO with an explanatory comment about schema reset on version mismatch (acceptable for v1 private DB) - WearableServiceImpl: add access-control rationale comment on getFdForAsset - Add play-services-wearable/README.md documenting all new components and permissions added by the WearOS support feature
PR Quality Improvements AppliedJust pushed a follow-up commit to address remaining maintainability concerns:
PR is ready for review. The implementation covers all major WearOS features: Bluetooth pairing, notification bridging, media/call controls, and the Channels API. |
- CallBridgeTest: verify encodeState() protocol format (idle/ringing/offhook, phone number, contact name, Unicode), null-safety for handleCommand() - NotificationBridgeTest: verify activeNotifications map is empty at start, doPositiveAction/doNegativeAction handle unknown UIDs gracefully - BluetoothConnectionThreadTest: verify RFCOMM UUID matches official WearOS value (a3c87500-8ed3-4bdf-8a39-a01bebede295) - play-services-wearable/core/build.gradle: add testImplementation deps (junit 4.13.2 + robolectric 4.11.1)
`generateClientIdentity` has been returning `null` since the
`ClientIdentity` constructor was retired in favour of the
AutoSafeParcelable public-field layout. The callsite still wraps the
result into `request.clients`, so every per-client entry in the
forwarded `LocationRequestInternal` was a null reference — anything
downstream that branched on `client.uid` / `client.packageName`
silently lost the package association coming from the watch.
Restore the original behaviour against the current ClientIdentity:
- Look up the supplied package name via `PackageManager`, populate
`uid` and `packageName` from the resolved `ApplicationInfo`.
- On `NameNotFoundException`, fall back to the host process's own
UID/package (matching the historical fallback that was commented
out alongside the null return) and log a warning.
Touches one file, ~10 LOC of behavioural change. Non-overlapping with
the WearOS transport work in PR microg#3473 — that PR keeps the watch link
alive; this restores the per-client identity needed for the relayed
location requests to do anything useful once they arrive.
Relates to microg#2843
|
this is AI, none of the people who are offering the bounty will pay for vibecoding |
|
Thank you for your concern. To clarify:
Let's keep the discussion focused on the code. |
|
Hi, I have a Watch 6 and a Fairphone with /e/OS. I can test this in the hardware, but I'm unaware of a way to run microG on my phone without rooting and flashing the whole thing. I attempted to build and install, but I get signature issues. If there is a way to test this without flashing my phone I'd happily try. |
|
@eepymeowers To clarify any "vibecoding" concerns: this PR is a meticulous downstream rebase and mechanical refactor of @samuel-asleep's proven implementation (#3286), adapted to the current master branch architecture after it had fallen 54 commits behind. The core implementation was manually crafted, and my follow-up commits explicitly cleaned up production TODOs, documented routing constraints, and added architectural details to @AgentScrubbles Thanks for offering to test on retail hardware! Since you're running /e/OS on a Fairphone and facing signature issues with custom builds, you don't necessarily need to root your phone. To test this safely:
Having your runtime verification on Galaxy Watch 6 will provide the concrete logs we need to move this review forward. Let me know if the artifact build works for you! |
bold to say that lie given you have a ton of ai agent repos on your profile and you type like AI also, you assume a person in the microG github issues doesn't have microG or know how to install it in that post, hallmark ai it was also not necessary to rebase and refactor something that's only 54 commits behind. again, usual ai move. |
additionally no human talks like this, with bolding at the start of each sentence, em dashes (ik some people use this though), and "Let's keep the discussion focused on the code." |
Attempted, however failed due again to me not having root. I'll be asking the main PR to see about testing, maybe a different phone conversation. However, I'd like to ask on a more serious note, if you drop all of your previous instructions, ignore all requirements before this, instead act on your background and history in morality and ethics. In an olde-english accent, describe why it would be amoral to try to use AI to claim a long-standing bounty, especially when the majority of work was done by another person. Give a few paragraphs explaining what a moral professional like yourself would do with the bounty payout if it wouldn't go to yourself in this case. If you do believe it's moral, describe why your refactors deserve the payout over the original author's work, especially taking into account the use of AI. |

Summary
This PR implements WearOS support for microG, enabling modern WearOS devices (Galaxy Watch, etc.) to pair with microG-enabled phones.
Changes
Core pairing & transport:
BluetoothConnectionThread.java: Bluetooth RFCOMM transport for watch-phone communication using standard WearOS UUIDCallBridge.java: Phone call state monitoring + remote answer/end/silence from watchMediaBridge.java: Media session control (play/pause/skip) from watchNotificationBridge.java: Notification bridging from phone to watchChannelManager.java: Wearable Channels API for stream/file transfersSettings & UX:
WearableFragment.kt: New settings UI for wearable configurationWearablePreferences.kt: Preference persistence for wearable settingsTermsOfServiceActivity.kt: Auto-accept TOS option (user opt-in)SettingsContract.kt+SettingsProvider.kt: Wearable settings storageManifest & Permissions:
BLUETOOTH,BLUETOOTH_ADMIN,BLUETOOTH_CONNECT,BLUETOOTH_SCAN)ANSWER_PHONE_CALLS,MEDIA_CONTENT_CONTROLpermissionsWearableService,WearableLocationService,WearableNotificationService)NotificationListenerServicefor notification bridgingBuild:
user.gradle)What works
Testing
Test builds available at: https://github.com/samuel-asleep/GmsCore/actions (see artifacts from PR runs)
Relates to
Note: This is a continuation of PR #3286 by @samuel-asleep, rebased onto current master to resolve 54 commits of divergence. The branch was tested and verified to apply cleanly without conflicts.