feat(wearable): implement NodeApi, DataApi, and MessageApi delegation to WearableServiceImpl - #3674
Open
johneapen80 wants to merge 1 commit into
Open
Conversation
…upport Wire NodeApiImpl, DataApiImpl, and MessageApiImpl to the existing WearableServiceImpl via GmsConnector, replacing previously stubbed methods that threw UnsupportedOperationException. NodeApiImpl: - getLocalNode / getConnectedNodes: delegate to WearableServiceImpl - addListener / removeListener: wrap NodeListener as IWearableListener DataApiImpl: - getDataItem / getDataItems / putDataItem / deleteDataItems / getFdForAsset: delegate to WearableServiceImpl - addListener / removeListener: wrap DataListener as IWearableListener MessageApiImpl: - addListener / removeListener: wrap MessageListener as IWearableListener (sendMessage was already implemented) Refs: microg#2843
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.
Summary
Implements the core Wearable API methods that were previously stubs throwing
UnsupportedOperationException, using the existing GmsConnector delegation pattern already established byMessageApiImpl.sendMessage().The
WearableServiceImpl(in the core module) already has fully working implementations of all these methods. This PR simply wires up the API layer to the existing backend.Changes
NodeApiImpl.java (was 44 lines → 192 lines)
getLocalNode()/getConnectedNodes(): delegate toWearableServiceImplviaGmsConnector.call()addListener()/removeListener(): wrapNodeListenerasIWearableListener.Stuband register with the wearable serviceGetConnectedNodesResultImpl,GetLocalNodeResultImpl,NodeListenerWrapperDataApiImpl.java (was 75 lines → 291 lines)
getDataItem()/getDataItems()/putDataItem()/deleteDataItems()/getFdForAsset(): all delegate toWearableServiceImplviaGmsConnector.call()addListener()/removeListener(): wrapDataListenerasIWearableListener.StubDataItemResultImpl,DeleteDataItemsResultImpl,GetFdForAssetResultImpl,DataListenerWrapperMessageApiImpl.java (was 73 lines → 131 lines)
addListener()/removeListener(): wrapMessageListenerasIWearableListener.Stub(completing the previously half-stubbed implementation)sendMessage()was already working — unchangedMessageListenerWrapperDesign
GmsConnector.call()+BaseWearableCallbackspattern as the existingsendMessage()implementationConcurrentHashMapfrom API-level listener →IWearableListenerfor properremoveListenercorrelationTesting
The delegate methods (
getLocalNode,getConnectedNodes,getDataItem,putData,deleteDataItems,getFdForAsset,sendMessage,addListener,removeListener) already exist and are implemented inWearableServiceImpl. This PR does not introduce new runtime dependencies or code paths — it only replacesthrow new UnsupportedOperationException()with proper delegation.Refs: #2843, #4