mirror of
https://github.com/AntennaPod/AntennaPod.git
synced 2026-02-05 08:35:39 +00:00
Attempt to fix uncancelable sleep timers (#8154)
Try to disable the sleep timer in onDestroy too and disable the sleep timer as long as it's available, regardless of whether it's active or not.
This commit is contained in:
@ -309,6 +309,7 @@ public class PlaybackService extends MediaBrowserServiceCompat {
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
Log.d(TAG, "Service is about to be destroyed");
|
||||
disableSleepTimer();
|
||||
|
||||
if (notificationBuilder.getPlayerStatus() == PlayerStatus.PLAYING) {
|
||||
notificationBuilder.setPlayerStatus(PlayerStatus.STOPPED);
|
||||
@ -1222,7 +1223,7 @@ public class PlaybackService extends MediaBrowserServiceCompat {
|
||||
}
|
||||
|
||||
public void disableSleepTimer() {
|
||||
if (sleepTimerActive()) {
|
||||
if (sleepTimer != null) {
|
||||
Log.d(TAG, "Disabling sleep timer");
|
||||
sleepTimer.stop();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user