- OAuth authentication via Authentik - WebSocket connection to OpenClaw gateway - Configurable gateway URL with first-run setup - User preferences sync across devices - Multi-user support with custom assistant names - ElevenLabs TTS integration (local + remote) - FCM push notifications for alarms - Voice input via Google Speech API - No hardcoded secrets or internal IPs in tracked files
3.6 KiB
3.6 KiB
Alfred Mobile v1.1.11 - Wake Word in Service
Release Date: 2026-02-08
Changes
Wake Word Detection Moved to Foreground Service
Problem: Wake word detector was stopping after a few seconds with "No speech detected - try again" error. It was managed by MainScreen and didn't survive screen-off or app backgrounding.
Solution: Moved wake word lifecycle management into AlfredConnectionService foreground service for continuous, uninterrupted listening.
Implementation Details
1. Updated GatewayListener Interface
- File:
app/src/main/java/com/openclaw/alfred/gateway/GatewayClient.kt - Change: Added
onWakeWordDetected()method to interface
2. Enhanced AlfredConnectionService
- File:
app/src/main/java/com/openclaw/alfred/service/AlfredConnectionService.kt - Changes:
- Added
wakeWordDetectorandwakeWordEnabledfields - Added
startWakeWord()method to initialize and start wake word detection - Added
stopWakeWord()method to stop detection - Updated notification text to show "Listening for wake word..." when active
- Added auto-restart on errors (except permission errors)
- Added proper cleanup in
onDestroy() - Forwarding
onWakeWordDetected()events to external listener
- Added
3. Updated MainScreen
- File:
app/src/main/java/com/openclaw/alfred/ui/screens/MainScreen.kt - Changes:
- Removed local
WakeWordDetectorinitialization fromLaunchedEffect(Unit) - Replaced
LaunchedEffect(wakeWordEnabled, wakeWordInitialized)with simplerLaunchedEffect(wakeWordEnabled, serviceBound)that delegates to service - Implemented
onWakeWordDetected()callback to handle wake word detection from service - Wake word now managed entirely by the service
- Removed local
4. Improved WakeWordDetector
- File:
app/src/main/java/com/openclaw/alfred/voice/WakeWordDetector.kt - Change: Enhanced logging in
onTimeout()to clarify continuous mode operation
Benefits
- Continuous Listening: Wake word detector runs continuously without timeouts
- Survives Background: Works even when app is backgrounded or screen is off
- Doze Mode Compatible: Foreground service survives Android Doze mode
- Auto-Recovery: Automatically restarts on errors (except permissions)
- Visual Feedback: Notification shows "Listening for wake word..." status
Testing Checklist
- Build successful (v1.1.11)
- Toggle wake word ON in Settings
- Verify notification changes to "Listening for wake word..."
- Test wake word detection works continuously
- Lock screen → wake word still works
- Background app → wake word still works
- Saying "alfred" triggers voice input
- After voice input completes, wake word resumes automatically
Deployment
- Tablet: Deployed via ADB to
adb-R52R30ASB4Y-BIkpas._adb-tls-connect._tcp - Phone APK: Copied to
/mnt/c/users/shado/alfred-mobile-v1.1.11.apk - Version Code: 13
- Version Name: 1.1.11
Files Modified
app/build.gradle.kts- Updated version to 1.1.11 (versionCode: 13)app/src/main/java/com/openclaw/alfred/gateway/GatewayClient.kt- AddedonWakeWordDetected()to interfaceapp/src/main/java/com/openclaw/alfred/service/AlfredConnectionService.kt- Added wake word managementapp/src/main/java/com/openclaw/alfred/ui/screens/MainScreen.kt- Delegated wake word to serviceapp/src/main/java/com/openclaw/alfred/voice/WakeWordDetector.kt- Improved logging
Next Steps
- Force stop app on tablet
- Restart app
- Go to Settings
- Enable wake word
- Verify continuous listening works as expected
- Test all scenarios in the checklist above