From: Jaehyun Kim Date: Fri, 11 Mar 2022 03:23:38 +0000 (+0900) Subject: Clear timeserver on boot time X-Git-Tag: submit/tizen/20220311.091913^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e99b8c16f0b226416c8fe7da52788e080cc84b07;p=platform%2Fcore%2Fconnectivity%2Fnet-config.git Clear timeserver on boot time 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 --- diff --git a/packaging/net-config.spec b/packaging/net-config.spec index 9f95e25..ae215ed 100755 --- a/packaging/net-config.spec +++ b/packaging/net-config.spec @@ -1,6 +1,6 @@ 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 diff --git a/src/network-clock.c b/src/network-clock.c index 98bf2e8..59551c4 100755 --- a/src/network-clock.c +++ b/src/network-clock.c @@ -105,7 +105,6 @@ static void __netconfig_clock_unset_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); @@ -114,9 +113,6 @@ static void __netconfig_set_timeserver(void) return; __netconfig_clock_set_timeserver((const char *)NTP_SERVER); - - netconfig_start_timer_seconds(5, __netconfig_clock_clear_timeserver_timer, - NULL, ×erver_clear_timer); } 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) { + 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); @@ -195,6 +193,11 @@ void netconfig_clock_init(void) __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)