From 54e2fd260916859f773a15b1fae4b6b80586d107 Mon Sep 17 00:00:00 2001 From: "jinwang.an" Date: Thu, 4 Jun 2020 13:13:19 +0900 Subject: [PATCH] Add sst_time_get_changed() Change-Id: I2280645d330e115c6e3a3f76bce4546d23338275 Signed-off-by: jinwang.an --- src/sst_core.c | 2 +- src/sst_interface.c | 2 +- src/sst_time_N_locale.c | 10 ++++++++++ src/sst_time_N_locale.h | 3 ++- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/sst_core.c b/src/sst_core.c index f0ba32c..718b58d 100644 --- a/src/sst_core.c +++ b/src/sst_core.c @@ -165,7 +165,7 @@ int sst_del_value(system_settings_key_e key, sst_interface_data_type data_type, DBG("Enter"); RETVM_IF(key < 0 || SYSTEM_SETTINGS_KEY_MAX <= key, SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER, "Invalid Key(%d)", key); - + sst_interface *iface = NULL; ret = sst_get_interface(key, &iface); if (SYSTEM_SETTINGS_ERROR_NONE != ret) { diff --git a/src/sst_interface.c b/src/sst_interface.c index 757b28f..f85e99b 100644 --- a/src/sst_interface.c +++ b/src/sst_interface.c @@ -282,7 +282,7 @@ struct _system_setting_s system_setting_table[] = { SYSTEM_SETTINGS_KEY_TIME_CHANGED, VCONFKEY_SYSTEM_TIME_CHANGED, SYSTEM_SETTING_DATA_TYPE_INT, - NULL, + sst_time_get_changed, NULL, sst_vconf_set_changed_cb, sst_vconf_unset_changed_cb, diff --git a/src/sst_time_N_locale.c b/src/sst_time_N_locale.c index b978b97..27f9b55 100644 --- a/src/sst_time_N_locale.c +++ b/src/sst_time_N_locale.c @@ -170,3 +170,13 @@ int sst_locale_set_timezone(sst_interface *iface, void *value) return SYSTEM_SETTINGS_ERROR_NONE; } + +//TODO : checking this function is being used or not. +int sst_time_get_changed(sst_interface *iface, void **value) +{ + time_t cur_tick; + int ** val = (int**)value; + cur_tick = time(NULL); + **val = cur_tick; + return SYSTEM_SETTINGS_ERROR_NONE; +} diff --git a/src/sst_time_N_locale.h b/src/sst_time_N_locale.h index cc4357c..74509ad 100644 --- a/src/sst_time_N_locale.h +++ b/src/sst_time_N_locale.h @@ -24,4 +24,5 @@ int sst_locale_set_language(sst_interface *iface, void *value); int sst_locale_get_timeformat_24hour(sst_interface *iface, void **value); int sst_locale_set_timeformat_24hour(sst_interface *iface, void *value); int sst_locale_get_timezone(sst_interface *iface, void **value); -int sst_locale_set_timezone(sst_interface *iface, void *value); \ No newline at end of file +int sst_locale_set_timezone(sst_interface *iface, void *value); +int sst_time_get_changed(sst_interface *iface, void **value); -- 2.7.4