Fix Android Auto next episode (#4895)
This commit is contained in:
parent
c31ab79434
commit
4ff6ff4fb7
|
@ -1,6 +1,8 @@
|
|||
package de.danoeh.antennapod.core.service.playback;
|
||||
|
||||
import android.app.UiModeManager;
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.media.AudioManager;
|
||||
import android.os.PowerManager;
|
||||
import androidx.annotation.NonNull;
|
||||
|
@ -275,7 +277,10 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer {
|
|||
} else {
|
||||
throw new IOException("Unable to read local file " + media.getLocalMediaUrl());
|
||||
}
|
||||
UiModeManager uiModeManager = (UiModeManager) context.getSystemService(Context.UI_MODE_SERVICE);
|
||||
if (uiModeManager.getCurrentModeType() != Configuration.UI_MODE_TYPE_CAR) {
|
||||
setPlayerStatus(PlayerStatus.INITIALIZED, media);
|
||||
}
|
||||
|
||||
if (prepareImmediately) {
|
||||
setPlayerStatus(PlayerStatus.PREPARING, media);
|
||||
|
@ -933,9 +938,6 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer {
|
|||
|
||||
boolean isPlaying = playerStatus == PlayerStatus.PLAYING;
|
||||
|
||||
if (playerStatus != PlayerStatus.INDETERMINATE) {
|
||||
setPlayerStatus(PlayerStatus.INDETERMINATE, media);
|
||||
}
|
||||
// we're relying on the position stored in the Playable object for post-playback processing
|
||||
if (media != null) {
|
||||
int position = getPosition();
|
||||
|
|
Loading…
Reference in New Issue