fix(sxmo): re-enable automatic screen-off on idle to stop backlight battery drain
The previous commit disabled sxmo_idle.sh and the idle_locker in the unlock/lock hooks, leaving the display backlight pinned at maximum brightness forever (Xorg runs with -s 0 -dpms and /sys/power/state is empty, so the panel never blanks). On a phone with no suspend this is by far the dominant battery drain. Restore sxmo_idle.sh and start idle_locker from the unlock and lock hooks so the screen blanks after SXMO_UNLOCK_IDLE_TIME (default 30s) / once locked after SXMO_LOCK_IDLE_TIME (default 8s). Locking itself stays explicit-only, matching the documented design; only the display blanks. Verified live on the device: after the idle timeout the state transitions to screenoff and /sys/class/backlight/backlight/brightness drops to 0.
This commit is contained in:
@@ -32,7 +32,14 @@ if [ -z "$SXMO_DISABLE_LEDS" ]; then
|
||||
fi
|
||||
sxmo_jobs.sh stop periodic_wakelock_check
|
||||
|
||||
# Automatic idle transitions are disabled; only explicit locking is used
|
||||
sxmo_jobs.sh stop idle_locker 2>/dev/null || true
|
||||
# Re-enable automatic screen-off on idle to save battery. The phone only
|
||||
# locks on explicit request; once locked we blank the screen after a short
|
||||
# idle period.
|
||||
if [ -e "$XDG_CACHE_HOME/sxmo/sxmo.noidle" ]; then
|
||||
sxmo_jobs.sh stop idle_locker
|
||||
else
|
||||
sxmo_jobs.sh start idle_locker sxmo_idle.sh -w \
|
||||
timeout "${SXMO_LOCK_IDLE_TIME:-8}" 'sh -c "sxmo_state.sh set screenoff"'
|
||||
fi
|
||||
|
||||
wait
|
||||
|
||||
@@ -26,7 +26,13 @@ if [ -z "$SXMO_DISABLE_LEDS" ]; then
|
||||
fi
|
||||
sxmo_jobs.sh stop periodic_wakelock_check
|
||||
|
||||
# Automatic idle locking is disabled; only explicit locking is used
|
||||
sxmo_jobs.sh stop idle_locker 2>/dev/null || true
|
||||
# Re-enable automatic screen-off on idle to save battery. Locking stays
|
||||
# explicit (the user locks only on request); we only blank the display.
|
||||
if [ -e "$XDG_CACHE_HOME/sxmo/sxmo.noidle" ]; then
|
||||
sxmo_jobs.sh stop idle_locker
|
||||
else
|
||||
sxmo_jobs.sh start idle_locker sxmo_idle.sh -w \
|
||||
timeout "${SXMO_UNLOCK_IDLE_TIME:-30}" 'sh -c "sxmo_state.sh set screenoff"'
|
||||
fi
|
||||
|
||||
wait
|
||||
|
||||
Reference in New Issue
Block a user