[BW-AUTOMATION-01] Add headset-triggered Continue automation #25

Open
opened 2026-09-18 08:46:44 +02:00 by alexander · 0 comments
Owner

Migrated from GitHub issue #116. Forgejo issue: #25. GitHub source content synchronized on 2026-09-19. Migrated issue references below use Forgejo numbers where an equivalent issue exists; historical references without a Forgejo counterpart remain explicit GitHub links.

Classification

Planned Android automation feature. Blocked on #23 and #24.

Product intent

Allow a user-defined rule such as: when this headset connects, continue the audiobook this phone last played.

This should be a native BookWave automation built on the same semantic action contract exposed to Android, not a second playback implementation.

Scope

  • Add an opt-in automation rule triggered by connection of a selected audio device/headset.
  • Let the user choose one or more remembered devices where practical.
  • On a qualifying connection, dispatch ContinueListening through #23.
  • Use #24 for which book this phone remembers and GitHub #93 for resume position.
  • Respect active calls/audio focus and avoid stealing playback from an already-active non-BookWave media session where Android provides reliable evidence.
  • Add a short configurable/settled debounce so reconnect flapping does not repeatedly start playback.
  • Provide enable/disable and clear explanation of what the rule does.

Explicitly out of scope

  • No generic visual scripting engine.
  • No auto-play for every Bluetooth connection by default.
  • No car-specific behavior; Android Auto routing remains owned by GitHub #78 and follow-ups.
  • No inference that every classic A2DP device is a headset when device semantics are ambiguous.

Dependencies

  • #23 BW-SYS-01 semantic Android action/automation contract.
  • #24 BW-PLAY-01 local remembered audiobook identity.
  • GitHub PR #93 unified resume freshness.

Storage

Persist user automation settings and selected device identities using stable Android identifiers only where the platform actually provides them. If identity is unreliable on an Android version/device class, prefer a broader explicit rule such as 'any headset' over pretending certainty.

Privacy / security

No book metadata in Bluetooth rule storage. A locked profile must obey the same playback/metadata policy as invoking Continue manually.

Automated tests

  • selected headset connect -> exactly one Continue action;
  • unrelated device -> no action;
  • disabled rule -> no action;
  • reconnect flapping -> one action;
  • profile switch uses that profile's remembered book;
  • no remembered book -> no surprise playback;
  • call/audio-focus conflict follows the selected safe policy.

Device acceptance

Test wired headset where supported, Bluetooth headset, reconnect after process death, screen off, profile switch, and a car/A2DP device to confirm the rule does not accidentally broaden into car behavior.

Effort

Medium.

Risk

Medium. Auto-play is useful but can be obnoxious if device matching or audio-focus policy is loose.

Acceptance criteria

  • The rule is opt-in.
  • It invokes the common Continue action rather than direct player code.
  • It cannot select a book from remote recency.
  • Reconnects do not cause repeated playback starts.
  • Device/profile ambiguity fails safely.
> Migrated from [GitHub issue #116](https://github.com/AlexanderWilhelmsenBerg/Audiobookshelf-Manager-Claude/issues/116). Forgejo issue: #25. GitHub source content synchronized on 2026-09-19. Migrated issue references below use Forgejo numbers where an equivalent issue exists; historical references without a Forgejo counterpart remain explicit GitHub links. ## Classification Planned Android automation feature. Blocked on #23 and #24. ## Product intent Allow a user-defined rule such as: **when this headset connects, continue the audiobook this phone last played**. This should be a native BookWave automation built on the same semantic action contract exposed to Android, not a second playback implementation. ## Scope - Add an opt-in automation rule triggered by connection of a selected audio device/headset. - Let the user choose one or more remembered devices where practical. - On a qualifying connection, dispatch `ContinueListening` through #23. - Use #24 for which book this phone remembers and [GitHub #93](https://github.com/AlexanderWilhelmsenBerg/Audiobookshelf-Manager-Claude/issues/93) for resume position. - Respect active calls/audio focus and avoid stealing playback from an already-active non-BookWave media session where Android provides reliable evidence. - Add a short configurable/settled debounce so reconnect flapping does not repeatedly start playback. - Provide enable/disable and clear explanation of what the rule does. ## Explicitly out of scope - No generic visual scripting engine. - No auto-play for every Bluetooth connection by default. - No car-specific behavior; Android Auto routing remains owned by [GitHub #78](https://github.com/AlexanderWilhelmsenBerg/Audiobookshelf-Manager-Claude/issues/78) and follow-ups. - No inference that every classic A2DP device is a headset when device semantics are ambiguous. ## Dependencies - #23 BW-SYS-01 semantic Android action/automation contract. - #24 BW-PLAY-01 local remembered audiobook identity. - [GitHub PR #93](https://github.com/AlexanderWilhelmsenBerg/Audiobookshelf-Manager-Claude/pull/93) unified resume freshness. ## Storage Persist user automation settings and selected device identities using stable Android identifiers only where the platform actually provides them. If identity is unreliable on an Android version/device class, prefer a broader explicit rule such as 'any headset' over pretending certainty. ## Privacy / security No book metadata in Bluetooth rule storage. A locked profile must obey the same playback/metadata policy as invoking Continue manually. ## Automated tests - selected headset connect -> exactly one Continue action; - unrelated device -> no action; - disabled rule -> no action; - reconnect flapping -> one action; - profile switch uses that profile's remembered book; - no remembered book -> no surprise playback; - call/audio-focus conflict follows the selected safe policy. ## Device acceptance Test wired headset where supported, Bluetooth headset, reconnect after process death, screen off, profile switch, and a car/A2DP device to confirm the rule does not accidentally broaden into car behavior. ## Effort Medium. ## Risk Medium. Auto-play is useful but can be obnoxious if device matching or audio-focus policy is loose. ## Acceptance criteria - The rule is opt-in. - It invokes the common Continue action rather than direct player code. - It cannot select a book from remote recency. - Reconnects do not cause repeated playback starts. - Device/profile ambiguity fails safely.
Sign in to join this conversation.
No labels
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
alexander/Audiobookshelf-Manager-Claude#25
No description provided.