1
0
Fork 0
forked from len0rd/rockbox

powermgmt: adjust sleep timer behavior

Responding to the bug report posted by iPodVT:
https://forums.rockbox.org/index.php/topic,55180.msg255292

- An active sleep timer that runs out will now cause the
player to shut down regardless of playback state

- When playback state is paused or stopped, once the
idle timer has run out, player will shut down, regardless
of any running sleep timer

Change-Id: I33de682a63ed1db76174eb2394ef5568f37cc677
This commit is contained in:
Christian Soffke 2025-02-01 15:19:00 +01:00
parent 078699ef49
commit cf42dd6b12

View file

@ -990,10 +990,6 @@ void set_keypress_restarts_sleep_timer(bool enable)
#ifndef BOOTLOADER
static void handle_sleep_timer(void)
{
if (!sleeptimer_active)
return;
/* Handle sleeptimer */
if (TIME_AFTER(current_tick, sleeptimer_endtick)) {
if (usb_inserted()
#if CONFIG_CHARGING && !defined(HAVE_POWEROFF_WHILE_CHARGING)
@ -1055,9 +1051,8 @@ void handle_auto_poweroff(void)
#endif
!usb_inserted() &&
(audio_stat == 0 ||
(audio_stat == (AUDIO_STATUS_PLAY | AUDIO_STATUS_PAUSE) &&
!sleeptimer_active))) {
audio_stat == (AUDIO_STATUS_PLAY | AUDIO_STATUS_PAUSE)))
{
if (TIME_AFTER(tick, last_event_tick + timeout)
#if !(CONFIG_PLATFORM & PLATFORM_HOSTED)
&& TIME_AFTER(tick, storage_last_disk_activity() + timeout)
@ -1065,7 +1060,9 @@ void handle_auto_poweroff(void)
) {
sys_poweroff();
}
} else
}
if (sleeptimer_active)
handle_sleep_timer();
#endif
}