Do not restart sleep timer when automatically playing next episode

This commit is contained in:
ByteHamster 2020-01-31 16:37:42 +01:00
parent a0e3a04f67
commit 29bc5109a6

View File

@ -570,6 +570,7 @@ public class PlaybackService extends MediaBrowserServiceCompat {
} else if (mediaPlayer.getPlayable() == null) {
startPlayingFromPreferences();
}
taskManager.restartSleepTimer();
return true;
case KeyEvent.KEYCODE_MEDIA_PLAY:
if (status == PlayerStatus.PAUSED || status == PlayerStatus.PREPARED) {
@ -580,6 +581,7 @@ public class PlaybackService extends MediaBrowserServiceCompat {
} else if (mediaPlayer.getPlayable() == null) {
startPlayingFromPreferences();
}
taskManager.restartSleepTimer();
return true;
case KeyEvent.KEYCODE_MEDIA_PAUSE:
if (status == PlayerStatus.PLAYING) {
@ -827,9 +829,6 @@ public class PlaybackService extends MediaBrowserServiceCompat {
@Override
public void onPlaybackStart(@NonNull Playable playable, int position) {
if (taskManager.isSleepTimerActive()) {
taskManager.restartSleepTimer();
}
taskManager.startWidgetUpdater();
if (position != PlaybackServiceMediaPlayer.INVALID_TIME) {
playable.setPosition(position);
@ -1446,10 +1445,12 @@ public class PlaybackService extends MediaBrowserServiceCompat {
public void resume() {
mediaPlayer.resume();
taskManager.restartSleepTimer();
}
public void prepare() {
mediaPlayer.prepare();
taskManager.restartSleepTimer();
}
public void pause(boolean abandonAudioFocus, boolean reinit) {