From 50658a946877ecaf7522178fdbe3e03df8c00812 Mon Sep 17 00:00:00 2001 From: tzugen <67737443+tzugen@users.noreply.github.com> Date: Tue, 4 May 2021 12:31:26 +0200 Subject: [PATCH] Created Playback states & service states (markdown) --- Playback-states-&-service-states.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Playback-states-&-service-states.md diff --git a/Playback-states-&-service-states.md b/Playback-states-&-service-states.md new file mode 100644 index 0000000..b84373d --- /dev/null +++ b/Playback-states-&-service-states.md @@ -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) | +| | | | | | \ No newline at end of file