display: Remove enum TOUCH_SCREEN_OFF_MODE 32/312632/2
authorYoungjae Cho <y0.cho@samsung.com>
Tue, 11 Jun 2024 11:02:23 +0000 (20:02 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Thu, 13 Jun 2024 02:39:53 +0000 (11:39 +0900)
All call for touchscreen_stop(TOUCH_SCREEN_OFF_MODE) have been replaced
with call touchscreen_set_state() directly, not via touchscreen_stop().

The display dbus method "StayTouchScreenOff" has been deprecated.
Instead, it can do the same thing that "Disable" method of touchscreen
module by disabling touchscreen.

Change-Id: Ic72cbdc6635afd691129d3256aa9a034b71cb2ae
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
plugins/wearable/display/core.c
plugins/wearable/display/swim.c
src/display/display-dbus.c
src/display/display-util.c
src/shared/devices.h
src/touchscreen/touchscreen.c

index 0fd959bba9342bdfbf7bcca5e1d5ec69b50a40dd..3e611947e05b5428c5a82e0f05066ca99b6d61aa 100644 (file)
@@ -160,12 +160,6 @@ static int get_device_flags(unsigned long *device_flags)
                return -EINVAL;
 
        *device_flags = NORMAL_MODE;
-       bool stay_touchscreen_off = false;
-       display_misc_get_stay_touchscreen_off(&stay_touchscreen_off);
-
-       if (stay_touchscreen_off) {
-               *device_flags |= TOUCH_SCREEN_OFF_MODE;
-       }
 
        return 0;
 }
index 9bedd319ddd20d4707f85afe6ec7c03fa642e393..d4fbd67ba236b175e9c1f020b8ff67150c2e4db9 100644 (file)
@@ -59,6 +59,12 @@ static int swim_execute(void *data)
         * After that, module would be changed to suspend(execute(STATUS_STOP)).
         * The opposite case, the module should be enabled first.
         */
+
+       /**
+        * FIXME: Fix it using resource-manager controlling touchscreen resource
+        * that has not been implemented yet.
+        */
+#if 0
        if (swimmode_status) {
                touchscreen_ops->stop(TOUCH_SCREEN_OFF_MODE);
                touchscreen_ops->execute((void *)DEVICE_OPS_STATUS_STOP);
@@ -66,6 +72,8 @@ static int swim_execute(void *data)
                touchscreen_ops->execute((void *)DEVICE_OPS_STATUS_START);
                touchscreen_ops->start(NORMAL_MODE);
        }
+#endif
+
 
        return 0;
 }
index cf7a1c182f74c1fc1cfd4233832e9a5bbd10a329..0ff03adb5475dbddee2a0008ebc4cce4bc109a56 100644 (file)
@@ -1026,6 +1026,10 @@ static GVariant *dbus_changestatebyreason(GDBusConnection *conn,
        return g_variant_new("(i)", ret);
 }
 
+/**
+ * FIXME: Deprecated and will be removed.
+ *        It has no effect. Use "Disable" dbus method of touchscreen module instead.
+ */
 static GVariant *dbus_staytouchscreenoff(GDBusConnection *conn,
        const gchar *sender, const gchar *path, const gchar *iface, const gchar *name,
        GVariant *param, GDBusMethodInvocation *invocation, gpointer user_data)
