Repository navigation
Conversation
…ver for WearOS (microg#2843, microg#4) - Add BluetoothConnectionThread providing RFCOMM server listening and client connection - Add WearableBluetoothReceiver dynamically listening for ACL_CONNECTED and BOND_STATE_CHANGED - Integrate Bluetooth RFCOMM lifecycle into WearableImpl enableConnection/disableConnection - Add Bluetooth permissions to play-services-wearable core manifest
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.
Resolves #2843
Resolves #4
Summary
Implemented native Bluetooth RFCOMM transport and auto-connection for WearOS smartwatches in
play-services-wearable.As identified by @mar-v-in in #4:
This implementation builds upon the
StreamWearableConnectiontransport layer introduced in microg/Wearable#4 to connect paired WearOS devices over Bluetooth RFCOMM without requiring ADB emulator forwarding.Changes
BluetoothConnectionThread(play-services-wearable/core/src/main/java/org/microg/gms/wearable/BluetoothConnectionThread.java):listenUsingRfcommWithServiceRecord) targeting the standard Google Wearable service UUID (0000DA28-0000-1000-8000-00805F9B34FB) with SPP fallback (00001101-0000-1000-8000-00805F9B34FB).device.createRfcommSocketToServiceRecord) for connecting to paired smartwatches by MAC address.BluetoothSocketstreams intoStreamWearableConnection.WearableBluetoothReceiver(play-services-wearable/core/src/main/java/org/microg/gms/wearable/WearableBluetoothReceiver.java):BluetoothAdapter.ACTION_STATE_CHANGED: Discovers bonded smartwatches and starts connections when Bluetooth is enabled.BluetoothDevice.ACTION_ACL_CONNECTED: Auto-connects when a paired wearable connects to the Android system.BluetoothDevice.ACTION_BOND_STATE_CHANGED: Automatically createsConnectionConfigurationand establishes the connection upon successful bonding.BluetoothClass.Device.Major.WEARABLE(0x0700).WearableImplLifecycle Integration:enableConnection(String name)to start theBluetoothConnectionThreadfor smartwatch configs (connectionType == 0) and Bluetooth server listeners.disableConnectionandcloseConnectionwith NPE guards and clean thread lifecycle management.stopBluetooth()and receiver unregistration on service shutdown.Manifest Permissions:
BLUETOOTH,BLUETOOTH_ADMIN,BLUETOOTH_CONNECT, andBLUETOOTH_SCANpermissions toplay-services-wearable/core/src/main/AndroidManifest.xml.Payout Information (BountyHub / Bounty #2843)
0x20A0525b47f087f1Cc498cda257A0feB78D2320B