From 2f57ae0efc03b1a752470de7e19f538d18e57469 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 19 Apr 2011 23:22:19 -0700 Subject: clock: Add skeleton for timezone change function --- src/clock.c | 13 +++++++++++++ src/connman.h | 1 + src/timezone.c | 7 +++++++ 3 files changed, 21 insertions(+) diff --git a/src/clock.c b/src/clock.c index 1a1dfe88..7b3e8701 100644 --- a/src/clock.c +++ b/src/clock.c @@ -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; diff --git a/src/connman.h b/src/connman.h index 1c02fb59..f80d16f7 100644 --- a/src/connman.h +++ b/src/connman.h @@ -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); diff --git a/src/timezone.c b/src/timezone.c index 9fa1444c..e27558fa 100644 --- a/src/timezone.c +++ b/src/timezone.c @@ -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, -- cgit v1.2.3