Stop listening to shake events and reset volume if sleep timer is reset

This commit is contained in:
ByteHamster 2019-11-21 11:42:39 +01:00
parent a6e4c4756c
commit 69be01db4a
1 changed files with 8 additions and 1 deletions

View File

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