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;
|
package de.danoeh.antennapod.core.service.playback;
|
||||||
|
|
||||||
|
import android.app.UiModeManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.res.Configuration;
|
||||||
import android.media.AudioManager;
|
import android.media.AudioManager;
|
||||||
import android.os.PowerManager;
|
import android.os.PowerManager;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
@ -275,7 +277,10 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer {
|
||||||
} else {
|
} else {
|
||||||
throw new IOException("Unable to read local file " + media.getLocalMediaUrl());
|
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);
|
setPlayerStatus(PlayerStatus.INITIALIZED, media);
|
||||||
|
}
|
||||||
|
|
||||||
if (prepareImmediately) {
|
if (prepareImmediately) {
|
||||||
setPlayerStatus(PlayerStatus.PREPARING, media);
|
setPlayerStatus(PlayerStatus.PREPARING, media);
|
||||||
|
@ -933,9 +938,6 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer {
|
||||||
|
|
||||||
boolean isPlaying = playerStatus == PlayerStatus.PLAYING;
|
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
|
// we're relying on the position stored in the Playable object for post-playback processing
|
||||||
if (media != null) {
|
if (media != null) {
|
||||||
int position = getPosition();
|
int position = getPosition();
|
||||||
|
|
Loading…
Reference in New Issue