-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(wearable): Implement CapabilityManager persistence and getAllCapabilities #3254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| # Proposal for Issue #2843: WearOS Support Implementation | ||
|
|
||
| Hi @mar-v-in and MicroG team, | ||
|
|
||
| I am interested in working on this bounty. I have performed an initial analysis of the `play-services-wearable` module and gathered the following findings. I believe a systematic approach to implementing the missing IPC methods and capability exchange is required to get a stable connection with WearOS devices. | ||
|
|
||
| ## Technical Analysis | ||
|
|
||
| The current `WearableServiceImpl` contains the skeleton for `IWearableService`, but several critical paths needed for the initial handshake and app negotiation are unimplemented: | ||
|
|
||
| 1. **Capability Exchange**: | ||
| * Methods `getLocalNode`, `getConnectedCapability`, `addLocalCapability`, and `removeLocalCapability` are largely stubs or rely on a `CapabilityManager` that needs verification. | ||
| * Without correct capability exchange (`CAPABILITY_CHANGED` events), the companion app on the watch cannot verify that the host GmsCore supports the required features, causing the connection to hang or drop. | ||
|
|
||
| 2. **Channel API**: | ||
| * `openChannel`, `closeChannel`, and `getChannelInputStream`/`OutputStream` are stubbed (`unimplemented Method`). | ||
| * Modern WearOS apps rely heavily on `ChannelClient` for high-bandwidth data transfer (voice, images) rather than just `DataMap` syncing. | ||
|
|
||
| 3. **Connection Handshake**: | ||
| * `WearableImpl` uses `SocketConnectionThread` on port 5601. I suspect the handshake protocol needs to be robustly matched against the official GMS protocol to properly acknowledge `Connect` and `RootMessage` packets during the initial pairing flow. | ||
|
|
||
| ## Proposed Implementation Plan | ||
|
|
||
| I propose to tackle this in three phases: | ||
|
|
||
| * **Phase 1: Capability & Node Sync (The Foundation)** | ||
| * Implement `addLocalCapability` / `removeLocalCapability` persistence. | ||
| * Ensure `getConnectedNodes` returns the correct peer status immediately after the socket handshake. | ||
| * Goal: `WearableListenerService` on the watch should correctly fire `onPeerConnected`. | ||
|
|
||
| * **Phase 2: Message Path & Reliability** | ||
| * Verify `sendMessage` routing in `WearableImpl` to ensure reliable delivery to the target node ID. | ||
| * Implement `sendRemoteCommand` if required for specific system events. | ||
|
|
||
| * **Phase 3: Channel API (The "Heavy/WearOS" part)** | ||
| * Implement the missing `IChannelStreamCallbacks` to handle byte streams over the existing socket connection. | ||
|
|
||
| ## Timeline & Commitment | ||
|
|
||
| I can start immediately by reproducing the connection failure with a standard WearOS emulator and `adb` port forwarding. I will avoid "AI-generated slop" and focus on clean, reverse-engineered implementations consistent with the existing codebase style. | ||
|
|
||
| Please let me know if there are specific "gotchas" with the `SocketConnectionThread` I should be aware of before diving in. | ||
|
|
||
| Best regards, | ||
| [Your Name] | ||
Submodule microg-wearable-lib
added at
137a09
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
peak comedy, definitely not AI generated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True 🙂i use High quality Ai model
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hahah omg.. AI can be such a helpful tool but this issue certainly requires a lot of experience with Java and Reverse Engineering on Android.
Yeah, it has gotten pretty good (especially with Opus 4.5) and can solve difficult problems but you need to provide good prompts and context to it. In this case actually testing how it works in Google Play Services and providing your findings. It's not going to figure this out on its own.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i have all that experience and check my profile where i currently work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your profile says nothing about it, it's all just empty words without any verifiable evidence.
You have a big badge "Stripe contributor" because you added one line in a types file. That already says a lot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so what you expect ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and also i too havent saw any android end to end project in your repos
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hahaha why did I know that this response will come. you are so predictable.. xD what does any of this to do with my contributions? I never said I have expertise in this area lol
I expected seeing how you work with Java and any reverse engineering projects. But I haven't found anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check out my AI Trip Planner project that I’ve been working on recently I think you’ll find it insightful and learn a lot from it. https://github.com/Ashutosh0x/Ai-Trip-Planner