android icon indicating copy to clipboard operation
android copied to clipboard

Enhance PlayerService

Open tobiasKaminsky opened this issue 5 years ago • 2 comments
trafficstars

I hopefully fixed all

android.app.RemoteServiceException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{496cd9c u0 com.nextcloud.client/.media.PlayerService}

But if some code tries to directly stop audio player it might fail, if service was not started previously: https://proandroiddev.com/pitfalls-of-a-foreground-service-lifecycle-59f014c6a125

So it seems that Service.startForeground is only started if there is a playable file. https://github.com/nextcloud/android/blob/277f08b9414707bc95514911d4cd71caec96bfe8/src/main/java/com/nextcloud/client/media/Player.kt#L86

For failing tests see: https://github.com/nextcloud/android/pull/6908

tobiasKaminsky avatar Nov 24 '20 07:11 tobiasKaminsky

Added info : Problem occured several times when listening to the same audio file. After re-syncing the audio file, the problem went away. I conclude the the file was probably corrupt at the tail end.

bapjg avatar Jul 17 '21 07:07 bapjg

My take is that this was addressed in #9535 and hence can be closed, but since this issue is sort of a "note to yourself", @tobiasKaminsky can you confirm?

joshtrichards avatar Apr 05 '24 15:04 joshtrichards