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();