summaryrefslogtreecommitdiff
path: root/core/src/main/java/de
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/main/java/de')
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java
index 98280f54d..3536fd26e 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java
@@ -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());
}
- setPlayerStatus(PlayerStatus.INITIALIZED, media);
+ 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();