diff options
author | Jaehyun Kim <jeik01.kim@samsung.com> | 2021-07-19 16:36:36 +0900 |
---|---|---|
committer | Jaehyun Kim <jeik01.kim@samsung.com> | 2021-07-19 16:41:49 +0900 |
commit | a01a64f7444af4734621ba43af3f11216891e245 (patch) | |
tree | d134a5f814c808b78fd5f357891fe1864f71d879 /src/clock.c | |
parent | fac1c8b4bd3f6853d8548ad40902fdf25b345f94 (diff) | |
download | connman-a01a64f7444af4734621ba43af3f11216891e245.tar.gz connman-a01a64f7444af4734621ba43af3f11216891e245.tar.bz2 connman-a01a64f7444af4734621ba43af3f11216891e245.zip |
Added a dbus property 'TimeUpdated'submit/tizen/20210723.060030accepted/tizen/unified/20210726.135508
A property has been added to indicate
whether the time has been updated by NTP.
Change-Id: I86b8a0c2df377168f98656618efd82bb7da91800
Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
Diffstat (limited to 'src/clock.c')
-rwxr-xr-x | src/clock.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/clock.c b/src/clock.c index f04cf175..40729b2e 100755 --- a/src/clock.c +++ b/src/clock.c @@ -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) { @@ -175,6 +178,9 @@ static DBusMessage *get_properties(DBusConnection *conn, DBusMessageIter array, dict; struct timeval tv; const char *str; +#if defined TIZEN_EXT + dbus_bool_t val = time_updated; +#endif DBG("conn %p", conn); @@ -186,6 +192,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; @@ -392,6 +404,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(""); |