Merge pull request #3810 from ByteHamster/do-not-reset-sleep-timer

Do not restart sleep timer when automatically playing next episode
This commit is contained in:
H. Lehmann 2020-02-01 10:00:45 +01:00 committed by GitHub
commit f642c61dfb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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) {