An alternative to the timer-based sleep feature. Instead of counting down a fixed duration, it periodically confirms the user is still awake.
How it works
User enables Stay Awake mode from the sleep timer menu
Every 15 minutes, a soft chime plays at 30% volume
A Still listening? modal appears with a 60-second countdown
User taps the checkmark → confirmed, interval extends
Miss 1 check → volume drops to 50%, next check comes sooner
Miss 2 checks → playback pauses, position bookmarked
Why?
The current sleep timer requires guessing how long you'll stay awake. Stay Awake mode detects when you actually stop responding — no guessing needed.
Shake-to-reset works for solo listeners, but not when your partner is sleeping next to you. A silent tap on a dimmed screen is the marriage-friendly option.
Changes
3 new files, 0 modified:
File
Lines
Description
StayAwakeManager.kt
190
Android — integrates with PlayerNotificationService
iOS player controller: instantiate + connect callbacks
Sleep timer UI: add Stay Awake toggle
Store: stayAwakeActive state
Strings: localization
Optional server endpoint
A companion POST /api/sleep/report + GET /api/sleep/rewind/:bookId can store sleep events and suggest rewind points. Works with stock ABS or any compatible server.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/advplyr/audiobookshelf-app/pull/1854
**Author:** [@collaed](https://github.com/collaed)
**Created:** 4/22/2026
**Status:** 🔄 Open
**Base:** `master` ← **Head:** `feat/stay-awake-mode`
---
### 📝 Commits (1)
- [`e6dc5da`](https://github.com/advplyr/audiobookshelf-app/commit/e6dc5dabf5b39de2fec713fc14bbaea628bbf54a) feat: Stay Awake mode — active sleep detection via periodic check-in
### 📊 Changes
**3 files changed** (+418 additions, -0 deletions)
<details>
<summary>View changed files</summary>
➕ `android/app/src/main/java/com/audiobookshelf/app/managers/StayAwakeManager.kt` (+213 -0)
➕ `components/modals/StayAwakeModal.vue` (+78 -0)
➕ `ios/App/Shared/player/StayAwakeManager.swift` (+127 -0)
</details>
### 📄 Description
## Stay Awake Mode
An alternative to the timer-based sleep feature. Instead of counting down a fixed duration, it periodically confirms the user is still awake.
### How it works
1. User enables **Stay Awake** mode from the sleep timer menu
2. Every 15 minutes, a soft chime plays at 30% volume
3. A **Still listening?** modal appears with a 60-second countdown
4. User taps the checkmark → confirmed, interval extends
5. Miss 1 check → volume drops to 50%, next check comes sooner
6. Miss 2 checks → playback pauses, position bookmarked
### Why?
The current sleep timer requires guessing how long you'll stay awake. Stay Awake mode detects when you **actually stop responding** — no guessing needed.
Shake-to-reset works for solo listeners, but not when your partner is sleeping next to you. A silent tap on a dimmed screen is the marriage-friendly option.
### Changes
3 new files, 0 modified:
| File | Lines | Description |
|------|-------|-------------|
| `StayAwakeManager.kt` | 190 | Android — integrates with PlayerNotificationService |
| `StayAwakeManager.swift` | 120 | iOS — callback-based player integration |
| `StayAwakeModal.vue` | 70 | Shared UI — checkmark button with countdown |
### Integration needed
These are self-contained. To wire in:
- `PlayerNotificationService.kt`: instantiate + add event emitters
- iOS player controller: instantiate + connect callbacks
- Sleep timer UI: add Stay Awake toggle
- Store: `stayAwakeActive` state
- Strings: localization
### Optional server endpoint
A companion `POST /api/sleep/report` + `GET /api/sleep/rewind/:bookId` can store sleep events and suggest rewind points. Works with stock ABS or any compatible server.
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/advplyr/audiobookshelf-app/pull/1854
Author: @collaed
Created: 4/22/2026
Status: 🔄 Open
Base:
master← Head:feat/stay-awake-mode📝 Commits (1)
e6dc5dafeat: Stay Awake mode — active sleep detection via periodic check-in📊 Changes
3 files changed (+418 additions, -0 deletions)
View changed files
➕
android/app/src/main/java/com/audiobookshelf/app/managers/StayAwakeManager.kt(+213 -0)➕
components/modals/StayAwakeModal.vue(+78 -0)➕
ios/App/Shared/player/StayAwakeManager.swift(+127 -0)📄 Description
Stay Awake Mode
An alternative to the timer-based sleep feature. Instead of counting down a fixed duration, it periodically confirms the user is still awake.
How it works
Why?
The current sleep timer requires guessing how long you'll stay awake. Stay Awake mode detects when you actually stop responding — no guessing needed.
Shake-to-reset works for solo listeners, but not when your partner is sleeping next to you. A silent tap on a dimmed screen is the marriage-friendly option.
Changes
3 new files, 0 modified:
StayAwakeManager.ktStayAwakeManager.swiftStayAwakeModal.vueIntegration needed
These are self-contained. To wire in:
PlayerNotificationService.kt: instantiate + add event emittersstayAwakeActivestateOptional server endpoint
A companion
POST /api/sleep/report+GET /api/sleep/rewind/:bookIdcan store sleep events and suggest rewind points. Works with stock ABS or any compatible server.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.