Cancel the periodic updater before calling stopForeground so
that the notification can't come back after it has been closed.
Remove the workaround for API 30 slow notification closing because
it can cause a stuck notification. However, in order to avoid misleading
text being left on the notification if it closes slowly, ensure that
the "0 downloads" text is written to the notification when shutting down.
Fixes#4556
The `getPlayLastPlayedMediaIntent` method was originally added in 2013
to avoid starting the service without a media file. The bind method
should actually never need to start the service in the first place,
though.
Previously, we relied on the string to fill the complete frame.
Some podcasts terminate the string early and leave some garbage in
the frame data. Skip that garbage, so that the reader is at a valid
frame header position when starting the next iteration.
We return true anyways. The call for actually loading is asynchronous,
so returning anything here does not make sense.
Reduces likelihood of loader being interrupted to just load the same
item again when the state changes.
Not sure why this worked before TBH - but default value should
naturally be to reduce to desired cache size.
Probably makes no difference in actual use - but it is how the tests
are constructed.
This is another way of solving #2077.
The root issue is that queued episodes are never auto-deleted
currently which means that if you automatically add episodes to the
queue you will eventually end up with AntennaPod refusing to auto
download more episodes because the cache is full and it can't make
space.
This option will only refuse to delete favorited items. Otherwise it
will simply delete the oldest episodes.
Instead of binding to the service, pass the required data. This also
ensures that the widget is updated instantly when calling from
PlaybackService. JobService had the problem that the OS sometimes
took some seconds before actually executing the job.