Skip to content

feat: implement configurable PTT button system#6

Open
romdj wants to merge 14 commits intomainfrom
feat/configurable-ptt-buttons
Open

feat: implement configurable PTT button system#6
romdj wants to merge 14 commits intomainfrom
feat/configurable-ptt-buttons

Conversation

@romdj
Copy link
Owner

@romdj romdj commented Jan 25, 2026

Summary

  • Multi-button PTT support: Volume buttons, play/pause, on-screen, and platform-specific options
  • Voice assistant prevention: Intercept long-press to block Google Assistant (Android) with documented iOS Siri limitation
  • Settings UI: Complete configuration interface for PTT mode, button selection, and screen wake lock
  • Platform updates: Android SDK 36, Kotlin 2.1, Gradle 8.9; iOS/macOS CocoaPods configuration

Changes

Core PTT Features

  • Add PTTButton enum and PTTConfiguration class for multi-button support
  • Implement dispatchKeyEvent() on Android to intercept buttons before system handlers
  • Add VolumeButtonObserver on iOS using KVO for volume button capture
  • Extend PTTService with configuration management and wakelock integration

UI

  • Add interactive on-screen PTT button with tap/hold gesture support
  • Create SettingsScreen with mode selector, button selector, and platform tips

Documentation

  • Add 9 documentation files covering implementation, testing phases, and troubleshooting

Test plan

  • Deploy to physical Android device
  • Test volume button PTT activation
  • Verify Google Assistant does NOT activate on long-press
  • Test on-screen button with tap and hold modes
  • Verify settings changes apply in real-time
  • Deploy to physical iOS device and verify volume/headset buttons

romdj added 14 commits January 25, 2026 15:31
- Upgrade compileSdk and targetSdkVersion from 34 to 36
- Update Kotlin stdlib and plugin to 2.1.0
- Update Android Gradle Plugin to 8.7.0
- Update Gradle wrapper to 8.9
- Add Pods xcconfig includes for iOS and macOS builds
- Register wakelock_plus and package_info_plus plugins for macOS
- Add Podfiles for iOS and macOS dependency management
Add PTTButton enum and PTTConfiguration class for multi-button support:
- Volume buttons (device volume down/up)
- Play/Pause button (Bluetooth/wired headsets)
- On-Screen button (universal fallback)
- System PTT (iOS 16+ only)

Add wakelock_plus dependency for screen wake lock during rides.
…tion

Add comprehensive button handling in MainActivity.kt:
- Volume button interception via onKeyDown/onKeyUp
- Play/pause button handling via dispatchKeyEvent
- Long-press detection to prevent Google Assistant activation
- Dynamic button routing based on configuration
- Screen wake lock support via FLAG_KEEP_SCREEN_ON
- Toggle and Hold mode support with debounce

Add MODIFY_AUDIO_SETTINGS permission for audio session control.
Add comprehensive button handling in AppDelegate.swift:
- VolumeButtonObserver class using KVO for volume button capture
- Automatic volume reset to prevent actual volume changes
- MPRemoteCommandCenter for headset button handling
- Screen wake lock via isIdleTimerDisabled
- Dynamic button configuration via platform channel

Note: iOS cannot prevent Siri activation on long-press (system restriction)
Extend PTTService with configuration capabilities:
- PTTConfiguration class for mode, button, and screen lock settings
- Dynamic native platform synchronization via method channel
- WakeLock integration with wakelock_plus package
- Auto-switch to toggle mode for play/pause button
- Real-time configuration updates without restart
Add interactive on-screen PTT button to HomeScreen:
- Tap/hold gesture support based on PTT mode
- Visual feedback with glow effects
- Current button configuration display
- Dynamic instruction text

Create SettingsScreen with complete configuration UI:
- PTT mode selector (toggle/hold)
- Button type selector with platform filtering
- Screen lock toggle switch
- Platform-specific tips and limitation warnings
Add comprehensive PTT documentation:
- PTT_IMPLEMENTATION_SUMMARY.md: Complete feature overview and architecture
- TESTING.md: Voice assistant prevention testing guide
- PHASE1_VOLUME_BUTTON_TESTING.md: Volume button validation
- PHASE2_ONSCREEN_BUTTON_TESTING.md: On-screen button validation
- PHASE3_SETTINGS_UI_TESTING.md: Settings UI validation
- VOICE_ASSISTANT_FIX.md: Voice assistant prevention details
- QUICK_START.md: Quick setup instructions
- WIRELESS_DEBUG_SETUP.md: Wireless debugging setup
- docs/bluetooth-ptt-implementation.md: Bluetooth integration details
- Update .nvmrc from v22 to v24
- Update README.md with PTT documentation links and known limitations
- Add .claude/settings.json for Claude Code configuration
- Add connect-android.sh for wireless ADB debugging workflow
Implement WebSocket-based signaling server for WebRTC peer coordination:
- Hub for managing rooms and client connections
- Client handling with read/write pumps
- Message types for offers, answers, ICE candidates, and PTT events
- Health check and stats endpoints
- Docker build support
Add Flutter services for P2P voice communication:
- SignalingClient: WebSocket client for room/peer management
- WebRTCService: Peer connection and audio stream handling
- Dependencies: flutter_webrtc, web_socket_channel, uuid
Add CallScreen for P2P voice calls:
- Shows connected peers and their talking status
- PTT button integration with WebRTC mute/unmute
- Connection status indicator
- Join room dialog from home screen
Add infrastructure for running services:
- docker-compose.yaml for local development
- k3s/signaling-deployment.yaml for Kubernetes
- Prepared placeholders for Redis, Postgres, Kafka (Phase 2)
Document the signaling service and WebRTC integration:
- Updated architecture diagram with services structure
- MVP status and test matrix
- Quick start for running signaling server
- WebSocket message reference
- Connection example code
- Next steps for testing
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.

1 participant