I have a MediaPlayer running in a Service that's playing audio from a URL (streaming). As of now it appears to work well, and even continues playing when I put the phone in standby.
I currently do not acquire a wakelock. My question is:
And yes, this is a legitimate use-case for wakelock, because my users explicitly want the audio to continue playing.
MediaPlayer does not do this for you automatically by default.
However, instead of you having to acquire a wake lock, it has a method you can call to tell it to hold one for you while playing:
Note that, as the documentation says, it is still your app holding the wake lock so to use this function you will need to request the wake lock permission.