touchscreen: Replace TOUCHSENSITIVITY_GLOVE_MODE macro to hal_device_touchscreen_sens... 36/315636/1 accepted/tizen/9.0/unified/20241210.162001
authorYunhee Seo <yuni.seo@samsung.com>
Wed, 4 Dec 2024 02:24:32 +0000 (11:24 +0900)
committerYunhee Seo <yuni.seo@samsung.com>
Wed, 4 Dec 2024 02:24:32 +0000 (11:24 +0900)
At first, there is no need to use TOUCHSENSITIVITY_GLOVE_MODE macro.
This is supported as enum from hal-device-touchscreen module.
Since macros and enums with the same role are defined separately and used,
it should be removed.
Thus, macro usage is replaced by hal_device_touchscreen_sensitivity_state_e type.

Change-Id: Ia8da7a8f0ba0e9a62200ea6c1a8ef6a42ab4a41d
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
src/touchscreen/sensitivity.c

index 8978bc93556706b6285fc02862d1ef2f254a8151..a37761f8a285a39d5c91f947c30e2d6f4c1dae29 100644 (file)
 
 #define TOUCH_SENSITIVITY_DISABLE_INTERVAL 1
 
-#ifndef TOUCHSENSITIVITY_GLOVE_MODE_OFF
-#define TOUCHSENSITIVITY_GLOVE_MODE_OFF 0
-#endif
-#ifndef TOUCHSENSITIVITY_GLOVE_MODE_ON
-#define TOUCHSENSITIVITY_GLOVE_MODE_ON  1
-#endif
-
 static guint disable_timer;
 static bool sensitivity_dev_available = false;
 
@@ -56,13 +49,13 @@ static gboolean disable_sensitivity(void *data)
        }
 
        ret = vconf_get_bool(VCONFKEY_SETAPPL_TOUCH_SENSITIVITY, &status);
-       if (ret < 0 || status == TOUCHSENSITIVITY_GLOVE_MODE_ON) {
+       if (ret < 0 || status == HAL_DEVICE_TOUCHSCREEN_GLOVE_MODE_ON) {
                if (ret < 0)
                        _E("Failed to get vconf value for touch sensitivity: %d", vconf_get_ext_errno());
                return G_SOURCE_REMOVE;
        }
 
-       ret = hal_device_touchscreen_glove_mode_set_state(TOUCHSENSITIVITY_GLOVE_MODE_OFF);
+       ret = hal_device_touchscreen_glove_mode_set_state(HAL_DEVICE_TOUCHSCREEN_GLOVE_MODE_OFF);
        _I("Change auto touch sensitivity disable: %s", ret ? "fail" : "set");
        return G_SOURCE_REMOVE;
 }
@@ -138,7 +131,7 @@ static int delayed_init_done(void *data)
 {
        static int done;
        int ret;
-       int status = TOUCHSENSITIVITY_GLOVE_MODE_OFF;
+       int status = HAL_DEVICE_TOUCHSCREEN_GLOVE_MODE_OFF;
 
        if (data == NULL)
                goto out;
@@ -146,7 +139,7 @@ static int delayed_init_done(void *data)
        done = *(int *)data;
 
        ret = vconf_get_bool(VCONFKEY_SETAPPL_TOUCH_SENSITIVITY, &status);
-       if (ret < 0 || status == TOUCHSENSITIVITY_GLOVE_MODE_OFF) {
+       if (ret < 0 || status == HAL_DEVICE_TOUCHSCREEN_GLOVE_MODE_OFF) {
                if (ret < 0)
                        _E("Failed to get vconf value for touch sensitivity: %d", vconf_get_ext_errno());
                goto out;
@@ -156,7 +149,7 @@ static int delayed_init_done(void *data)
                _E("Touch sensitivity HAL does not exist.");
                goto out;
        }
-       ret = hal_device_touchscreen_glove_mode_set_state(TOUCHSENSITIVITY_GLOVE_MODE_ON);
+       ret = hal_device_touchscreen_glove_mode_set_state(HAL_DEVICE_TOUCHSCREEN_GLOVE_MODE_ON);
        _I("Change auto touch sensitivity enable: %s", ret ? "fail" : "set");
        syscommon_notifier_unsubscribe_notify(DEVICED_NOTIFIER_DELAYED_INIT, delayed_init_done);
 out: