From dbca3ddd80e5553bea67e2f18b08fce384417423 Mon Sep 17 00:00:00 2001 From: Stacy Harper Date: Mon, 5 Jul 2021 09:58:54 +0200 Subject: [PATCH] Trigger postwake when leaving crust cause of USB-C power Atm, only the button wake up reason was trigerring postwake. This make the usb charger to uncrust the phone and leave it in lock or off mode. Now postwake take an argument which is the wake up reason. The modem reason should not manage so phone state so we make it explicit in the default hook. "usb power" and "button" now make the phone to blink 5 seconds and put the phone back to crust. --- configs/default_hooks/postwake | 6 ++++++ scripts/core/sxmo_screenlock.sh | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/configs/default_hooks/postwake b/configs/default_hooks/postwake index 7040d07..03b1ad3 100644 --- a/configs/default_hooks/postwake +++ b/configs/default_hooks/postwake @@ -2,6 +2,12 @@ . "$(which sxmo_common.sh)" +if [ "$1" = "modem" ]; then + # Modem wakeup will be handled by the modemmonitor loops + # We should not manage the phone lock state here + exit 0 +fi + REDLED_PATH="/sys/class/leds/red:indicator/brightness" BLUELED_PATH="/sys/class/leds/blue:indicator/brightness" diff --git a/scripts/core/sxmo_screenlock.sh b/scripts/core/sxmo_screenlock.sh index 0e9bc3c..ed9cffe 100755 --- a/scripts/core/sxmo_screenlock.sh +++ b/scripts/core/sxmo_screenlock.sh @@ -155,10 +155,10 @@ elif [ "$1" = "crust" ] ; then xset dpms force on fi - if [ "$UNSUSPENDREASON" = "button" ]; then + if [ "$UNSUSPENDREASON" != "modem" ]; then echo 1200 > "$NETWORKRTCSCAN" - sxmo_hooks.sh postwake fi + sxmo_hooks.sh postwake "$UNSUSPENDREASON" exit 0 elif [ "$1" = "getCurState" ] ; then getCurState