mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-08-04 18:15:01 +02:00
Fix: shake to reset only during grace period or while playing
This commit is contained in:
parent
c7f51e815c
commit
e7e03697d6
1 changed files with 5 additions and 2 deletions
|
@ -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() {
|
||||
if (sleepTimerRunning || sleepTimerFinishedAt > 0L) {
|
||||
if ((sleepTimerRunning && getIsPlaying()) || sleepTimerFinishedAt > 0L) {
|
||||
if (DeviceManager.deviceData.deviceSettings?.disableShakeToResetSleepTimer == true) {
|
||||
Log.d(tag, "Shake to reset sleep timer is disabled")
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue