[Ambient] Android foreground service for BT/WiFi scan collection #119

Closed
opened 2026-06-29 19:24:08 +00:00 by Mark · 4 comments
Owner

Parent: #108

Problem

BT and WiFi scanning for ambient matching requires scanning while the app is not in the foreground. Android restricts background scanning; a foreground service is the standard mechanism.

Scope

  • Add a Capacitor plugin (or extend existing one) that runs a foreground service with an ongoing notification
  • Service wakes every N minutes, scans BT + WiFi, persists records to the Dexie tables added in #108
  • Auto-stops when the master "Ambient" toggle is off

Realities

  • Android 12+ requires explicit user consent + a visible foreground-service notification that can't be dismissed while running
  • Battery impact must be tested; if it's heavy, drop the interval

Out of scope

  • iOS (no equivalent API)
  • Cell-tower / passive GPS triangulation
## Parent: #108 ## Problem BT and WiFi scanning for ambient matching requires scanning while the app is not in the foreground. Android restricts background scanning; a foreground service is the standard mechanism. ## Scope - Add a Capacitor plugin (or extend existing one) that runs a foreground service with an ongoing notification - Service wakes every N minutes, scans BT + WiFi, persists records to the Dexie tables added in #108 - Auto-stops when the master "Ambient" toggle is off ## Realities - Android 12+ requires explicit user consent + a visible foreground-service notification that can't be dismissed while running - Battery impact must be tested; if it's heavy, drop the interval ## Out of scope - iOS (no equivalent API) - Cell-tower / passive GPS triangulation
Author
Owner

Open design questions

  1. Foreground service notification copy: Proposed: "Kin is listening for nearby devices so it can suggest logging an interaction. Tap to open the app."
  2. Scan cadence: every 5 min, 15 min, or on-demand from a WorkManager periodic task? Proposed: WorkManager every 15 min.
  3. Battery budget: no explicit cap; if drain shows up in QA, drop cadence. Confirm OK?

Needs answers before dispatch.

## Open design questions 1. Foreground service notification copy: Proposed: "Kin is listening for nearby devices so it can suggest logging an interaction. Tap to open the app." 2. Scan cadence: every 5 min, 15 min, or on-demand from a WorkManager periodic task? Proposed: WorkManager every 15 min. 3. Battery budget: no explicit cap; if drain shows up in QA, drop cadence. Confirm OK? Needs answers before dispatch.
Author
Owner

Decomposed 2026-07-02 into 5 sub-issues. Parent stays as architectural record; needs-decompose removed since sub-issues now exist.

Decomposed 2026-07-02 into 5 sub-issues. Parent stays as architectural record; needs-decompose removed since sub-issues now exist.
Author
Owner

Auto-triage: needs decompose

Marked triage-approved + needs-decompose. decompose-executor will pick this up and break it into implementable sub-issues.

## Auto-triage: needs decompose Marked `triage-approved` + `needs-decompose`. decompose-executor will pick this up and break it into implementable sub-issues.
Author
Owner

Android foreground service parent — decomposed into #134 (S1), #135 (S2), #136 (S3), #137 (S4), #138 (S5). Closing parent; sub-issues tracked separately.

Android foreground service parent — decomposed into #134 (S1), #135 (S2), #136 (S3), #137 (S4), #138 (S5). Closing parent; sub-issues tracked separately.
Mark closed this issue 2026-07-03 14:45:37 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/kimi_agent_kin_app_sync#119
No description provided.