Closed datajosh closed 4 years ago
Yes, I would like this feature as well. When pausing the audiobook the notification widget & lockscreen widget disappears quickly. After that you can't resume the audiobook without unlocking phone and opening the Voice app and pressing play. I also tried setting Voice battery management settings (Android) to manual so that the background activity of the Voice app is not restricted but it didn't help.
Just wanted to +1 this request. It used to stay longer but it drives me nuts how quickly it disappears now.
The system kills the service quite quickly because I call stop foreground upon playback paused: https://github.com/PaulWoitaschek/Voice/blob/21480cbb71a2318eecf0949967cdcf87a00984e9/app/src/main/java/de/ph1b/audiobook/playback/PlaybackService.kt#L235
This is because I want the user to be able to swipe-dismiss the notification in paused state. If the service stays foreground this doesn't work.
At least that's what I remember, if you find a fix for that, that would be great. The other quirk is that because the service needs to be started as a foreground service: https://github.com/PaulWoitaschek/Voice/blob/0bd5aa9bb2b0d71e59a68a71aa17b855bc52c2ab/app/src/main/java/de/ph1b/audiobook/playback/events/MediaEventReceiver.kt#L20 It must not stop itself immediately else it will crash. So we create this dummy notification which for some users stays persistent for some reason.
This may or may not be related, but I notice that recently, and without using the app or having any interaction with it, upon restarting my phone -or- exiting from airplane mode, the notification appears and I must swipe away.
It should be possible to keep the notification around after stopping the foreground service. Apparently Voice gets killed pretty fast by the system, while other apps like Pocket Casts or Play Music keep their notification alive (on my phone the entire day) after being paused and do not get killed.
Maybe there is some design pattern on Android that allows this kind of notification handling, but I couldn't find it in a quick research, maybe others have more luck, since it is quite annoying that the notification does not persist.
It already works on master
Sweet, let's close this then.
Seems like there are actually two different feature requests here.
On my device, the first feature works but the second does not. If I pause the audio while my device is locked and allow the screen to go off, I have to unlock the device before I can start audio playback again. Any chance of supporting the second feature request?
@yhack which Android version are you using? In case it's 10 you need to pull down your notification area.
@PaulWoitaschek I have Android 8.0.0 on a Galaxy s7 Edge. When I pull down the notification area on the lock screen after pausing there's nothing there, yet when I unlock the phone Voice is in the notification area.
I found an answer to (2). It seems to apply to any media player but may be specific to the Galaxy s7 (Edge) on Android 8.0.0.
When you pause the music (or whatever media), the player seems to disappear. But, while on the > lockscreen, if you swipe to the left, the player will be there and you can resume playing.
Confirmed this annoying behavior doesn't exist in stock Android 10 in an emulator.
Currently, once you pause a book, the notification from Voice disappears relatively quickly. My wife and I both use the app regularly and think it would be better to keep the notification until dismissed, similar to the way Google Play Music, YouTube, and other media players handle it. It would be much more convenient than having to return to the app to resume playing.