Merge tag 'upstream/1.40' into tizen.
[platform/upstream/connman.git] / src / clock.c
old mode 100644 (file)
new mode 100755 (executable)
index 906538a..58a52c0
@@ -39,6 +39,9 @@ static enum time_updates time_updates_config = TIME_UPDATES_AUTO;
 static enum timezone_updates timezone_updates_config = TIMEZONE_UPDATES_AUTO;
 
 static char *timezone_config = NULL;
+#if defined TIZEN_EXT
+static bool time_updated = false;
+#endif
 
 static const char *time_updates2string(enum time_updates value)
 {
@@ -176,6 +179,9 @@ static DBusMessage *get_properties(DBusConnection *conn,
        dbus_bool_t is_synced;
        struct timeval tv;
        const char *str;
+#if defined TIZEN_EXT
+       dbus_bool_t val = time_updated;
+#endif
 
        DBG("conn %p", conn);
 
@@ -187,6 +193,12 @@ static DBusMessage *get_properties(DBusConnection *conn,
 
        connman_dbus_dict_open(&array, &dict);
 
+#if defined TIZEN_EXT
+       connman_dbus_dict_append_basic(&dict, "TimeUpdated",
+                                               DBUS_TYPE_BOOLEAN,
+                                               &val);
+#endif
+
        if (gettimeofday(&tv, NULL) == 0) {
                dbus_uint64_t val = tv.tv_sec;
 
@@ -246,6 +258,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;
 
@@ -267,6 +284,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;
@@ -401,6 +419,13 @@ static const GDBusSignalTable clock_signals[] = {
 
 static DBusConnection *connection = NULL;
 
+#if defined TIZEN_EXT
+void __connman_clock_set_time_updated(bool updated)
+{
+       time_updated = updated;
+}
+#endif
+
 void __connman_clock_update_timezone(void)
 {
        DBG("");