@@ -1470,6 +1474,7 @@ static const dbus_method_s dbus_methods[] = {
        { "CustomLCDOn",      "i",   "i", dbus_customlcdon },
        { "CustomLCDOff",         "s",   "i", dbus_customlcdoff },
        { "ChangeStateByReason", "isi", "i", dbus_changestatebyreason },
+       /* deprecated. Instead, use one at touchscreen module, "Disable" */
        { "StayTouchScreenOff", "i", "i", dbus_staytouchscreenoff },
        { "LCDPanelOffMode",  "i",   "i", dbus_lcdpaneloffmode },
        { "ActorControl",   "sii",   "i", dbus_actorcontrol },
index ad47fd545cf0a87c287c4ad81e6ef226efffbb7a..ec996748d7a7368621bca81b0af01633e5b75271 100644 (file)
@@ -52,7 +52,6 @@ int display_util_get_device_flags_name(enum device_flags flags, const char **fla
 
 int display_util_get_device_flags(unsigned long *device_flags)
 {
-       bool stay_touchscreen_off = false;
 
        if (!device_flags)
                return -EINVAL;
@@ -61,10 +60,6 @@ int display_util_get_device_flags(unsigned long *device_flags)
                return display_plugin_get_device_flags(device_flags);
 
        *device_flags = NORMAL_MODE;
-       display_misc_get_stay_touchscreen_off(&stay_touchscreen_off);
-
-       if (stay_touchscreen_off)
-               *device_flags |= TOUCH_SCREEN_OFF_MODE;
 
        return 0;
 }
index d3c1a3e89c6d60c2217b4e7dd3c4bcd7476629f3..e585275f3d15659823e5284120aeb831ed3535d5 100644 (file)
@@ -42,7 +42,6 @@
 
 enum device_flags {
        NORMAL_MODE                   = 0x00000001,
-       TOUCH_SCREEN_OFF_MODE         = 0x00002000,
        LCD_ON_BY_GESTURE             = 0x00010000,
        LCD_ON_BY_POWER_KEY           = 0x00020000,
        LCD_ON_BY_BACK_KEY            = 0x00040000,
index a19c40a3667560080161f0b73cde9e4bc79e37b7..4c95181f7cfbed167a0c6a71c8302593f1f5d7d7 100644 (file)
@@ -47,6 +47,8 @@ static int powersaving_support = true;
 
 static int touchscreen_start(enum device_flags flags);
 static int touchscreen_stop(enum device_flags flags);
+static int touchscreen_powersaving(enum ps_mode mode);
+static int touchscreen_set_state(enum touchscreen_state state);
 
 static int delayed_init_done(void *data);
 
@@ -65,10 +67,12 @@ static void touchscreen_wakeup_status(keynode_t *key, void *data)
        g_display_plugin.config->touch_wakeup = vconf_keynode_get_bool(key);
 
        if (display_panel_get_dpms_cached_state() != SYSCOMMON_DEVICED_DPMS_ON) {
-               if (g_display_plugin.config->touch_wakeup)
+               if (g_display_plugin.config->touch_wakeup) {
                        touchscreen_start(NORMAL_MODE);
-               else
-                       touchscreen_stop(TOUCH_SCREEN_OFF_MODE);
+               } else {
+                       touchscreen_powersaving(POWERSAVING_OFF);
+                       touchscreen_set_state(TOUCHSCREEN_OFF);
+               }
        }
 }
 
@@ -210,11 +214,6 @@ static int touchscreen_stop(enum device_flags flags)
        if (touchscreen_enable != DEVICE_OPS_STATUS_START)
                return 0;
 
-       if (flags & TOUCH_SCREEN_OFF_MODE) {
-               touchscreen_powersaving(POWERSAVING_OFF);
-               return touchscreen_set_state(TOUCHSCREEN_OFF);
-       }
-
        if (battery && battery->charger_connected == 1) {
                _I("Battery charging one %d %d.", battery->charger_connected, battery->online_type);
                return touchscreen_powersaving(POWERSAVING_ON);
@@ -267,7 +266,9 @@ static GVariant *dbus_touchscreen_disable(GDBusConnection *conn,
        GVariant *param, GDBusMethodInvocation *invocation, gpointer user_data)
 {
        int ret;
-       ret = touchscreen_stop(TOUCH_SCREEN_OFF_MODE);
+
+       touchscreen_powersaving(POWERSAVING_OFF);
+       ret = touchscreen_set_state(TOUCHSCREEN_OFF);
 
        return g_variant_new("(i)", ret);
 }