[SPIN] Enable the ntp by connman if device does not use the cellular. 05/73305/2
authorNiraj Kumar Goit <niraj.g@samsung.com>
Tue, 7 Jun 2016 17:03:40 +0000 (22:33 +0530)
committerNiraj Kumar Goit <niraj.g@samsung.com>
Fri, 10 Jun 2016 10:18:19 +0000 (03:18 -0700)
desc : enable the ntp if the device is not using the cellualr(telephony).
This ntp is controlled by net-config. After getting the timeinfo,
connman call the alarm-manager's dbus method.

Change-Id: I83272206654b6b64c968d5dbb69354e19e971f34
Signed-off-by: Niraj Kumar Goit <niraj.g@samsung.com>
packaging/connman.spec
src/clock.c
src/main.c
src/timeserver.c

index 2ad02f6..93642e8 100755 (executable)
@@ -100,6 +100,10 @@ CFLAGS+=" -DTIZEN_TV_EXT"
 
 %if %{with connman_vpnd}
 VPN_CFLAGS+=" -DTIZEN_EXT -lsmack -Werror"
+
+%if 0%{?sec_product_feature_telephony_disable} == 1
+       CFLAGS+=" -DTIZEN_CONNMAN_NTP"
+%endif
 %endif
 
 chmod +x bootstrap
index 0fde2c3..f04cf17 100755 (executable)
@@ -241,6 +241,11 @@ static DBusMessage *set_property(DBusConnection *conn,
        type = dbus_message_iter_get_arg_type(&value);
 
        if (g_str_equal(name, "Time")) {
+#if defined TIZEN_EXT
+               /* Tizen updates time (ntp) by system service */
+
+               return __connman_error_permission_denied(msg);
+#else
                struct timeval tv;
                dbus_uint64_t newval;
 
@@ -261,6 +266,7 @@ static DBusMessage *set_property(DBusConnection *conn,
                connman_dbus_property_changed_basic(CONNMAN_MANAGER_PATH,
                                CONNMAN_CLOCK_INTERFACE, "Time",
                                DBUS_TYPE_UINT64, &newval);
+#endif
        } else if (g_str_equal(name, "TimeUpdates")) {
                const char *strval;
                enum time_updates newval;
index c594adb..5bd7e16 100755 (executable)
@@ -721,7 +721,9 @@ int main(int argc, char *argv[])
        __connman_proxy_init();
        __connman_detect_init();
        __connman_session_init();
+#if !defined TIZEN_EXT || defined TIZEN_CONNMAN_NTP
        __connman_timeserver_init();
+#endif
        __connman_connection_init();
 
        __connman_plugin_init(option_plugin, option_noplugin);
@@ -753,7 +755,9 @@ int main(int argc, char *argv[])
        __connman_plugin_cleanup();
        __connman_provider_cleanup();
        __connman_connection_cleanup();
+#if !defined TIZEN_EXT || defined TIZEN_CONNMAN_NTP
        __connman_timeserver_cleanup();
+#endif
        __connman_detect_cleanup();
        __connman_proxy_cleanup();
        __connman_task_cleanup();
index f0d33e5..8b9afb1 100755 (executable)
@@ -290,6 +290,11 @@ static void ts_recheck_enable(void)
  */
 int __connman_timeserver_sync(struct connman_service *default_service)
 {
+#if defined TIZEN_EXT && !defined TIZEN_CONNMAN_NTP
+       /* Tizen updates time (ntp) by system service */
+
+       return 0;
+#endif
        struct connman_service *service;
 
        if (default_service)