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. |
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.