Merge pull request #3631 from ByteHamster/fix-sleep-timer

Stop listening to shake events and reset volume if sleep timer is reset
This commit is contained in:
H. Lehmann 2019-11-21 14:16:16 +01:00 committed by GitHub
commit 275d608711
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 {