From 9a7ca6e3694ccf62cea836bffc9f617c79be2243 Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Sun, 25 Jul 2021 14:19:33 +0200 Subject: [PATCH] increased verbosity in postwake and rtcwake + changed blinking from police lights (red+blue) to subtler red+purple Signed-off-by: Stacy Harper --- scripts/core/sxmo_postwake.sh | 5 ++++- scripts/core/sxmo_rtcwake.sh | 7 +++++-- scripts/core/sxmo_screenlock.sh | 1 - 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/core/sxmo_postwake.sh b/scripts/core/sxmo_postwake.sh index 39d7728..4e3e3fa 100755 --- a/scripts/core/sxmo_postwake.sh +++ b/scripts/core/sxmo_postwake.sh @@ -10,6 +10,7 @@ if [ "$UNSUSPENDREASON" = "modem" ] || [ "$UNSUSPENDREASON" = "rtc" ]; then # Rtc wakeup will eventually be handled by the rtcwake script # We should not manage those phone lock state here # we will still call the postwake hook though + echo "sxmo_postwake: invoking postwake hook after wakeup (reason=$UNSUSPENDREASON, 2, $(date))" >&2 sxmo_hooks.sh postwake "$UNSUSPENDREASON" exit 0 fi @@ -25,6 +26,7 @@ finish() { # Going back to crust if [ "$(sxmo_screenlock.sh getCurState)" != "unlock" ]; then + echo "[$(date)] Going back to crust" >&2 sxmo_screenlock.sh crust fi @@ -38,7 +40,7 @@ blink() { echo 1 > "$REDLED_PATH" echo 0 > "$BLUELED_PATH" sleep 0.25 - echo 0 > "$REDLED_PATH" + echo 1 > "$REDLED_PATH" echo 1 > "$BLUELED_PATH" sleep 0.25 done @@ -51,5 +53,6 @@ BLINKPID=$! # the unlock functionality to function well sleep 5 & SLEEPPID=$! +echo "sxmo_postwake: invoking postwake hook after wakeup (reason=$UNSUSPENDREASON, 1, $(date))" >&2 sxmo_hooks.sh postwake "$UNSUSPENDREASON" wait $SLEEPPID diff --git a/scripts/core/sxmo_rtcwake.sh b/scripts/core/sxmo_rtcwake.sh index 9b80788..d99f9d4 100644 --- a/scripts/core/sxmo_rtcwake.sh +++ b/scripts/core/sxmo_rtcwake.sh @@ -14,8 +14,10 @@ finish() { if grep -q crust "$LASTSTATE" \ && grep -q rtc "$UNSUSPENDREASONFILE" \ && [ "$(sxmo_screenlock.sh getCurState)" != "unlock" ]; then - # Going back to crust + echo "sxmo_rtcwake: going back to crust ($(date))" >&2 sxmo_screenlock.sh crust + else + echo "sxmo_rtcwake: not returning to crust ($(date))" >&2 fi exit 0 @@ -28,7 +30,7 @@ blink() { echo 1 > "$REDLED_PATH" echo 0 > "$BLUELED_PATH" sleep 0.25 - echo 0 > "$REDLED_PATH" + echo 1 > "$REDLED_PATH" echo 1 > "$BLUELED_PATH" sleep 0.25 done @@ -37,4 +39,5 @@ blink() { blink & BLINKPID=$! +echo "sxmo_rtcwake: Running sxmo_rtcwake for $* ($(date))" >&2 "$@" diff --git a/scripts/core/sxmo_screenlock.sh b/scripts/core/sxmo_screenlock.sh index 8f90858..978290e 100755 --- a/scripts/core/sxmo_screenlock.sh +++ b/scripts/core/sxmo_screenlock.sh @@ -138,7 +138,6 @@ elif [ "$1" = "off" ] ; then elif [ "$1" = "crust" ] ; then getCurState > "$LASTSTATE" # USER MUST USE sxmo_screenlock.sh rtc rather than using rtcwake directly. - # With this new version of lock, we dont check the exit code of the user hook. User must execute "sxmo_screenlock.sh rtc $TIME" at the end of their hook (depending on whether they want to re-rtc) echo 1 > "$REDLED_PATH" echo 0 > "$BLUELED_PATH"