From 7130791d7ff91574f0daba497b64c8aab5493e9b Mon Sep 17 00:00:00 2001 From: Emil Kosz Date: Sat, 9 Aug 2025 12:02:02 +0200 Subject: [PATCH] Revert back to the original service script --- service.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/service.sh b/service.sh index da62a55..49e9af8 100755 --- a/service.sh +++ b/service.sh @@ -1,15 +1,18 @@ #!/system/bin/sh FREQ=500 # How often to update, in ms. +TS_CHECKED=false while true; do SCREEN_ON="$(/system/bin/dumpsys deviceidle | /system/bin/grep mScreenOn | /system/bin/cut -d '=' -f2)" - if [ "${SCREEN_ON}" = true ]; then + if [ "${SCREEN_ON}" = true ] && [ "${TS_CHECKED}" = false ]; then /system/bin/log -t Magisk -p i "[XC5_GSI_Fixes] Checking touchscreen connection." /system/bin/echo check_connection > /sys/class/sec/tsp/cmd RESULT="$(/system/bin/cat /sys/class/sec/tsp/cmd_result | /system/bin/cut -d ':' -f2)" /system/bin/log -t Magisk -p i "[XC5_GSI_Fixes] Result: ${RESULT}" + TS_CHECKED=true fi + [ "${SCREEN_ON}" = false ] && TS_CHECKED=false /system/bin/usleep "${FREQ}" done