mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-08-29 14:47:21 +02:00
Fix: shake to reset only during grace period or while playing
This commit is contained in:
@@ -343,9 +343,12 @@ constructor(private val playerNotificationService: PlayerNotificationService) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Handles the shake event to reset the sleep timer. */
|
/**
|
||||||
|
* Handles the shake event to reset the sleep timer. Shaking to reset only works during the 2
|
||||||
|
* minute grace period after the timer ends or while media is playing.
|
||||||
|
*/
|
||||||
fun handleShake() {
|
fun handleShake() {
|
||||||
if (sleepTimerRunning || sleepTimerFinishedAt > 0L) {
|
if ((sleepTimerRunning && getIsPlaying()) || sleepTimerFinishedAt > 0L) {
|
||||||
if (DeviceManager.deviceData.deviceSettings?.disableShakeToResetSleepTimer == true) {
|
if (DeviceManager.deviceData.deviceSettings?.disableShakeToResetSleepTimer == true) {
|
||||||
Log.d(tag, "Shake to reset sleep timer is disabled")
|
Log.d(tag, "Shake to reset sleep timer is disabled")
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user