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:
Christopher Özbek 2025-08-24 10:45:04 +02:00 committed by GitHub
parent 9e53b1ecec
commit b4a6762bd6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);
}