feat: wake word robustness — FG service, overlay launch, lifecycle refresh#19
Merged
Conversation
- Wake word detector now runs in a foreground Service (WakeWordService) with persistent notification and START_STICKY for OEM robustness. - Wake word detection launches the overlay via VoiceInteractionService .showSession() — the system-sanctioned background-launch path. - OverlayActivity hidden from Recents (excludeFromRecents + noHistory) so it no longer shows as a duplicate task entry. - Capability registry refreshes on app resume via AppLifecycleListener, so uninstalled OACP apps drop out of the registry without a restart. - POST_NOTIFICATIONS requested at init so the FG notification is visible on Android 13+.
- Add ic_notification vector drawable (Hark robot silhouette) so the notification small icon follows Android's monochrome-silhouette rule instead of rendering as a white blob from the colorful launcher PNG. - Add "Stop" action button on the wake word notification so users can release the mic without relaunching the app. - Return START_NOT_STICKY on explicit stop so Android doesn't auto-restart the service after the user chose to stop it.
0xharkirat
added a commit
that referenced
this pull request
Apr 12, 2026
- ROADMAP.md: full rewrite. Mark wake word foreground service + overlay launch + lifecycle refresh as shipped. Replace stale "self-hosted / BYOK / Gemma 4 / model loading" priorities with the current list (Settings, action chips, wake word polish, STT, release packaging). Move deferred items to a Deferred section with rationale. - README.md: refresh Wake Word section (FG service, overlay launch, Stop action) and the Roadmap bullets at the bottom. - AGENTS.md: update file map (WakeWordService in app module, WakeWordDetector in plugin module) and replace the "planned next phase" wake word note with the shipped architecture summary. - Add inline TODO comments for four review findings from PR #19 (VIS instance @volatile, always-call startForeground on re-start, order of POST_NOTIFICATIONS request, untested fallback Activity launch path).
This was referenced Apr 12, 2026
0xharkirat
added a commit
that referenced
this pull request
Apr 12, 2026
- ROADMAP.md: full rewrite. Mark wake word foreground service + overlay launch + lifecycle refresh as shipped. Replace stale "self-hosted / BYOK / Gemma 4 / model loading" priorities with the current list (Settings, action chips, wake word polish, STT, release packaging). Move deferred items to a Deferred section with rationale. - README.md: refresh Wake Word section (FG service, overlay launch, Stop action) and the Roadmap bullets at the bottom. - AGENTS.md: update file map (WakeWordService in app module, WakeWordDetector in plugin module) and replace the "planned next phase" wake word note with the shipped architecture summary. - Add inline TODO comments for four review findings from PR #19 (VIS instance @volatile, always-call startForeground on re-start, order of POST_NOTIFICATIONS request, untested fallback Activity launch path).
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
Four robustness improvements to the wake word feature that shipped in #18:
WakeWordServicenow owns theWakeWordDetectorwithFOREGROUND_SERVICE_TYPE_MICROPHONE, a persistent notification, andSTART_STICKY— hardens against OEM kill behavior and makes the "mic is on" state visible to the user.VoiceInteractionService.showSession()(the system-sanctioned background-launch path) so saying "Hey Hark" from any screen opens the assistant panel. Previously it only started the mic on the main engine with no UI.OverlayActivitygainsexcludeFromRecents+noHistoryso it no longer shows up as a duplicate task entry in Recents.AppLifecycleListenerinChatNotifierinvalidatescapabilityRegistryProviderand re-warms embeddings on app resume, so uninstalled OACP apps drop out of the registry without a restart.Also included:
POST_NOTIFICATIONSrequest on Android 13+ so the FG notification is visible.ic_notificationvector drawable (Hark robot silhouette) — required by Android for notification small icons.START_NOT_STICKYon explicit stop so Android doesn't auto-restart.Test plan
flutter analyzecleanadb shell dumpsys activity services | grep WakeWord→isForeground=true,types=microphoneadb logcat:WakeWordDetector → HarkApplication → HarkSession → OverlayActivity)onNewIntentrefreshes overlay sessionadb logcat | grep "app resumed, refreshing")