summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiraj Kumar Goit <niraj.g@samsung.com>2016-06-14 17:35:55 (GMT)
committerNiraj Kumar Goit <niraj.g@samsung.com>2016-06-14 14:30:29 (GMT)
commit46c06a384067f29cdd9f1550278cda29798db7b2 (patch)
tree561fef52be499c003ff906a7bf00e7e340b85288
parent41eeeef790db4c1c266548ce49558061143aac10 (diff)
downloadconnman-46c06a384067f29cdd9f1550278cda29798db7b2.zip
connman-46c06a384067f29cdd9f1550278cda29798db7b2.tar.gz
connman-46c06a384067f29cdd9f1550278cda29798db7b2.tar.bz2
[SPIN] change the ntp update logicrefs/changes/48/74548/3
desc : add the resolved server list into time_server list. It is only using the first item of timeserver. Not use gateway for ntp server if enabled WLAN_ALWAYS_POWERED. Change-Id: I2f55ade5b7208a7f893516b817d4ff6bffa62a04 Signed-off-by: Niraj Kumar Goit <niraj.g@samsung.com>
-rwxr-xr-xpackaging/connman.spec4
-rwxr-xr-xsrc/timeserver.c24
2 files changed, 28 insertions, 0 deletions
diff --git a/packaging/connman.spec b/packaging/connman.spec
index 23b8d52..a988b8c 100755
--- a/packaging/connman.spec
+++ b/packaging/connman.spec
@@ -109,6 +109,10 @@ VPN_CFLAGS+=" -DTIZEN_EXT -lsmack -Werror"
%if 0%{?sec_product_feature_profile_wearable}
CFLAGS+=" -DTIZEN_WEARABLE"
%endif
+
+%if 0%{?sec_product_feature_wlan_always_powered}
+ CFLAGS+=" -DTIZEN_ALWAYS_POWERED"
+%endif
%endif
chmod +x bootstrap
diff --git a/src/timeserver.c b/src/timeserver.c
index 8b9afb1..90f648c 100755
--- a/src/timeserver.c
+++ b/src/timeserver.c
@@ -88,6 +88,15 @@ static void resolv_result(GResolvResultStatus status, char **results,
{
int i;
+#if defined TIZEN_EXT
+ gchar *server = NULL;
+
+ server = (gchar *)user_data;
+ ts_list = g_slist_append(ts_list, server);
+
+ DBG("added server %s", server);
+#endif
+
DBG("status %d", status);
if (status == G_RESOLV_RESULT_STATUS_SUCCESS) {
@@ -148,8 +157,13 @@ void __connman_timeserver_sync_next()
DBG("Resolving timeserver %s", ts_current);
+#if defined TIZEN_EXT
+ resolv_id = g_resolv_lookup_hostname(resolv, ts_current,
+ resolv_result, ts_current);
+#else
resolv_id = g_resolv_lookup_hostname(resolv, ts_current,
resolv_result, NULL);
+#endif
return;
}
@@ -179,13 +193,21 @@ GSList *__connman_timeserver_add_list(GSList *server_list,
GSList *__connman_timeserver_get_all(struct connman_service *service)
{
GSList *list = NULL;
+#if !defined TIZEN_ALWAYS_POWERED
struct connman_network *network;
+#endif
char **timeservers;
char **service_ts;
char **service_ts_config;
+#if !defined TIZEN_ALWAYS_POWERED
const char *service_gw;
+#endif
char **fallback_ts;
+#if !defined TIZEN_ALWAYS_POWERED
int index, i;
+#else
+ int i;
+#endif
if (__connman_clock_timeupdates() == TIME_UPDATES_MANUAL)
return NULL;
@@ -204,6 +226,7 @@ GSList *__connman_timeserver_get_all(struct connman_service *service)
for (i = 0; service_ts && service_ts[i]; i++)
list = __connman_timeserver_add_list(list, service_ts[i]);
+#if !defined TIZEN_ALWAYS_POWERED
network = __connman_service_get_network(service);
if (network) {
index = connman_network_get_index(network);
@@ -214,6 +237,7 @@ GSList *__connman_timeserver_get_all(struct connman_service *service)
if (service_gw)
list = __connman_timeserver_add_list(list, service_gw);
}
+#endif
/* Then add Global Timeservers to the list */
timeservers = load_timeservers();