Clear timeserver on boot time 92/272192/1 accepted/tizen/unified/20220314.125145 submit/tizen/20220311.091913 submit/tizen/20220314.054206
authorJaehyun Kim <jeik01.kim@samsung.com>
Fri, 11 Mar 2022 03:23:38 +0000 (12:23 +0900)
committerJaehyun Kim <jeik01.kim@samsung.com>
Fri, 11 Mar 2022 03:23:38 +0000 (12:23 +0900)
Currently, timeserver is cleared after a period of time after setting.
However, in this method, there is a problem that timeserver cannot be
retrieved if the interface has no internet connection is connected
first, and then the interface has internet connection is connected
just before the timeserver is cleared.
Therefore, it has been modified so that timeserver is not cleared
until rebooting.

Change-Id: I2f5ca9f6d01bf7be2668338f3a159a401a0d46b5
Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
packaging/net-config.spec
src/network-clock.c

index 9f95e25..ae215ed 100755 (executable)
@@ -1,6 +1,6 @@
 Name:          net-config
 Summary:       TIZEN Network Configuration service
 Name:          net-config
 Summary:       TIZEN Network Configuration service
-Version:       1.2.12
+Version:       1.2.13
 Release:       1
 Group:         System/Network
 License:       Apache-2.0
 Release:       1
 Group:         System/Network
 License:       Apache-2.0
index 98bf2e8..59551c4 100755 (executable)
@@ -105,7 +105,6 @@ static void __netconfig_clock_unset_timeserver(void)
 
 static void __netconfig_set_timeserver(void)
 {
 
 static void __netconfig_set_timeserver(void)
 {
-       guint timeserver_clear_timer = 0;
        int nitz_updated = 0;
 
        netconfig_vconf_get_int(VCONFKEY_TELEPHONY_NITZ_EVENT_GMT, &nitz_updated);
        int nitz_updated = 0;
 
        netconfig_vconf_get_int(VCONFKEY_TELEPHONY_NITZ_EVENT_GMT, &nitz_updated);
@@ -114,9 +113,6 @@ static void __netconfig_set_timeserver(void)
                return;
 
        __netconfig_clock_set_timeserver((const char *)NTP_SERVER);
                return;
 
        __netconfig_clock_set_timeserver((const char *)NTP_SERVER);
-
-       netconfig_start_timer_seconds(5, __netconfig_clock_clear_timeserver_timer,
-                       NULL, &timeserver_clear_timer);
 }
 
 static void __network_changed_cb(keynode_t *node, void *user_data)
 }
 
 static void __network_changed_cb(keynode_t *node, void *user_data)
@@ -188,6 +184,8 @@ static void __nitz_event_cb(keynode_t *node, void *user_data)
 
 void netconfig_clock_init(void)
 {
 
 void netconfig_clock_init(void)
 {
+       gboolean automatic_time_update = FALSE;
+
        INFO("netconfig_clock_init is called");
        vconf_notify_key_changed(VCONFKEY_SETAPPL_STATE_AUTOMATIC_TIME_UPDATE_BOOL,
                        __automatic_time_update_changed_cb, NULL);
        INFO("netconfig_clock_init is called");
        vconf_notify_key_changed(VCONFKEY_SETAPPL_STATE_AUTOMATIC_TIME_UPDATE_BOOL,
                        __automatic_time_update_changed_cb, NULL);
@@ -195,6 +193,11 @@ void netconfig_clock_init(void)
                        __nitz_event_cb, NULL);
        vconf_notify_key_changed(VCONFKEY_NETWORK_STATUS,
                        __network_changed_cb, NULL);
                        __nitz_event_cb, NULL);
        vconf_notify_key_changed(VCONFKEY_NETWORK_STATUS,
                        __network_changed_cb, NULL);
+
+       netconfig_vconf_get_bool(VCONFKEY_SETAPPL_STATE_AUTOMATIC_TIME_UPDATE_BOOL, &automatic_time_update);
+
+       if (automatic_time_update == FALSE)
+               __netconfig_clock_clear_timeserver_timer(NULL);
 }
 
 void netconfig_clock_deinit(void)
 }
 
 void netconfig_clock_deinit(void)