From 69be01db4a26ce05fead301b7ecf24e5d2f143df Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Thu, 21 Nov 2019 11:42:39 +0100 Subject: [PATCH] Stop listening to shake events and reset volume if sleep timer is reset --- .../service/playback/PlaybackServiceTaskManager.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceTaskManager.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceTaskManager.java index 5647590b1..70d9d9f77 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceTaskManager.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceTaskManager.java @@ -244,7 +244,7 @@ public class PlaybackServiceTaskManager { public synchronized void disableSleepTimer() { if (isSleepTimerActive()) { Log.d(TAG, "Disabling sleep timer"); - sleepTimerFuture.cancel(true); + sleepTimer.cancel(); } } @@ -449,6 +449,13 @@ public class PlaybackServiceTaskManager { } } + public void cancel() { + sleepTimerFuture.cancel(true); + if (shakeListener != null) { + shakeListener.pause(); + } + postCallback(callback::onSleepTimerReset); + } } public interface PSTMCallback {