Created Playback states & service states (markdown)

tzugen 2021-05-04 12:31:26 +02:00
parent 1bbc5c5abb
commit 50658a9468
1 changed files with 15 additions and 0 deletions

@ -0,0 +1,15 @@
**Service running**: Service is running, but startForeground was not called.
**Service as Foreground**: Service is running, startForeground was called, Notification is shown
**stopForeground**: If we exit foreground, we can specify a flag, whether to remove, or to detach the notification.
If detached, the notification will stay, even when the service has been de-foregrounded
| Condition | Playback State | Service running | Service as Foreground | stopForeground() |
|----------------------------------|----------------|-----------------|-----------------------|--------------------------------------------|
| App starts, no resumable track | STOPPED | ✗ | ✗ | No |
| App starts, with resumable track | PAUSED | ✓ | ? | No |
| Active playing | PLAYING | ✓ | ✓ | No |
| Paused by the user | PAUSED | ✓ | ? | stopForeground(DETACH) |
| Playback has finished / idle | STOPPED | ? | ? | stopForeground() or stopForeground(DETACH) |
| | | | | |