feat: configurable ring volume

Adds a volume slider (1-100% of the alarm stream) to Settings. RingService
plays at the configured percentage instead of always maxing STREAM_ALARM.
This commit is contained in:
avi 2026-08-07 13:46:20 -05:00
commit 4a04052845
6 changed files with 71 additions and 3 deletions

View file

@ -30,6 +30,9 @@ Choose between:
Playback runs for the configured number of seconds (`5300`, default **30**), then
the previous volume is restored.
### Volume
The ring plays at a configurable percentage (`1100%`) of the alarm-stream volume.
---
## How Do Not Disturb Override Works (read this)
@ -50,7 +53,7 @@ Only after the user flips that toggle will a trigger actually ring.
When access **is** granted, `RingService`:
- saves the current **alarm-stream** volume,
- forces `AudioManager.STREAM_ALARM` to max,
- sets `AudioManager.STREAM_ALARM` to the configured volume percentage,
- requests `AUDIOFOCUS_GAIN_TRANSIENT` using `AudioAttributes.USAGE_ALARM`,
- plays on the **alarm stream** — the one stream Do Not Disturb does **not**
silence by default (media/music *is* silenced), which is what lets the ring