summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehyun Kim <jeik01.kim@samsung.com>2019-07-31 22:45:54 +0900
committerJaehyun Kim <jeik01.kim@samsung.com>2019-07-31 22:45:54 +0900
commit489664594c5e46f0571155a9ec58a7d8fc55b6ee (patch)
treefb45425ce8ccce8f6c90cdade10518211861d5d1
parentd9c4473ac7a38978f0c8922ddb72849320faab75 (diff)
downloadconnman-submit/tizen/20190802.071744.tar.gz
connman-submit/tizen/20190802.071744.tar.bz2
connman-submit/tizen/20190802.071744.zip
Add an option for gateway timeserver handlingsubmit/tizen/20190802.071744
Change-Id: I19f09647b7471f146adb95bc7e81fd9ab11f18ac Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
-rw-r--r--src/main.c16
-rwxr-xr-xsrc/main.conf4
-rwxr-xr-xsrc/main_disable_eth.conf4
-rwxr-xr-xsrc/main_ivi.conf4
-rwxr-xr-xsrc/main_tv.conf4
-rwxr-xr-xsrc/timeserver.c7
6 files changed, 37 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 7a6d802c..37752870 100644
--- a/src/main.c
+++ b/src/main.c
@@ -84,6 +84,7 @@ static struct {
#if defined TIZEN_EXT
char **cellular_interfaces;
bool tizen_tv_extension;
+ bool use_gateway_timeserver;
#endif
} connman_settings = {
.bg_scan = true,
@@ -105,6 +106,7 @@ static struct {
#if defined TIZEN_EXT
.cellular_interfaces = NULL,
.tizen_tv_extension = false,
+ .use_gateway_timeserver = false,
#endif
};
@@ -127,6 +129,7 @@ static struct {
#if defined TIZEN_EXT
#define CONF_CELLULAR_INTERFACE "NetworkCellularInterfaceList"
#define CONF_TIZEN_TV_EXT "TizenTVExtension"
+#define CONF_USE_GATEWAY_TIMESERVER "UseGatewayTimeserver"
#endif
static const char *supported_options[] = {
@@ -148,6 +151,7 @@ static const char *supported_options[] = {
#if defined TIZEN_EXT
CONF_CELLULAR_INTERFACE,
CONF_TIZEN_TV_EXT,
+ CONF_USE_GATEWAY_TIMESERVER,
#endif
NULL
};
@@ -285,6 +289,13 @@ static void check_Tizen_configuration(GKeyFile *config)
connman_settings.tizen_tv_extension = boolean;
g_clear_error(&error);
+
+ boolean = __connman_config_get_bool(config, "General",
+ CONF_USE_GATEWAY_TIMESERVER, &error);
+ if (!error)
+ connman_settings.use_gateway_timeserver = boolean;
+
+ g_clear_error(&error);
}
static void set_nofile_inc(void)
@@ -679,6 +690,11 @@ bool connman_setting_get_bool(const char *key)
if (g_str_equal(key, CONF_ENABLE_ONLINE_CHECK))
return connman_settings.enable_online_check;
+#if defined TIZEN_EXT
+ if (g_str_equal(key, CONF_USE_GATEWAY_TIMESERVER))
+ return connman_settings.use_gateway_timeserver;
+#endif
+
return false;
}
diff --git a/src/main.conf b/src/main.conf
index a2cc1e20..80724d52 100755
--- a/src/main.conf
+++ b/src/main.conf
@@ -124,3 +124,7 @@ SingleConnectedTechnology = true
# AlwaysConnectedTechnologies =
NetworkCellularInterfaceList = pdp,rmnet,seth_td,seth_w
+
+# Allow connman to add service gateway to the time server list.
+# Default value is false.
+# UseGatewayTimeserver = false
diff --git a/src/main_disable_eth.conf b/src/main_disable_eth.conf
index c4ec3e38..ea4a9ddb 100755
--- a/src/main_disable_eth.conf
+++ b/src/main_disable_eth.conf
@@ -108,3 +108,7 @@ SingleConnectedTechnology = true
# Enable6to4 = false
NetworkCellularInterfaceList = pdp,rmnet,seth_td,seth_w
+
+# Allow connman to add service gateway to the time server list.
+# Default value is false.
+# UseGatewayTimeserver = false
diff --git a/src/main_ivi.conf b/src/main_ivi.conf
index 627bd061..c7e65c48 100755
--- a/src/main_ivi.conf
+++ b/src/main_ivi.conf
@@ -108,3 +108,7 @@ SingleConnectedTechnology = true
# Enable6to4 = false
NetworkCellularInterfaceList = pdp,rmnet,seth_td,seth_w
+
+# Allow connman to add service gateway to the time server list.
+# Default value is false.
+# UseGatewayTimeserver = false
diff --git a/src/main_tv.conf b/src/main_tv.conf
index fd3afc90..44d1b025 100755
--- a/src/main_tv.conf
+++ b/src/main_tv.conf
@@ -109,7 +109,9 @@ SingleConnectedTechnology = true
NetworkCellularInterfaceList = pdp,rmnet,seth_td,seth_w
-
+# Allow connman to add service gateway to the time server list.
+# Default value is false.
+# UseGatewayTimeserver = false
# Enable Tizen TV Profile Features
TizenTVExtension = true
diff --git a/src/timeserver.c b/src/timeserver.c
index 6325eceb..e4cfc062 100755
--- a/src/timeserver.c
+++ b/src/timeserver.c
@@ -218,6 +218,9 @@ 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_EXT
+ if (connman_setting_get_bool("UseGatewayTimeserver")) {
+#endif
network = __connman_service_get_network(service);
if (network) {
index = connman_network_get_index(network);
@@ -228,7 +231,9 @@ GSList *__connman_timeserver_get_all(struct connman_service *service)
if (service_gw)
list = __connman_timeserver_add_list(list, service_gw);
}
-
+#if defined TIZEN_EXT
+ }
+#endif
/* Then add Global Timeservers to the list */
timeservers = load_timeservers();