clock: Add skeleton for timezone change function
authorMarcel Holtmann <marcel@holtmann.org>
Wed, 20 Apr 2011 06:22:19 +0000 (23:22 -0700)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 20 Apr 2011 06:22:19 +0000 (23:22 -0700)
src/clock.c
src/connman.h
src/timezone.c

index 1a1dfe8..7b3e870 100644 (file)
@@ -211,6 +211,19 @@ static DBusMessage *set_property(DBusConnection *conn,
                connman_dbus_property_changed_basic(CONNMAN_MANAGER_PATH,
                                CONNMAN_CLOCK_INTERFACE, "TimeUpdates",
                                DBUS_TYPE_STRING, &strval);
+       } else if (g_str_equal(name, "Timezone") == TRUE) {
+               const char *strval;
+
+               if (type != DBUS_TYPE_STRING)
+                       return __connman_error_invalid_arguments(msg);
+
+               if (timezone_updates_config != TIMEZONE_UPDATES_MANUAL)
+                       return __connman_error_permission_denied(msg);
+
+               dbus_message_iter_get_basic(&value, &strval);
+
+               if (__connman_timezone_change(strval) < 0)
+                        return __connman_error_invalid_arguments(msg);
        } else if (g_str_equal(name, "TimezoneUpdates") == TRUE) {
                const char *strval;
                enum timezone_updates newval;
index 1c02fb5..f80d16f 100644 (file)
@@ -63,6 +63,7 @@ int __connman_timezone_init(void);
 void __connman_timezone_cleanup(void);
 
 char *__connman_timezone_lookup(void);
+int __connman_timezone_change(const char *zone);
 
 int __connman_agent_init(void);
 void __connman_agent_cleanup(void);
index 9fa1444..e27558f 100644 (file)
@@ -268,6 +268,13 @@ done:
        return zone;
 }
 
+int __connman_timezone_change(const char *zone)
+{
+       DBG("zone %s", zone);
+
+       return -EIO;
+}
+
 static guint inotify_watch = 0;
 
 static gboolean inotify_data(GIOChannel *channel, GIOCondition cond,