From b6069026da755fa87e05a2cfb5d998808f6dac2b Mon Sep 17 00:00:00 2001 From: Arian Date: Thu, 25 Jul 2024 01:09:06 +0200 Subject: [PATCH] sm8450-common: sensors: Pass nonui value unmodified to touchscreen * report the scalar directly, 1 probably means pocket and 2 means it's covered. this led to us disabling nonui mode again when covered was reported after pocket. Change-Id: Idbf7fdf773657d87407dd4b67a7353c17b4ae799 --- sensors/NonUiNotifier.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sensors/NonUiNotifier.cpp b/sensors/NonUiNotifier.cpp index 235b770..de2c060 100644 --- a/sensors/NonUiNotifier.cpp +++ b/sensors/NonUiNotifier.cpp @@ -57,9 +57,7 @@ static bool readBool(int fd) { struct NonUiSensorCallback : IEventQueueCallback { Return onEvent(const Event& e) { - bool nonUi = e.u.scalar == 1; - - int buf[MAX_BUF_SIZE] = {0, Touch_Nonui_Mode, nonUi ? 2 : 0}; + int buf[MAX_BUF_SIZE] = {0, Touch_Nonui_Mode, static_cast(e.u.scalar)}; ioctl(open(TOUCH_DEV_PATH, O_RDWR), TOUCH_IOC_SET_CUR_VALUE, &buf); return Void();