From 87ab8162d7491f369f31be831624440599a8bc53 Mon Sep 17 00:00:00 2001 From: danielml Date: Fri, 9 Jun 2023 22:30:00 +0200 Subject: [PATCH] sm6150-common: Assert the goodix ts on sweet * Late 2022 units use a different touchscreen and Xiaomi __forgot__ to release the driver Change-Id: I6992a58f1830953fcf4cd72c660f645b3c0248c1 Signed-off-by: danielml --- releasetools.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/releasetools.py b/releasetools.py index 080961b..d47f63e 100644 --- a/releasetools.py +++ b/releasetools.py @@ -17,14 +17,19 @@ # import common +import os import re +TARGET_PRODUCT = os.getenv('TARGET_PRODUCT') + def FullOTA_Assertions(info): AddBasebandAssertion(info, info.input_zip) + AddTouchScreenAssertion(info) return def IncrementalOTA_Assertions(info): AddBasebandAssertion(info, info.input_zip) + AddTouchScreenAssertion(info) return def FullOTA_InstallEnd(info): @@ -62,3 +67,8 @@ def AddBasebandAssertion(info, input_zip): cmd = 'assert(getprop("ro.boot.hwc") == "{0}" && (xiaomi.verify_baseband("{1}") == "1" || abort("ERROR: This package requires firmware from MIUI {2} or newer. Please upgrade firmware and retry!");) || true);' info.script.AppendExtra(cmd.format(hwc, modem_version, firmware_version)) return + +def AddTouchScreenAssertion(info): + if TARGET_PRODUCT == 'lineage_sweet': + cmd = 'assert(run_program("/sbin/sh", "-c", "[ $(cat /sys/module/goodix_core/parameters/is_goodix_ts) == Y ]") == 0 || abort("This package does not support your device touchscreen"));' + info.script.AppendExtra(cmd)