Simplifies a bit the logic in fetchUrl, closes the inputstream when done, and uses a local coroutine scope instead of GlobalScope.
After testing both code paths (art coming from a URL and coming from a NetworkPacket payload) it seems to work well. I get the `Two disk cache edits happened at the same time, should be impossible!` error, but that was happening before this patch as welll.
The code of this class is very convoluted and uses a library unmaintained for 10+ years. I added a FIXME to rewrite with a more modern library that natively supports Kotlin coroutines which should hopefully help simplify the code.
## Issue
Fixes spurious close of the media on pause.
1. Certain phones have a timeout that stops the `MediaSession` after a few minutes of staying paused. This may be fine on a mobile phone, but may not be desired on a PC.
2. Additionally, my phone _sometimes_ sends the stop event immediately on pausing the media and makes KDE Connect kill the playback even on my PC.
## Fix
We do not forward the stop events to the connected device. If user wants to really stop playback, they must use the Stop button inside the media controller view inside the app.
Note that this means we will also end up ignoring legitimate (user-initiated) stop events, such as from Bluetooth headphones.
## Discussion
Ideally, we'd be able to differentiate between user-initiated and system-initiated events, thus letting us selectively forward user-initiated events. But the current `MediaSessionCompat.Callback` doesn't have that information.
This is only set by the Android app and never consumed or used by
any client. It is also arguably made redundant by the `silent`
field, which is clearer in purpose.
Since the fragment outlives the view, and often we have callbacks in the
adapter which hold references to whole Devices or other stuff, preventing
them from beeing freed.