Prevent rtcwake to go to crust when not expected

If you unlock the phone in rtcwake, then the next rtcwake will put the
phone back to crust cause last wake up reason still is rtc.

To prevent this, we also check the last state and expect it to be crust.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Anjandev Momi <anjan@momi.ca>
master
Stacy Harper 4 years ago committed by Anjandev Momi
parent 4c0b70442c
commit 41c15b192e
  1. 8
      scripts/core/sxmo_rtcwake.sh

@ -11,11 +11,11 @@ finish() {
sxmo_screenlock.sh updateLed sxmo_screenlock.sh updateLed
if grep -q rtc "$UNSUSPENDREASONFILE"; then if grep -q crust "$LASTSTATE" \
&& grep -q rtc "$UNSUSPENDREASONFILE" \
&& [ "$(sxmo_screenlock.sh getCurState)" != "unlock" ]; then
# Going back to crust # Going back to crust
if [ "$(sxmo_screenlock.sh getCurState)" != "unlock" ]; then sxmo_screenlock.sh crust
sxmo_screenlock.sh crust
fi
fi fi
exit 0 exit 0

Loading…
Cancel
Save