mirror of
https://github.com/AntennaPod/AntennaPod.git
synced 2025-10-29 11:49:33 +00:00
Make Media Controls work better after battery eviction (#7141)
The patch allows to restart AntennaPod after being removed by the battery saver from the Media Control. It doesn't start the media, but restores the interface in Media Control to then to start playing.
This commit is contained in:
parent
9e53b1ecec
commit
b4a6762bd6
@ -298,6 +298,9 @@ public class PlaybackService extends MediaBrowserServiceCompat {
|
||||
if (mediaPlayer == null) {
|
||||
mediaPlayer = new LocalPSMP(this, mediaPlayerCallback); // Cast not supported or not connected
|
||||
}
|
||||
if (media == null) { // Media is null here if app is restarted from ACTION_MEDIA_BUTTON
|
||||
media = DBReader.getFeedMedia(PlaybackPreferences.getCurrentlyPlayingFeedMediaId());
|
||||
}
|
||||
if (media != null) {
|
||||
mediaPlayer.playMediaObject(media, !media.localFileAvailable(), wasPlaying, true);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user