increased verbosity in postwake and rtcwake + changed blinking from police lights (red+blue) to subtler red+purple
Signed-off-by: Stacy Harper <contact@stacyharper.net>
This commit is contained in:
parent
bdccd244c4
commit
9a7ca6e369
3 changed files with 9 additions and 4 deletions
|
@ -10,6 +10,7 @@ if [ "$UNSUSPENDREASON" = "modem" ] || [ "$UNSUSPENDREASON" = "rtc" ]; then
|
||||||
# Rtc wakeup will eventually be handled by the rtcwake script
|
# Rtc wakeup will eventually be handled by the rtcwake script
|
||||||
# We should not manage those phone lock state here
|
# We should not manage those phone lock state here
|
||||||
# we will still call the postwake hook though
|
# 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"
|
sxmo_hooks.sh postwake "$UNSUSPENDREASON"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
@ -25,6 +26,7 @@ finish() {
|
||||||
|
|
||||||
# Going back to crust
|
# Going back to crust
|
||||||
if [ "$(sxmo_screenlock.sh getCurState)" != "unlock" ]; then
|
if [ "$(sxmo_screenlock.sh getCurState)" != "unlock" ]; then
|
||||||
|
echo "[$(date)] Going back to crust" >&2
|
||||||
sxmo_screenlock.sh crust
|
sxmo_screenlock.sh crust
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -38,7 +40,7 @@ blink() {
|
||||||
echo 1 > "$REDLED_PATH"
|
echo 1 > "$REDLED_PATH"
|
||||||
echo 0 > "$BLUELED_PATH"
|
echo 0 > "$BLUELED_PATH"
|
||||||
sleep 0.25
|
sleep 0.25
|
||||||
echo 0 > "$REDLED_PATH"
|
echo 1 > "$REDLED_PATH"
|
||||||
echo 1 > "$BLUELED_PATH"
|
echo 1 > "$BLUELED_PATH"
|
||||||
sleep 0.25
|
sleep 0.25
|
||||||
done
|
done
|
||||||
|
@ -51,5 +53,6 @@ BLINKPID=$!
|
||||||
# the unlock functionality to function well
|
# the unlock functionality to function well
|
||||||
sleep 5 &
|
sleep 5 &
|
||||||
SLEEPPID=$!
|
SLEEPPID=$!
|
||||||
|
echo "sxmo_postwake: invoking postwake hook after wakeup (reason=$UNSUSPENDREASON, 1, $(date))" >&2
|
||||||
sxmo_hooks.sh postwake "$UNSUSPENDREASON"
|
sxmo_hooks.sh postwake "$UNSUSPENDREASON"
|
||||||
wait $SLEEPPID
|
wait $SLEEPPID
|
||||||
|
|
|
@ -14,8 +14,10 @@ finish() {
|
||||||
if grep -q crust "$LASTSTATE" \
|
if grep -q crust "$LASTSTATE" \
|
||||||
&& grep -q rtc "$UNSUSPENDREASONFILE" \
|
&& grep -q rtc "$UNSUSPENDREASONFILE" \
|
||||||
&& [ "$(sxmo_screenlock.sh getCurState)" != "unlock" ]; then
|
&& [ "$(sxmo_screenlock.sh getCurState)" != "unlock" ]; then
|
||||||
# Going back to crust
|
echo "sxmo_rtcwake: going back to crust ($(date))" >&2
|
||||||
sxmo_screenlock.sh crust
|
sxmo_screenlock.sh crust
|
||||||
|
else
|
||||||
|
echo "sxmo_rtcwake: not returning to crust ($(date))" >&2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -28,7 +30,7 @@ blink() {
|
||||||
echo 1 > "$REDLED_PATH"
|
echo 1 > "$REDLED_PATH"
|
||||||
echo 0 > "$BLUELED_PATH"
|
echo 0 > "$BLUELED_PATH"
|
||||||
sleep 0.25
|
sleep 0.25
|
||||||
echo 0 > "$REDLED_PATH"
|
echo 1 > "$REDLED_PATH"
|
||||||
echo 1 > "$BLUELED_PATH"
|
echo 1 > "$BLUELED_PATH"
|
||||||
sleep 0.25
|
sleep 0.25
|
||||||
done
|
done
|
||||||
|
@ -37,4 +39,5 @@ blink() {
|
||||||
blink &
|
blink &
|
||||||
BLINKPID=$!
|
BLINKPID=$!
|
||||||
|
|
||||||
|
echo "sxmo_rtcwake: Running sxmo_rtcwake for $* ($(date))" >&2
|
||||||
"$@"
|
"$@"
|
||||||
|
|
|
@ -138,7 +138,6 @@ elif [ "$1" = "off" ] ; then
|
||||||
elif [ "$1" = "crust" ] ; then
|
elif [ "$1" = "crust" ] ; then
|
||||||
getCurState > "$LASTSTATE"
|
getCurState > "$LASTSTATE"
|
||||||
# USER MUST USE sxmo_screenlock.sh rtc rather than using rtcwake directly.
|
# 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 1 > "$REDLED_PATH"
|
||||||
echo 0 > "$BLUELED_PATH"
|
echo 0 > "$BLUELED_PATH"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue