mirror of
https://github.com/apognu/otter
synced 2025-02-11 08:40:35 +01:00
As per Android policy and internal logic, we stopped the playback foreground service when playback was paused. This made our PlayService elligible for garbage collection by the OS. This had the consequences of not allowing someone to pause playback and resume it after some time. Android would always kill the service after around one minute. This commit, on supported Android version (7.0+) detaches the notification when stopping the foreground service, leaving the notification in place even when the service is killed, allowing the user to resume playback whenever they please. We also had to move the MediaSession out of the service, for it to remain alive between service killing and resurrection.