+/* LCOV_EXCL_STOP */
+
+/* LCOV_EXCL_START */
+int system_setting_set_usb_debugging_option(system_settings_key_e key, system_setting_data_type_e data_type, void *value)
+{
+ SETTING_TRACE_BEGIN;
+ bool *vconf_value;
+ vconf_value = (bool *)value;
+ if (system_setting_vconf_set_value_bool(VCONFKEY_SETAPPL_USB_DEBUG_MODE_BOOL, *vconf_value)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+ return SYSTEM_SETTINGS_ERROR_NONE;
+
+}
+/* LCOV_EXCL_STOP */
+
+/* LCOV_EXCL_START */
+int system_setting_set_3g_data_network(system_settings_key_e key, system_setting_data_type_e data_type, void *value)
+{
+ SETTING_TRACE_BEGIN;
+ bool *vconf_value;
+ vconf_value = (bool *)value;
+ if (system_setting_vconf_set_value_bool(VCONFKEY_3G_ENABLE, *vconf_value)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+/* LCOV_EXCL_STOP */
+
+/* LCOV_EXCL_START */
+static int category_func(const char *name, void *user_data)
+{
+ SETTING_TRACE_BEGIN;
+ static char *category = "lock-screen";
+ if (name && !strcmp(name, category)) {
+ SETTING_TRACE(" SAME ");
+ return -1;
+ } else {
+ SETTING_TRACE(" DIFFERENT -- %s, category -- %s ", name, category);
+ return 0;
+ }
+
+ return 0;
+}
+/* LCOV_EXCL_STOP */
+
+/**
+ *
+ * set 'swipe type' if current lockscreen app is 'com.samsung.lockscreen'
+ *
+ */
+
+/* LCOV_EXCL_START */
+int system_setting_set_lockscreen_app(system_settings_key_e key, system_setting_data_type_e data_type, void *value)
+{
+ SETTING_TRACE_BEGIN;
+ char *vconf_value;
+ vconf_value = (char *)value; /* ex) com.samsung.lockscreen */
+
+ int r = 0;
+ pkgmgrinfo_appinfo_h handle;
+ r = pkgmgrinfo_appinfo_get_appinfo(vconf_value, &handle);
+ if (r != PMINFO_R_OK) {
+ SETTING_TRACE("*** pkginfo failed ");
+ return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
+ } else {
+ SETTING_TRACE("%x", handle);
+ }
+
+ int ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)"lock-screen");
+ if (ret != PMINFO_R_OK) {
+ pkgmgrinfo_appinfo_destroy_appinfo(handle);
+ return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
+ }
+
+ pkgmgrinfo_appinfo_destroy_appinfo(handle);
+ /*----------------------------------------------------------------------------------- */
+ int locktype = -1;
+ if (system_setting_vconf_get_value_int(VCONFKEY_SETAPPL_SCREEN_LOCK_TYPE_INT, &locktype)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+
+ if (locktype == SETTING_SCREEN_LOCK_TYPE_PASSWORD)
+ return SYSTEM_SETTINGS_ERROR_LOCKSCREEN_APP_PASSWORD_MODE;
+
+ if (system_setting_vconf_set_value_string(VCONFKEY_SETAPPL_3RD_LOCK_PKG_NAME_STR, vconf_value)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+
+ if (vconf_value && strcmp(vconf_value, "com.samsung.lockscreen") == 0) {
+ if (system_setting_vconf_set_value_int(VCONFKEY_SETAPPL_SCREEN_LOCK_TYPE_INT, SETTING_SCREEN_LOCK_TYPE_SWIPE)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+ }
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+/* LCOV_EXCL_STOP */
+
+/*/////////////////////////////////////////////////////////////////////////////////////////////// */
+/* */
+
+int system_setting_set_changed_callback_incoming_call_ringtone(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_CALL_RINGTONE_PATH_STR, SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, 0, user_data);
+}
+
+int system_setting_unset_changed_callback_incoming_call_ringtone(system_settings_key_e key)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_CALL_RINGTONE_PATH_STR, 0);
+}
+
+int system_setting_set_changed_callback_email_alert_ringtone(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR, SYSTEM_SETTINGS_KEY_EMAIL_ALERT_RINGTONE, 0, user_data);
+}
+
+int system_setting_unset_changed_callback_email_alert_ringtone(system_settings_key_e key)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR, 0);
+}
+
+int system_setting_set_changed_callback_wallpaper_home_screen(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_set_changed_cb(VCONFKEY_BGSET, SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN, 0, user_data);
+}
+
+int system_setting_unset_changed_callback_wallpaper_home_screen(system_settings_key_e key)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_BGSET, 0);
+}
+
+int system_setting_set_changed_callback_wallpaper_lock_screen(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_set_changed_cb(VCONFKEY_IDLE_LOCK_BGSET, SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN, 0, user_data);
+}
+
+int system_setting_unset_changed_callback_wallpaper_lock_screen(system_settings_key_e key)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_IDLE_LOCK_BGSET, 0);
+}
+
+int system_setting_set_changed_callback_font_size(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, SYSTEM_SETTINGS_KEY_FONT_SIZE, 1, user_data);
+}
+
+int system_setting_unset_changed_callback_font_size(system_settings_key_e key)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, 1);
+}
+
+int system_setting_set_changed_callback_usb_debugging_option(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_USB_DEBUG_MODE_BOOL, SYSTEM_SETTINGS_KEY_USB_DEBUGGING_ENABLED, 1, user_data);
+}
+
+int system_setting_unset_changed_callback_usb_debugging_option(system_settings_key_e key)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_USB_DEBUG_MODE_BOOL, 1);
+}
+
+int system_setting_set_changed_callback_3g_data_network(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_set_changed_cb(VCONFKEY_3G_ENABLE, SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED, 1, user_data);
+}
+
+int system_setting_unset_changed_callback_3g_data_network(system_settings_key_e key)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_3G_ENABLE, 1);
+}
+
+int system_setting_set_changed_callback_lockscreen_app(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_3RD_LOCK_PKG_NAME_STR, SYSTEM_SETTINGS_KEY_LOCKSCREEN_APP, 1, user_data);
+}
+
+int system_setting_unset_changed_callback_lockscreen_app(system_settings_key_e key)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_3RD_LOCK_PKG_NAME_STR, 1);
+}
+
+
+/**
+ * @todo need to add custom event notification method
+ */
+int system_setting_set_changed_callback_font_type(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME, SYSTEM_SETTINGS_KEY_FONT_TYPE, 2, user_data);
+}
+
+int system_setting_unset_changed_callback_font_type(system_settings_key_e key)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME, 2);
+}
+
+/* TODO : 2th argument, callback, is not in use. */
+int system_setting_set_changed_callback_motion_activation(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_MOTION_ACTIVATION, SYSTEM_SETTINGS_KEY_MOTION_ACTIVATION, 3, user_data);
+}
+
+int system_setting_unset_changed_callback_motion_activation(system_settings_key_e key)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_MOTION_ACTIVATION, 3);
+}
+
+/*//////////////////////////////////////////////////////////////////////////////////////// */
+/*--------------------------------------- */
+int system_setting_get_locale_country(system_settings_key_e key, system_setting_data_type_e data_type, void **value)
+{
+ SETTING_TRACE_BEGIN;
+ char *vconf_value = NULL;
+ if (system_setting_vconf_get_value_string(VCONFKEY_REGIONFORMAT, &vconf_value)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+
+ /* parsing validation */
+ /* en_US.UTF-8 */
+ char arr[20];
+ snprintf(arr, 20, "%s", vconf_value);
+ arr[5] = '\0';
+ *value = strdup(arr);
+ free(vconf_value);
+ vconf_value = NULL;
+
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+
+/* LCOV_EXCL_START */
+int system_setting_set_locale_country(system_settings_key_e key, system_setting_data_type_e data_type, void *value)
+{
+ SETTING_TRACE_BEGIN;
+ char *vconf_value = NULL;
+ vconf_value = (char *)value;
+
+ char *ext = "UTF-8";
+
+ char arr[20];
+ snprintf(arr, 20, "%s.%s", vconf_value, ext);
+
+ if (system_setting_vconf_set_value_string(VCONFKEY_REGIONFORMAT, arr)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+/* LCOV_EXCL_STOP */
+
+int system_setting_set_changed_callback_locale_country(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_set_changed_cb(VCONFKEY_REGIONFORMAT, SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY, 3, user_data);
+}
+
+int system_setting_unset_changed_callback_locale_country(system_settings_key_e key)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_REGIONFORMAT, 3);
+}
+
+
+/*--------------------------------------- */
+int system_setting_get_locale_language(system_settings_key_e key, system_setting_data_type_e data_type, void **value)
+{
+ SETTING_TRACE_BEGIN;
+ char *vconf_value = NULL;
+ if (system_setting_vconf_get_value_string(VCONFKEY_LANGSET, &vconf_value)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+
+ /* parsing validation */
+ /* en_US.UTF-8 */
+ char arr[20];
+ snprintf(arr, 20, "%s", vconf_value);
+ arr[5] = '\0';
+ *value = strdup(arr);
+ free(vconf_value);
+ vconf_value = NULL;
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+
+/* LCOV_EXCL_START */
+int system_setting_set_locale_language(system_settings_key_e key, system_setting_data_type_e data_type, void *value)
+{
+ SETTING_TRACE_BEGIN;
+ char *vconf_value = NULL;
+ vconf_value = (char *)value;
+
+ char *ext = "UTF-8";
+
+ char arr[20];
+ snprintf(arr, 20, "%s.%s", vconf_value, ext);
+
+ if (system_setting_vconf_set_value_string(VCONFKEY_LANGSET, arr)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+/* LCOV_EXCL_STOP */
+
+int system_setting_set_changed_callback_locale_language(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
+{
+ SETTING_TRACE_BEGIN;
+ /*return system_setting_vconf_set_changed_cb(VCONFKEY_LANGSET, SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, 3, user_data ); */
+ return system_setting_vconf_set_changed_cb(VCONFKEY_LANGSET, SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, 100, user_data);
+}
+
+int system_setting_unset_changed_callback_locale_language(system_settings_key_e key)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_LANGSET, 100);
+}
+
+/*--------------------------------------- */
+/* LCOV_EXCL_START */
+int system_setting_get_locale_timeformat_24hour(system_settings_key_e key, system_setting_data_type_e data_type, void **value)
+{
+ SETTING_TRACE_BEGIN;
+ int vconf_value;
+
+ if (system_setting_vconf_get_value_int(VCONFKEY_REGIONFORMAT_TIME1224, &vconf_value)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+
+ bool ret_value = true;
+ if (vconf_value == VCONFKEY_TIME_FORMAT_12)
+ ret_value = false;
+ else if (vconf_value == VCONFKEY_TIME_FORMAT_24)
+ ret_value = true;
+
+ *value = (void *)ret_value;
+
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+/* LCOV_EXCL_STOP */
+
+int system_setting_set_locale_timeformat_24hour(system_settings_key_e key, system_setting_data_type_e data_type, void *value)
+{
+ SETTING_TRACE_BEGIN;
+ bool *vconf_value;
+
+ vconf_value = (bool *)value;
+
+ if (*vconf_value) {
+ if (system_setting_vconf_set_value_int(VCONFKEY_REGIONFORMAT_TIME1224, VCONFKEY_TIME_FORMAT_24)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+
+ } else {
+ if (system_setting_vconf_set_value_int(VCONFKEY_REGIONFORMAT_TIME1224, VCONFKEY_TIME_FORMAT_12)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+
+ }
+
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+
+int system_setting_set_changed_callback_locale_timeformat_24hour(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_set_changed_cb(VCONFKEY_REGIONFORMAT_TIME1224, SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR, 3, user_data);
+}
+
+int system_setting_unset_changed_callback_locale_timeformat_24hour(system_settings_key_e key)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_REGIONFORMAT_TIME1224, 3);
+}
+
+int system_setting_get_locale_timezone(system_settings_key_e key, system_setting_data_type_e data_type, void **value)
+{
+ char tzpath[256];
+ ssize_t len = readlink(SETTING_TZONE_SYMLINK_PATH, tzpath, sizeof(tzpath)-1);
+ if (len != -1) {
+ tzpath[len] = '\0';
+ } else {
+ SETTING_TRACE("parse error for SETTING_TZONE_SYMLINK_PATH");
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+
+ SETTING_TRACE("tzpath : %s ", &tzpath[20]);
+ *value = strdup(&tzpath[20]);
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+
+/* LCOV_EXCL_START */
+int system_setting_set_locale_timezone(system_settings_key_e key, system_setting_data_type_e data_type, void *value)
+{
+ SETTING_TRACE_BEGIN;
+ char *timezone_value = NULL;
+ timezone_value = (char *)value;
+
+ char tz_path[1024];
+ snprintf(tz_path, 1024, "/usr/share/zoneinfo/%s", timezone_value);
+
+ int is_load = _is_file_accessible(tz_path);
+ if (is_load == 0) {
+ alarmmgr_set_timezone(tz_path);
+
+ if (system_setting_vconf_set_value_string(VCONFKEY_SETAPPL_TIMEZONE_ID, timezone_value)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+ return SYSTEM_SETTINGS_ERROR_NONE;
+ }
+ return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
+}
+/* LCOV_EXCL_STOP */
+
+
+
+/* LCOV_EXCL_START */
+int system_setting_set_changed_callback_locale_timezone(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
+{
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_TIMEZONE_ID, SYSTEM_SETTINGS_KEY_LOCALE_TIMEZONE, 4, user_data);
+}
+/* LCOV_EXCL_STOP */
+
+/* LCOV_EXCL_START */
+int system_setting_unset_changed_callback_locale_timezone(system_settings_key_e key)
+{
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_TIMEZONE_ID, 4);
+}
+/* LCOV_EXCL_STOP */
+
+/* LCOV_EXCL_START */
+int system_setting_set_changed_callback_locale_timezone_changed(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
+{
+ SETTING_TRACE_BEGIN;
+ return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
+}
+/* LCOV_EXCL_STOP */
+
+/* LCOV_EXCL_START */
+int system_setting_unset_changed_callback_locale_timezone_changed(system_settings_key_e key)
+{
+ SETTING_TRACE_BEGIN;
+ return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
+}
+/* LCOV_EXCL_STOP */
+
+
+/* LCOV_EXCL_START */
+int system_setting_get_time_changed(system_settings_key_e key, system_setting_data_type_e data_type, void **value)
+{
+ SETTING_TRACE_BEGIN;
+ time_t cur_tick;
+ int ** val = (int**)value;
+ cur_tick = time(NULL);
+ **val = cur_tick;
+ /* struct tm * localtime = time (cur_tick); */
+ /* printf("%s\n", ctime(&cur_tick); */
+ return SYSTEM_SETTINGS_ERROR_NONE;
+
+}
+/* LCOV_EXCL_STOP */
+
+int system_setting_set_changed_callback_time_changed(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SYSTEM_TIME_CHANGED, SYSTEM_SETTINGS_KEY_TIME_CHANGED, 3, user_data);
+}
+
+int system_setting_unset_changed_callback_time_changed(system_settings_key_e key)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SYSTEM_TIME_CHANGED, 3);
+}
+
+
+
+/* SYSTEM_SETTINGS_KEY_SOUND_LOCK */
+int system_setting_get_sound_lock(system_settings_key_e key, system_setting_data_type_e data_type, void **value)
+{
+ SETTING_TRACE_BEGIN;
+ bool vconf_value;
+
+ if (system_setting_vconf_get_value_bool(VCONFKEY_SETAPPL_SOUND_LOCK_BOOL, &vconf_value)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+ *value = (void *)vconf_value;
+
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+
+int system_setting_set_changed_callback_sound_lock(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_SOUND_LOCK_BOOL, SYSTEM_SETTINGS_KEY_SOUND_LOCK, 3, user_data);
+}
+
+int system_setting_unset_changed_callback_sound_lock(system_settings_key_e key)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_SOUND_LOCK_BOOL, 3);
+}
+
+/**
+ * a = VCONFKEY_SETAPPL_SOUND_STATUS_BOOL b = VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL
+ *
+ * a == false, b == false --> silent mode
+ * a == true, b == false --> sound mode
+ * a == false, b == true --> vibration mode
+ */
+/* LCOV_EXCL_START */
+int system_setting_get_sound_silent_mode(system_settings_key_e key, system_setting_data_type_e data_type, void **value)
+{
+ SETTING_TRACE_BEGIN;
+ bool sound_cond;
+ bool vib_cond;
+
+ bool vconf_value;
+ if (system_setting_vconf_get_value_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, &sound_cond)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+
+ if (system_setting_vconf_get_value_bool(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, &vib_cond)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+
+ if (sound_cond == false && vib_cond == false) {
+ vconf_value = true;
+ *value = (void *)vconf_value;
+ } else {
+ vconf_value = false;
+ *value = (void *)vconf_value;
+ }
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+/* LCOV_EXCL_STOP */
+
+/**
+ * a = VCONFKEY_SETAPPL_SOUND_STATUS_BOOL b = VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL
+ *
+ * a == false, b == false --> silent mode
+ * a == true, b == false --> sound mode
+ */
+int system_setting_set_sound_silent_mode(system_settings_key_e key, system_setting_data_type_e data_type, void *value)
+{
+ SETTING_TRACE_BEGIN;
+ bool *vconf_value;
+
+ vconf_value = (bool *)value;
+
+ bool vconf_sound = false;
+ bool vconf_vib = false;
+
+ if (*vconf_value) {
+ vconf_sound = false;
+ vconf_vib = false;
+ } else {
+ vconf_sound = true;
+ vconf_vib = false;
+ }
+
+ if (system_setting_vconf_set_value_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, vconf_sound)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+ if (system_setting_vconf_set_value_bool(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, vconf_vib)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+
+
+
+/* TODO */
+int system_setting_set_changed_callback_sound_silent_mode(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE, 3, user_data);
+}
+
+/* TODO */
+int system_setting_unset_changed_callback_sound_silent_mode(system_settings_key_e key)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, 3);
+}
+
+/* SYSTEM_SETTINGS_KEY_SOUND_TOUCH */
+int system_setting_get_sound_touch(system_settings_key_e key, system_setting_data_type_e data_type, void **value)
+{
+ SETTING_TRACE_BEGIN;
+ bool vconf_value;
+
+ int ret = system_setting_vconf_get_value_bool(VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL, &vconf_value);
+ if (ret != SYSTEM_SETTINGS_ERROR_NONE) {
+ return ret;
+ }
+ *value = (void *)vconf_value;
+ return ret;
+}
+
+int system_setting_set_changed_callback_sound_touch(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL, SYSTEM_SETTINGS_KEY_SOUND_TOUCH, 2, user_data);
+}
+
+int system_setting_unset_changed_callback_sound_touch(system_settings_key_e key)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL, 2);
+}
+
+#if 0
+/* SYSTEM_SETTINGS_KEY_SOUND_LOCK */
+int system_setting_get_sound_lock(system_settings_key_e key, system_setting_data_type_e data_type, void **value)
+{
+ bool vconf_value;
+
+ if (system_setting_vconf_get_value_bool(VCONFKEY_SETAPPL_SOUND_LOCK_BOOL, &vconf_value)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+ *value = (void *)vconf_value;
+
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+#endif
+
+int system_setting_get_auto_rotation_mode(system_settings_key_e key, system_setting_data_type_e data_type, void **value)
+{
+ SETTING_TRACE_BEGIN;
+ bool vconf_value;
+
+ if (system_setting_vconf_get_value_bool(VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL, &vconf_value)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+ *value = (void *)vconf_value;
+
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+
+/* LCOV_EXCL_START */
+int system_setting_set_auto_rotation_mode(system_settings_key_e key, system_setting_data_type_e data_type, void *value)
+{
+ SETTING_TRACE_BEGIN;
+ bool *vconf_value;
+ vconf_value = (bool *)value;
+ if (system_setting_vconf_set_value_bool(VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL, *vconf_value)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+/* LCOV_EXCL_STOP */
+
+int system_setting_set_changed_callback_auto_rotation_mode(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL, SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO, 2, user_data);
+}
+
+int system_setting_unset_changed_callback_auto_rotation_mode(system_settings_key_e key)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL, 2);
+}
+
+int system_setting_get_screen_backlight_time(system_settings_key_e key, system_setting_data_type_e data_type, void **value)
+{
+ SETTING_TRACE_BEGIN;
+ int vconf_value;
+ int ** val = (int**)value;
+
+ if (system_setting_vconf_get_value_int(VCONFKEY_SETAPPL_LCD_TIMEOUT_NORMAL, &vconf_value)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+ **val = vconf_value;
+
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+
+
+/* LCOV_EXCL_START */
+int system_setting_set_screen_backlight_time(system_settings_key_e key, system_setting_data_type_e data_type, void *value)
+{
+ SETTING_TRACE_BEGIN;
+ int *vconf_value;
+ vconf_value = *(int **)value;
+
+ if (!(*vconf_value > 0 && *vconf_value <= 600)) {
+ SETTING_TRACE(" ERR Betweeny here 0 ~ 600");
+ return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
+ }
+
+ if (system_setting_vconf_set_value_int(VCONFKEY_SETAPPL_LCD_TIMEOUT_NORMAL, *vconf_value)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+ SETTING_TRACE_END;
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+/* LCOV_EXCL_STOP */
+
+int system_setting_set_changed_callback_screen_backlight_time(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_LCD_TIMEOUT_NORMAL, SYSTEM_SETTINGS_KEY_SCREEN_BACKLIGHT_TIME, 2, user_data);
+}
+
+int system_setting_unset_changed_callback_screen_backlight_time(system_settings_key_e key)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_LCD_TIMEOUT_NORMAL, 2);
+}
+
+int system_setting_get_sound_notification(system_settings_key_e key, system_setting_data_type_e data_type, void **value)
+{
+ SETTING_TRACE_BEGIN;
+ char *vconf_value = NULL;
+ if (system_setting_vconf_get_value_string(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR, &vconf_value)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+
+ *value = vconf_value;
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+
+/* LCOV_EXCL_START */
+int system_setting_set_sound_notification(system_settings_key_e key, system_setting_data_type_e data_type, void *value)
+{
+ SETTING_TRACE_BEGIN;
+ char *vconf_value = NULL;
+ vconf_value = (char *)value;
+
+ int is_load = _is_file_accessible(vconf_value);
+ if (is_load == 0) {
+ //SETTING_TRACE(" system_setting_vconf_set_value_string(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR, %s) TRY", vconf_value);
+ if (system_setting_vconf_set_value_string(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR, vconf_value)) {
+ //SETTING_TRACE(" system_setting_vconf_set_value_string(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR, %s) FAIL", vconf_value);
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+ } else {
+ //SETTING_TRACE(" is_file_accessibile FAILED - system_setting_vconf_set_value_string(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR, %s) FAIL", vconf_value);
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+/* LCOV_EXCL_STOP */
+
+int system_setting_set_changed_callback_sound_notification(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR, SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION, 0, user_data);
+}
+
+int system_setting_unset_changed_callback_sound_notification(system_settings_key_e key)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR, 0);
+}
+
+int system_setting_get_notification_repetition_period(system_settings_key_e key, system_setting_data_type_e data_type, void **value)
+{
+ SETTING_TRACE_BEGIN;
+ int ** val = (int**)value;
+ int vconf_value;
+
+ if (system_setting_vconf_get_value_int(VCONFKEY_SETAPPL_NOTI_MSG_ALERT_REP_TYPE_INT, &vconf_value)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+ **val = vconf_value;
+
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+
+/* LCOV_EXCL_START */
+int system_setting_set_notification_repetition_period(system_settings_key_e key, system_setting_data_type_e data_type, void *value)
+{
+ SETTING_TRACE_BEGIN;
+ int *vconf_value;
+ vconf_value = *(int **)value;
+
+ if (system_setting_vconf_set_value_int(VCONFKEY_SETAPPL_NOTI_MSG_ALERT_REP_TYPE_INT, *vconf_value)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+ SETTING_TRACE_END;
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+/* LCOV_EXCL_STOP */
+
+int system_setting_set_changed_callback_notification_repetition_period(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_NOTI_MSG_ALERT_REP_TYPE_INT, SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION_REPETITION_PERIOD, 1, user_data);
+}
+
+int system_setting_unset_changed_callback_notification_repetition_period(system_settings_key_e key)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_NOTI_MSG_ALERT_REP_TYPE_INT, 1);
+}
+
+int system_setting_get_device_name(system_settings_key_e key, system_setting_data_type_e data_type, void **value)
+{
+ SETTING_TRACE_BEGIN;
+ char *vconf_value = NULL;
+ if (system_setting_vconf_get_value_string(VCONFKEY_SETAPPL_DEVICE_NAME_STR, &vconf_value)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+
+ *value = vconf_value;
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+
+/* LCOV_EXCL_START */
+int system_setting_set_device_name(system_settings_key_e key, system_setting_data_type_e data_type, void *value)
+{
+ SETTING_TRACE_BEGIN;
+ char *vconf_value = NULL;
+ vconf_value = (char *)value;
+
+ if (system_setting_vconf_set_value_string(VCONFKEY_SETAPPL_DEVICE_NAME_STR, vconf_value)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+/* LCOV_EXCL_STOP */
+
+int system_setting_set_changed_callback_device_name(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_DEVICE_NAME_STR, SYSTEM_SETTINGS_KEY_DEVICE_NAME, 0, user_data);
+}
+
+int system_setting_unset_changed_callback_device_name(system_settings_key_e key)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_DEVICE_NAME_STR, 0);
+}
+
+/*---------------------------------------------- */
+int system_setting_get_network_flight_mode(system_settings_key_e key, system_setting_data_type_e data_type, void **value)
+{
+ SETTING_TRACE_BEGIN;
+ bool vconf_value;
+ if (system_setting_vconf_get_value_bool(VCONFKEY_TELEPHONY_FLIGHT_MODE, &vconf_value)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+ *value = (void *)vconf_value;
+
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+
+int system_setting_set_changed_callback_network_flight_mode(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_set_changed_cb(VCONFKEY_TELEPHONY_FLIGHT_MODE, SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE, 3, user_data);
+}
+
+int system_setting_unset_changed_callback_network_flight_mode(system_settings_key_e key)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_TELEPHONY_FLIGHT_MODE, 3);
+}
+
+int system_setting_get_network_wifi_notification(system_settings_key_e key, system_setting_data_type_e data_type, void **value)
+{
+ SETTING_TRACE_BEGIN;
+ int vconf_value;
+ if (system_setting_vconf_get_value_int(VCONFKEY_WIFI_ENABLE_QS, &vconf_value)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+ bool bret ;
+ bret = (vconf_value == VCONFKEY_WIFI_QS_ENABLE) ? true : false;
+
+ *value = (void *)bret;
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+
+int system_setting_set_changed_callback_network_wifi_notification(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_set_changed_cb(VCONFKEY_WIFI_ENABLE_QS, SYSTEM_SETTINGS_KEY_NETWORK_WIFI_NOTIFICATION, 4, user_data);
+}
+
+int system_setting_unset_changed_callback_network_wifi_notification(system_settings_key_e key)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_WIFI_ENABLE_QS, 4);
+}
+
+/* LCOV_EXCL_START */
+int system_setting_get_lock_state(system_settings_key_e key, system_setting_data_type_e data_type, void **value)
+{
+ int vconf_value;
+ int ** val = (int**)value;
+
+ if (system_setting_vconf_get_value_int(VCONFKEY_IDLE_LOCK_STATE_READ_ONLY, &vconf_value)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+ **val = vconf_value;
+
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+/* LCOV_EXCL_STOP */
+
+/* LCOV_EXCL_START */
+int system_setting_set_lock_state(system_settings_key_e key, system_setting_data_type_e data_type, void *value)
+{
+ SETTING_TRACE_BEGIN;
+ int *vconf_value;
+ vconf_value = *(int **)value;
+
+ if (system_setting_vconf_set_value_int(VCONFKEY_IDLE_LOCK_STATE_READ_ONLY, *vconf_value)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+ SETTING_TRACE_END;
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+/* LCOV_EXCL_STOP */
+
+/* LCOV_EXCL_START */
+int system_setting_set_changed_callback_lock_state(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
+{
+ return system_setting_vconf_set_changed_cb(VCONFKEY_IDLE_LOCK_STATE_READ_ONLY, SYSTEM_SETTINGS_KEY_LOCK_STATE, 4, user_data);
+}
+/* LCOV_EXCL_STOP */
+
+/* LCOV_EXCL_START */
+int system_setting_unset_changed_callback_lock_state(system_settings_key_e key)
+{
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_IDLE_LOCK_STATE_READ_ONLY, 4);
+}
+/* LCOV_EXCL_STOP */
+
+//----------------------------------------------------------------------------------------------------------------------------
+
+#define DEFAULT_ADS_ID "00000000-0000-0000-0000-000000000000"
+
+int system_setting_get_ads_id(system_settings_key_e key, system_setting_data_type_e data_type, void **value)
+{
+ SETTING_TRACE_BEGIN;
+ int optout_value = 0;
+ if (system_setting_vconf_get_value_int(VCONFKEY_SETAPPL_AD_ID_OPT_OUT, &optout_value)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+
+ if (optout_value == 1) {
+ *value = strdup(DEFAULT_ADS_ID);
+ return SYSTEM_SETTINGS_ERROR_NONE;
+ }
+
+ char *vconf_value = NULL;
+ if (system_setting_vconf_get_value_string(VCONFKEY_SETAPPL_AD_ID, &vconf_value)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+
+ *value = vconf_value;
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+
+
+#if 0
+void make_ad_id(void)
+{
+ uuid_t uuid_value;
+ char uuid_unparsed[50] = {0};
+ uuid_generate(uuid_value);
+ uuid_unparse(uuid_value, uuid_unparsed);
+ system_setting_set_ad_id(key, uuid_unparsed); //example of setting the value
+}
+#endif
+/* LCOV_EXCL_START */
+int system_setting_set_ads_id(system_settings_key_e key, system_setting_data_type_e data_type, void *value)
+{
+ SETTING_TRACE_BEGIN;
+ char *vconf_value = NULL;
+ vconf_value = (char *)value;
+
+ if (system_setting_vconf_set_value_string(VCONFKEY_SETAPPL_AD_ID, vconf_value)) {
+ SETTING_TRACE("Setting VCONFKEY_SETAPPL_AD_ID failed");
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+/* LCOV_EXCL_STOP */
+
+int system_setting_set_changed_callback_ads_id(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_AD_ID, SYSTEM_SETTINGS_KEY_ADS_ID, 0, user_data);
+}
+
+int system_setting_unset_changed_callback_ads_id(system_settings_key_e key)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_AD_ID, 0);
+}
+
+