add usb power as an unsuspend reason to sxmo_screenlock.sh
Signed-off-by: Stacy Harper <contact@stacyharper.net>
This commit is contained in:
parent
672566c206
commit
9abfa620fe
1 changed files with 7 additions and 2 deletions
|
@ -13,21 +13,26 @@ BLUELED_PATH="/sys/class/leds/blue:indicator/brightness"
|
|||
WAKEUPRTC="/sys/class/wakeup/wakeup1/active_count"
|
||||
MODEMUPRTC="/sys/class/wakeup/wakeup10/active_count"
|
||||
NETWORKRTCSCAN="/sys/module/8723cs/parameters/rtw_scan_interval_thr"
|
||||
POWERRTC="/sys/class/wakeup/wakeup5/active_count"
|
||||
|
||||
OLD_RTC_WAKECOUNT="$XDG_RUNTIME_DIR/wakeup.rtc.count"
|
||||
OLD_MODEM_WAKECOUNT="$XDG_RUNTIME_DIR/wakeup.modem.count"
|
||||
OLD_POWER_WAKECOUNT="$XDG_RUNTIME_DIR/wakeup.power.count"
|
||||
|
||||
saveAllEventCounts() {
|
||||
cat "$WAKEUPRTC" > "$OLD_RTC_WAKECOUNT"
|
||||
cat "$MODEMUPRTC" > "$OLD_MODEM_WAKECOUNT"
|
||||
cat "$POWERRTC" > "$OLD_POWER_WAKECOUNT"
|
||||
# TODO: add logic for modem wakeup
|
||||
}
|
||||
|
||||
whichWake() {
|
||||
if [ "$(cat "$WAKEUPRTC")" -gt "$(cat "$OLD_RTC_WAKECOUNT")" ] ; then
|
||||
echo "rtc"
|
||||
if [ "$(cat "$POWERRTC")" -gt "$(cat "$OLD_POWER_WAKECOUNT")" ] ; then
|
||||
echo "usb power"
|
||||
elif [ "$(cat "$MODEMUPRTC")" -gt "$(cat "$OLD_MODEM_WAKECOUNT")" ] ; then
|
||||
echo "modem"
|
||||
elif [ "$(cat "$WAKEUPRTC")" -gt "$(cat "$OLD_RTC_WAKECOUNT")" ] ; then
|
||||
echo "rtc"
|
||||
else
|
||||
# button does not have a active count so if it's none of the above, it has to be the button
|
||||
echo "button"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue