Skip to content

feat: Add Wear OS support — Bluetooth transport, notification mirroring, and media control#3535

Open
kouyouqi123 wants to merge 6 commits into
microg:masterfrom
kouyouqi123:wearos-support-2843
Open

feat: Add Wear OS support — Bluetooth transport, notification mirroring, and media control#3535
kouyouqi123 wants to merge 6 commits into
microg:masterfrom
kouyouqi123:wearos-support-2843

Conversation

@kouyouqi123
Copy link
Copy Markdown

Fixes #2843

This PR adds comprehensive Wear OS support to microG, enabling smartwatch connectivity without Google Play Services.

1. Bluetooth RFCOMM Transport Layer

  • BluetoothWearableConnection.java - bidirectional data streaming over BluetoothSocket
  • BluetoothConnectionServer.java - listens for Wear OS connections via SPP UUID
  • Integration in WearableImpl.java - lifecycle management

2. Notification Mirroring

  • WearableNotificationListenerService.java - captures phone notifications and forwards to watch via data layer
  • Supports title, text, category, priority, and action buttons

3. Media Control Bridge

  • WearableMediaSessionBridge.java - monitors active MediaSessions, pushes metadata/state to watch
  • Handles control commands from watch: play, pause, next, previous, seek, rate
  • Auto-started by WearableService

Commands from watch:

/wearable/media/control/play | /wearable/media/control/pause | /wearable/media/control/toggle
/wearable/media/control/next | /wearable/media/control/previous
/wearable/media/control/seek (8-byte big-endian position in ms)
/wearable/media/control/rate (4-byte float speed)

State data:

/wearable/media/state - contains title, artist, album, duration, isPlaying, position, albumArt, etc.

…ng, and media control

Fixes microg#2843

Adds comprehensive Wear OS support to microG:
- Bluetooth RFCOMM transport (BluetoothConnectionServer + BluetoothWearableConnection)
- Notification mirroring to watch (WearableNotificationListenerService)
- Media control bridge (WearableMediaSessionBridge) - see what's playing
  on the phone and control it from the watch (play/pause/next/skip/seek)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BOUNTY] WearOS Support [$1340]

1 participant