display: Change system_wakeup_flag from plugin to misc function 22/313322/1
authorYoungjae Cho <y0.cho@samsung.com>
Mon, 17 Jun 2024 11:21:07 +0000 (20:21 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Mon, 24 Jun 2024 02:05:29 +0000 (11:05 +0900)
The system_wakeup_flag has nothing to do with plugin but, rather, a
runtime information that controlled by battery module. Therefore, it
is proper that the deviced core manages the value.

Change-Id: I62849c827aa688733da8689a37d1fb5c0ad22b37
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
src/battery/battery-time.c
src/display/display-misc.c
src/display/display-misc.h
src/display/display-plugin.c
src/display/display-plugin.h
src/display/display.c

index 35cfcf91968784f4ecaf039eb2944341dea730fa..5969622b95b3b0bf448979420c68b700e3703f98 100644 (file)
@@ -28,7 +28,7 @@
 #include "shared/devices.h"
 #include "core/log.h"
 #include "display-ops.h"
-#include "display-plugin.h"
+#include "display-misc.h"
 #include "power-supply.h"
 #include "shared/plugin.h"
 
@@ -305,10 +305,10 @@ static int battinfo_calculation(void)
                update_time(A_TIMETOFULL, estimated_time);
        } else {
                del_all_batt_node(B_CHARGING);
-               display_plugin_get_system_wakeup_flag(&system_wakeup_flag);
+               display_misc_get_system_wakeup_flag(&system_wakeup_flag);
                if (system_wakeup_flag == true) {
                        del_all_batt_node(B_UNCHARGING);
-                       display_plugin_set_system_wakeup_flag(false);
+                       display_misc_set_system_wakeup_flag(false);
                }
                if (batt_head[B_UNCHARGING] == NULL) {
                        add_batt_node(B_UNCHARGING, clock, capacity);
index bcfbba7904a66376b94fac35918d55ccb7583549..05c73aa3ca2a59d60eb28ecfb239db544ffb339e 100644 (file)
 
 static bool stay_touchscreen_off = false;
 static bool touch_event_blocked = false;
+static bool system_wakeup_flag = false;
+
+int display_misc_get_system_wakeup_flag(bool *flag)
+{
+       *flag = system_wakeup_flag;
+
+       return 0;
+}
+
+int display_misc_set_system_wakeup_flag(bool flag)
+{
+       system_wakeup_flag = flag;
+
+       return 0;
+}
 
 /* FIXME: This fucntion should be relocated under the battery module */
 bool display_misc_is_low_battery_state(int val)
index afacf7bdcc0443c638abf4329a6d4fa7400cc019..6bc8f16cc3bc9778e015ac3649d754a0a41165be 100644 (file)
@@ -27,6 +27,8 @@
 #include <stdbool.h>
 #include <sys/types.h>
 
+int display_misc_get_system_wakeup_flag(bool *flag);
+int display_misc_set_system_wakeup_flag(bool flag);
 bool display_misc_is_low_battery_state(int val);
 void display_misc_get_process_name(pid_t pid, char *pname);
 void display_misc_set_stay_touchscreen_off(bool on);
index 6716a7c4d98bd52ad68c9f97d963bdf6b3df0a37..cb423ad7c8997f13658e2ab92fa434393b3a9980 100644 (file)
 
 struct display_plugin g_display_plugin;
 
-int display_plugin_get_system_wakeup_flag(bool *flag)
-{
-       *flag = g_display_plugin.system_wakeup_flag;
-
-       return 0;
-}
-
-int display_plugin_set_system_wakeup_flag(bool flag)
-{
-       g_display_plugin.system_wakeup_flag = flag;
-
-       return 0;
-}
-
 /* FIXME: Below functions are temorary to separtate display state transition functions */
 int display_plugin_state_do_default_trans(enum syscommon_deviced_display_state state, int evt)
 {
index f55a99aca48039e105a9c2bc677eee1fcf8d5dab..779fa98a2b42e614d81d8256c3412cfd0225a1d4 100644 (file)
@@ -29,7 +29,6 @@
 #include "shared/devices.h"
 
 struct display_plugin {
-       bool system_wakeup_flag;
        int (*proc_change_state) (unsigned int cond, pid_t pid);
 
        struct syscommon_deviced_display_config *config;
@@ -37,9 +36,6 @@ struct display_plugin {
 };
 extern struct display_plugin g_display_plugin;
 
-int display_plugin_get_system_wakeup_flag(bool *flag);
-int display_plugin_set_system_wakeup_flag(bool flag);
-
 /* FIXME: function names will be redefined */
 int display_plugin_state_do_default_trans(enum syscommon_deviced_display_state state, int evt);
 bool display_plugin_state_is_there_default_trans(enum syscommon_deviced_display_state state);
index e19ae13dae2dd22c08ea6fe564bf37c2f174a2e2..801f29c45d1ced79e90dd62750c8d8facfd5906d 100644 (file)
@@ -252,7 +252,7 @@ static int power_resume_from_echomem_callback(void *data)
        if (ret < 0)
                return ret;
 
-       display_plugin_set_system_wakeup_flag(true);
+       display_misc_set_system_wakeup_flag(true);
        if (check_wakeup_src() == EVENT_DEVICE)
                /* system waked up by devices */
                display_state_transition_do_state_transition(current, EVENT_DEVICE);