#include <dlfcn.h>
#include <string.h>
+#include <libgen.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
-#include <aul.h>
-
#include <regex.h>
+#include <aul.h>
#include <dlog.h>
#include <vconf.h>
int system_setting_get_incoming_call_ringtone(system_settings_key_e key, void **value)
{
SETTING_TRACE_BEGIN;
- char *vconf_value;
+ char *vconf_value = NULL;
if (system_setting_vconf_get_value_string(VCONFKEY_SETAPPL_CALL_RINGTONE_PATH_STR, &vconf_value)) {
return SYSTEM_SETTINGS_ERROR_IO_ERROR;
}
*value = vconf_value;
} else { /* not zero on errro */
*value = vconf_get_str(VCONFKEY_SETAPPL_CALL_RINGTONE_DEFAULT_PATH_STR);
+ free(vconf_value);
}
/**value = vconf_value; */
int system_setting_get_email_alert_ringtone(system_settings_key_e key, void **value)
{
SETTING_TRACE_BEGIN;
- char *vconf_value;
+ 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;
} else { /* not zero on errro */
*value = vconf_get_str(VCONFKEY_SETAPPL_NOTI_RINGTONE_DEFAULT_PATH_STR);
+ free(vconf_value);
}
return SYSTEM_SETTINGS_ERROR_NONE;
}
if (pkg_name && strcmp(pkg_name, "com.samsung.lockscreen") == 0 && locktype == SETTING_SCREEN_LOCK_TYPE_PASSWORD) {
+ free(pkg_name);
return SYSTEM_SETTINGS_ERROR_LOCKSCREEN_APP_PASSWORD_MODE;
}
#define USR_RINGTONE_FILE_PATH "/home/owner/content/Sounds/Ringtones"
#define JSONFILE "/opt/home/owner/apps_rw/org.tizen.setting/data/.user-ringtones.json"
-#if 0
-static char* _get_json_file_path()
-{
- // for testing
- return JSONFILE;
-}
-#endif
-
int system_setting_add_incoming_call_ringtone(system_settings_key_e key, void *value)
{
SETTING_TRACE_BEGIN;
}
-static int _compare_cb(const void *d1, const void *d2)
+/* LCOV_EXCL_START */
+gint _compare_cb(gconstpointer d1, gconstpointer d2)
{
fileNodeInfo *pNode1 = (fileNodeInfo *)d1;
fileNodeInfo *pNode2 = (fileNodeInfo *)d2;
return strcmp(pNode1->media_name, pNode2->media_name);
}
+/* LCOV_EXCL_STOP */
/*
* get the RINGTONE list
{
SETTING_TRACE_BEGIN;
/*Get file list */
- Eina_List *filelist = NULL;
- Eina_List *l = NULL;
+ GList *filelist = NULL;
+ GList *iter;
fileNodeInfo *node = NULL;
int idx = 0;
if (ret != 0) {
SETTING_TRACE("Failed to get filelist, ret = %d %s", ret, DEF_RINGTONE_FILE_PATH);
}
- filelist = eina_list_sort(filelist, eina_list_count(filelist), _compare_cb);
- EINA_LIST_FOREACH(filelist, l, node)
- {
+ filelist = g_list_sort(filelist, _compare_cb);
+
+ for (iter = filelist; iter != NULL; iter = g_list_next(iter)) {
+ node = (fileNodeInfo *)iter->data;
SETTING_TRACE("file path = (%d) : name:%s path:%s [%s]", ret, node->name, node->path, node->media_name);
// @todo assert NULL check
if (callback) {
}
}
- l = NULL;
- node = NULL;
- EINA_LIST_FOREACH(filelist, l, node)
- {
+ for (iter = filelist; iter != NULL; iter = g_list_next(iter)) {
+ node = (fileNodeInfo *)iter->data;
FREE(node->path);
FREE(node->name);
FREE(node->media_name);
FREE(node);
}
- eina_list_free(filelist);
+ g_list_free(filelist);
filelist = NULL;
}
char *nameval = (char *)json_object_get_string_member(ringtone, "name");
char *pathval = (char *)json_object_get_string_member(ringtone, "path");
SETTING_TRACE("(%s) --- (%s) \n", nameval, pathval);
- if (callback) {
+ if (callback && pathval) {
char* path = strdup(pathval);
bool ret = callback(i, (void *)(path), data);
if (ret == false) {
SETTING_TRACE("quit the iteration by return value == false : %d", ret);
break;
}
+ FREE(path);
} else {
SETTING_TRACE("--> callback is NULL");
}
}
+
+ g_object_unref(parser);
}
int system_setting_list_incoming_call_ringtone(system_settings_key_e key, system_settings_iter_cb callback, void *data)
SETTING_TRACE("*** pkginfo failed ");
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
} else {
- SETTING_TRACE("%x", handle);
+ SETTING_TRACE("%p", handle);
}
int ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)"lock-screen");
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);
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_CALL_RINGTONE_PATH_STR, SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, SYSTEM_SETTING_CALLBACK_SLOT_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);
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_CALL_RINGTONE_PATH_STR, SYSTEM_SETTING_CALLBACK_SLOT_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);
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR, SYSTEM_SETTINGS_KEY_EMAIL_ALERT_RINGTONE, SYSTEM_SETTING_CALLBACK_SLOT_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);
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR, SYSTEM_SETTING_CALLBACK_SLOT_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);
+ return system_setting_vconf_set_changed_cb(VCONFKEY_BGSET, SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN, SYSTEM_SETTING_CALLBACK_SLOT_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);
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_BGSET, SYSTEM_SETTING_CALLBACK_SLOT_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);
+ return system_setting_vconf_set_changed_cb(VCONFKEY_IDLE_LOCK_BGSET, SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN, SYSTEM_SETTING_CALLBACK_SLOT_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);
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_IDLE_LOCK_BGSET, SYSTEM_SETTING_CALLBACK_SLOT_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);
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, SYSTEM_SETTINGS_KEY_FONT_SIZE, SYSTEM_SETTING_CALLBACK_SLOT_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);
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, SYSTEM_SETTING_CALLBACK_SLOT_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);
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_USB_DEBUG_MODE_BOOL, SYSTEM_SETTINGS_KEY_USB_DEBUGGING_ENABLED, SYSTEM_SETTING_CALLBACK_SLOT_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);
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_USB_DEBUG_MODE_BOOL, SYSTEM_SETTING_CALLBACK_SLOT_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);
+ return system_setting_vconf_set_changed_cb(VCONFKEY_3G_ENABLE, SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED, SYSTEM_SETTING_CALLBACK_SLOT_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);
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_3G_ENABLE, SYSTEM_SETTING_CALLBACK_SLOT_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);
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_3RD_LOCK_PKG_NAME_STR, SYSTEM_SETTINGS_KEY_LOCKSCREEN_APP, SYSTEM_SETTING_CALLBACK_SLOT_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);
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_3RD_LOCK_PKG_NAME_STR, SYSTEM_SETTING_CALLBACK_SLOT_1);
}
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);
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME, SYSTEM_SETTINGS_KEY_FONT_TYPE, SYSTEM_SETTING_CALLBACK_SLOT_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);
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME, SYSTEM_SETTING_CALLBACK_SLOT_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);
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_MOTION_ACTIVATION, SYSTEM_SETTINGS_KEY_MOTION_ACTIVATION, SYSTEM_SETTING_CALLBACK_SLOT_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);
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_MOTION_ACTIVATION, SYSTEM_SETTING_CALLBACK_SLOT_3);
}
/*//////////////////////////////////////////////////////////////////////////////////////// */
/* parsing validation */
/* en_US.UTF-8 */
- char arr[20];
+ char arr[21] = {0,};
snprintf(arr, 20, "%s", vconf_value);
- arr[5] = '\0';
+ for (int i = 0; i < strlen(arr); i++) {
+ if ('.' == arr[i]) {
+ arr[i] = 0;
+ SETTING_TRACE("replace . to NULL : %d", i);
+ break;
+ }
+ }
*value = strdup(arr);
free(vconf_value);
vconf_value = NULL;
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);
+ return system_setting_vconf_set_changed_cb(VCONFKEY_REGIONFORMAT, SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY, SYSTEM_SETTING_CALLBACK_SLOT_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);
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_REGIONFORMAT, SYSTEM_SETTING_CALLBACK_SLOT_3);
}
/* parsing validation */
/* en_US.UTF-8 */
- char arr[20];
+ char arr[21] = {0,};
snprintf(arr, 20, "%s", vconf_value);
- arr[5] = '\0';
+ for (int i = 0; i < strlen(arr); i++) {
+ if ('.' == arr[i]) {
+ arr[i] = 0;
+ SETTING_TRACE("replace . to NULL : %d", i);
+ break;
+ }
+ }
*value = strdup(arr);
free(vconf_value);
vconf_value = NULL;
{
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);
+ return system_setting_vconf_set_changed_cb(VCONFKEY_LANGSET, SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, SYSTEM_SETTING_CALLBACK_SLOT_5, 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);
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_LANGSET, SYSTEM_SETTING_CALLBACK_SLOT_5);
}
/*--------------------------------------- */
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);
+ return system_setting_vconf_set_changed_cb(VCONFKEY_REGIONFORMAT_TIME1224, SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR, SYSTEM_SETTING_CALLBACK_SLOT_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);
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_REGIONFORMAT_TIME1224, SYSTEM_SETTING_CALLBACK_SLOT_3);
}
int system_setting_get_locale_timezone(system_settings_key_e key, void **value)
/* 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);
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_TIMEZONE_ID, SYSTEM_SETTINGS_KEY_LOCALE_TIMEZONE, SYSTEM_SETTING_CALLBACK_SLOT_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);
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_TIMEZONE_ID, SYSTEM_SETTING_CALLBACK_SLOT_4);
}
/* 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);
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SYSTEM_TIME_CHANGED, SYSTEM_SETTINGS_KEY_TIME_CHANGED, SYSTEM_SETTING_CALLBACK_SLOT_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);
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SYSTEM_TIME_CHANGED, SYSTEM_SETTING_CALLBACK_SLOT_3);
}
-
-
/* SYSTEM_SETTINGS_KEY_SOUND_LOCK */
int system_setting_get_sound_lock(system_settings_key_e key, void **value)
{
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);
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_SOUND_LOCK_BOOL, SYSTEM_SETTINGS_KEY_SOUND_LOCK, SYSTEM_SETTING_CALLBACK_SLOT_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);
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_SOUND_LOCK_BOOL, SYSTEM_SETTING_CALLBACK_SLOT_3);
}
/**
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);
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE, SYSTEM_SETTING_CALLBACK_SLOT_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);
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, SYSTEM_SETTING_CALLBACK_SLOT_3);
}
/* SYSTEM_SETTINGS_KEY_SOUND_TOUCH */
return ret;
}
-int system_setting_set_changed_callback_sound_touch(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
+int system_setting_set_sound_touch(system_settings_key_e key, void *value)
{
SETTING_TRACE_BEGIN;
- return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL, SYSTEM_SETTINGS_KEY_SOUND_TOUCH, 2, user_data);
+ return system_setting_vconf_set_value_bool(VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL, *(bool *)value);
}
-int system_setting_unset_changed_callback_sound_touch(system_settings_key_e key)
+
+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_unset_changed_cb(VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL, 2);
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL, SYSTEM_SETTINGS_KEY_SOUND_TOUCH, SYSTEM_SETTING_CALLBACK_SLOT_2, user_data);
}
-#if 0
-/* SYSTEM_SETTINGS_KEY_SOUND_LOCK */
-int system_setting_get_sound_lock(system_settings_key_e key, void **value)
+int system_setting_unset_changed_callback_sound_touch(system_settings_key_e key)
{
- 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;
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL, SYSTEM_SETTING_CALLBACK_SLOT_2);
}
-#endif
int system_setting_get_auto_rotation_mode(system_settings_key_e key, void **value)
{
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);
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL, SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO, SYSTEM_SETTING_CALLBACK_SLOT_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);
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL, SYSTEM_SETTING_CALLBACK_SLOT_2);
}
int system_setting_get_screen_backlight_time(system_settings_key_e key, void **value)
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);
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_LCD_TIMEOUT_NORMAL, SYSTEM_SETTINGS_KEY_SCREEN_BACKLIGHT_TIME, SYSTEM_SETTING_CALLBACK_SLOT_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);
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_LCD_TIMEOUT_NORMAL, SYSTEM_SETTING_CALLBACK_SLOT_2);
}
int system_setting_get_sound_notification(system_settings_key_e key, void **value)
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);
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR, SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION, SYSTEM_SETTING_CALLBACK_SLOT_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);
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR, SYSTEM_SETTING_CALLBACK_SLOT_0);
}
int system_setting_get_notification_repetition_period(system_settings_key_e key, void **value)
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);
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_NOTI_MSG_ALERT_REP_TYPE_INT, SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION_REPETITION_PERIOD, SYSTEM_SETTING_CALLBACK_SLOT_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);
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_NOTI_MSG_ALERT_REP_TYPE_INT, SYSTEM_SETTING_CALLBACK_SLOT_1);
}
int system_setting_get_device_name(system_settings_key_e key, void **value)
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);
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_DEVICE_NAME_STR, SYSTEM_SETTINGS_KEY_DEVICE_NAME, SYSTEM_SETTING_CALLBACK_SLOT_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);
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_DEVICE_NAME_STR, SYSTEM_SETTING_CALLBACK_SLOT_0);
}
/*---------------------------------------------- */
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);
+ return system_setting_vconf_set_changed_cb(VCONFKEY_TELEPHONY_FLIGHT_MODE, SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE, SYSTEM_SETTING_CALLBACK_SLOT_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);
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_TELEPHONY_FLIGHT_MODE, SYSTEM_SETTING_CALLBACK_SLOT_3);
}
int system_setting_get_network_wifi_notification(system_settings_key_e key, void **value)
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);
+ return system_setting_vconf_set_changed_cb(VCONFKEY_WIFI_ENABLE_QS, SYSTEM_SETTINGS_KEY_NETWORK_WIFI_NOTIFICATION, SYSTEM_SETTING_CALLBACK_SLOT_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);
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_WIFI_ENABLE_QS, SYSTEM_SETTING_CALLBACK_SLOT_4);
}
/* LCOV_EXCL_START */
/* 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);
+ return system_setting_vconf_set_changed_cb(VCONFKEY_IDLE_LOCK_STATE_READ_ONLY, SYSTEM_SETTINGS_KEY_LOCK_STATE, SYSTEM_SETTING_CALLBACK_SLOT_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);
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_IDLE_LOCK_STATE_READ_ONLY, SYSTEM_SETTING_CALLBACK_SLOT_4);
}
/* LCOV_EXCL_STOP */
}
-#if 0
+#if DEBUG_DUMP_CONTEXT
void make_ad_id(void)
{
uuid_t uuid_value;
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, void *value)
{
SETTING_TRACE_BEGIN;
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);
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_AD_ID, SYSTEM_SETTINGS_KEY_ADS_ID, SYSTEM_SETTING_CALLBACK_SLOT_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);
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_AD_ID, SYSTEM_SETTING_CALLBACK_SLOT_0);
}
int system_settings_feature_check_bool(char *path)
{
- bool profile_data = false;
- int ret = system_info_get_platform_bool(path, &profile_data);
+ bool feature_data = false;
+ int ret = system_info_get_platform_bool(path, &feature_data);
if (ret != SYSTEM_INFO_ERROR_NONE) {
- SETTING_TRACE("Setting - reading profile string failed, %d", ret);
+ SETTING_TRACE("Setting - reading feature data failed, %d", ret);
return SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
}
- ret = (profile_data == true) ? SYSTEM_SETTINGS_ERROR_NONE : SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
+ ret = (feature_data == true) ? SYSTEM_SETTINGS_ERROR_NONE : SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
return ret;
}
-int system_setting_feature_check_incoming_call(void * value)
+int system_setting_feature_check_incoming_call(void *value)
{
static bool first_query = true;
static int ret = SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
return ret;
}
-int system_setting_feature_check_home_screen(void * value)
+int system_setting_feature_check_home_screen(void *value)
{
static bool first_query = true;
static int ret = SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
return ret;
}
-int system_setting_feature_check_lock_screen(void * value)
+int system_setting_feature_check_lock_screen(void *value)
{
static bool first_query = true;
static int ret = SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
return ret;
}
-int system_setting_feature_check_notification_email(void * value)
+int system_setting_feature_check_notification_email(void *value)
{
static bool first_query = true;
static int ret = SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
return ret;
}
-int system_setting_feature_check_wifi(void * value)
+int system_setting_feature_check_wifi(void *value)
{
static bool first_query = true;
static int ret = SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
return ret;
}
-int system_setting_feature_check_telephony(void * value)
+int system_setting_feature_check_telephony(void *value)
{
static bool first_query = true;
static int ret = SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
}
-int system_setting_feature_check_font(void * value)
+int system_setting_feature_check_font(void *value)
{
static bool first_query = true;
static int ret = SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
return ret;
}
+
+int system_setting_feature_check_accessibility_grayscale(void *value)
+{
+ static bool first_query = true;
+ static int ret = SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
+
+ if (first_query == true) {
+ ret = system_settings_feature_check_bool(SETTING_ACCESSIBILITY_GRAYSCALE_PATH);
+ first_query = false;
+ }
+
+ return ret;
+}
+
+int system_setting_feature_check_accessibility_negative(void *value)
+{
+ static bool first_query = true;
+ static int ret = SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
+
+ if (first_query == true) {
+ ret = system_settings_feature_check_bool(SETTING_ACCESSIBILITY_NEGATIVE_PATH);
+ first_query = false;
+ }
+
+ return ret;
+}
+
+int system_setting_feature_check_wearable_profile(void *value)
+{
+ static bool first_query = true;
+ static int ret = SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
+
+ if (first_query == true) {
+ char *profile_data = NULL;
+ int rotary_feature = SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
+ ret = system_info_get_platform_string(SETTING_PROFILE_PATH, &profile_data);
+ if (ret != SYSTEM_INFO_ERROR_NONE) {
+ SETTING_TRACE("Setting - reading profile string failed, %d", ret);
+ return SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
+ }
+
+ rotary_feature = system_settings_feature_check_bool(SETTING_INPUT_ROTATING_BEZEL_PATH);
+
+ if ((rotary_feature == SYSTEM_SETTINGS_ERROR_NONE) && profile_data && !strcmp(profile_data, "wearable"))
+ ret = SYSTEM_SETTINGS_ERROR_NONE;
+ else
+ ret = SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
+
+ if (profile_data)
+ free(profile_data);
+
+ first_query = false;
+ }
+
+ return ret;
+}
+
/* LCOV_EXCL_START */
int system_setting_get_uds_state(system_settings_key_e key, void **value)
{
char *app_id = NULL;
char *package_id = NULL;
pid_t pid = getpid();
- app_manager_get_app_id(pid, &app_id);
+
+ int ret = app_manager_get_app_id(pid, &app_id);
+ if (ret != APP_MANAGER_ERROR_NONE) {
+ free(vconf_string_value);
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
if (app_id) {
- package_manager_get_package_id_by_app_id(app_id, &package_id);
+ int result = 0;
+ result = package_manager_get_package_id_by_app_id(app_id, &package_id);
+ if (result != PACKAGE_MANAGER_ERROR_NONE) {
+ SETTING_TRACE("package_manager_get_package_id_by_app_id returned error! %d", result);
+ free(app_id);
+ free(vconf_string_value);
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+
SETTING_TRACE("[%s] udsm_pkg_list : %s", __FUNCTION__, vconf_string_value);
}
}
}
- if (vconf_string_value)
- free(vconf_string_value);
+ free(vconf_string_value);
}
}
/* LCOV_EXCL_START */
int system_setting_set_changed_callback_uds_state(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
{
- return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_UDSM, SYSTEM_SETTINGS_KEY_ULTRA_DATA_SAVE, 4, user_data);
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_UDSM, SYSTEM_SETTINGS_KEY_ULTRA_DATA_SAVE, SYSTEM_SETTING_CALLBACK_SLOT_4, user_data);
}
/* LCOV_EXCL_STOP */
/* LCOV_EXCL_START */
int system_setting_unset_changed_callback_uds_state(system_settings_key_e key)
{
- return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_UDSM, 4);
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_UDSM, SYSTEM_SETTING_CALLBACK_SLOT_4);
}
/* LCOV_EXCL_STOP */
/* LCOV_EXCL_START */
int system_setting_set_changed_callback_uds_pkg_list(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
{
- return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_UDSM_PKGID_LIST, SYSTEM_SETTINGS_KEY_ULTRA_DATA_SAVE_PKG_LIST, 4, user_data);
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_UDSM_PKGID_LIST, SYSTEM_SETTINGS_KEY_ULTRA_DATA_SAVE_PKG_LIST, SYSTEM_SETTING_CALLBACK_SLOT_4, user_data);
}
/* LCOV_EXCL_STOP */
/* LCOV_EXCL_START */
int system_setting_unset_changed_callback_uds_pkg_list(system_settings_key_e key)
{
- return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_UDSM_PKGID_LIST, 4);
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_UDSM_PKGID_LIST, SYSTEM_SETTING_CALLBACK_SLOT_4);
}
/* LCOV_EXCL_STOP */
return ret;
}
+/* LCOV_EXCL_START */
+int system_setting_set_accessibility_tts(system_settings_key_e key, void *value)
+{
+ SETTING_TRACE_BEGIN;
+ bool *vconf_value;
+ vconf_value = (bool *)value;
+ if (system_setting_vconf_set_value_bool(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, *vconf_value)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+/* LCOV_EXCL_STOP */
+
int system_setting_set_changed_callback_accessibility_tts(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_TTS, SYSTEM_SETTINGS_KEY_ACCESSIBILITY_TTS, 2, user_data);
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, SYSTEM_SETTINGS_KEY_ACCESSIBILITY_TTS, SYSTEM_SETTING_CALLBACK_SLOT_2, user_data);
}
int system_setting_unset_changed_callback_accessibility_tts(system_settings_key_e key)
{
SETTING_TRACE_BEGIN;
- return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, 2);
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, SYSTEM_SETTING_CALLBACK_SLOT_2);
}
/* SYSTEM_SETTINGS_KEY_VIBRATION */
int system_setting_set_changed_callback_vibration(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_VIBRATION_STATUS_BOOL, SYSTEM_SETTINGS_KEY_VIBRATION, 2, user_data);
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, SYSTEM_SETTINGS_KEY_VIBRATION, SYSTEM_SETTING_CALLBACK_SLOT_2, user_data);
}
int system_setting_unset_changed_callback_vibration(system_settings_key_e key)
{
SETTING_TRACE_BEGIN;
- return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, 2);
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, SYSTEM_SETTING_CALLBACK_SLOT_2);
}
-#ifdef UNIT_TEST
-static void simple_test_case(void)
+/* SYSTEM_SETTINGS_KEY_AUTOMATIC_TIME_UPDATE */
+int system_setting_get_automatic_time_update(system_settings_key_e key, void **value)
{
- /* a suitable test */
- g_assert(g_bit_storage(1) == 1);
+ SETTING_TRACE_BEGIN;
+ bool vconf_value;
+
+ if (system_setting_vconf_get_value_bool(VCONFKEY_SETAPPL_STATE_AUTOMATIC_TIME_UPDATE_BOOL, &vconf_value)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+ *value = (void *)vconf_value;
- /* a test with verbose error message */
- g_assert_cmpint(g_bit_storage(1), ==, 1);
+ return SYSTEM_SETTINGS_ERROR_NONE;
}
-static void simple_test_case02(void)
+/* LCOV_EXCL_START */
+int system_setting_set_automatic_time_update(system_settings_key_e key, void *value)
{
- /* a suitable test */
- g_assert(g_bit_storage(1) == 1);
+ SETTING_TRACE_BEGIN;
+ bool *vconf_value;
+ vconf_value = (bool *)value;
+ if (system_setting_vconf_set_value_bool(VCONFKEY_SETAPPL_STATE_AUTOMATIC_TIME_UPDATE_BOOL, *vconf_value)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
- /* a test with verbose error message */
- g_assert_cmpint(g_bit_storage(1), ==, 1);
+ return SYSTEM_SETTINGS_ERROR_NONE;
}
-void unittest_platform()
+/* LCOV_EXCL_STOP */
+
+int system_setting_set_changed_callback_automatic_time_update(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
{
- /* hook up your test functions */
- g_test_add_func("/Simple Test Case", simple_test_case);
- g_test_add_func("/Simple Test Case02", simple_test_case02);
- /* run tests from the suite */
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_STATE_AUTOMATIC_TIME_UPDATE_BOOL, SYSTEM_SETTINGS_KEY_AUTOMATIC_TIME_UPDATE, SYSTEM_SETTING_CALLBACK_SLOT_2, user_data);
}
-#endif
+
+int system_setting_unset_changed_callback_automatic_time_update(system_settings_key_e key)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_STATE_AUTOMATIC_TIME_UPDATE_BOOL, SYSTEM_SETTING_CALLBACK_SLOT_2);
+}
+
+/* SYSTEM_SETTINGS_KEY_DEVELOPER_OPTION_STATE */
+int system_setting_get_developer_option_state(system_settings_key_e key, void **value)
+{
+ SETTING_TRACE_BEGIN;
+ bool vconf_value;
+
+ if (system_setting_vconf_get_value_bool(VCONFKEY_SETAPPL_DEVELOPER_OPTION_STATE, &vconf_value)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+ *value = (void *)vconf_value;
+
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+
+/* LCOV_EXCL_START */
+int system_setting_set_developer_option_state(system_settings_key_e key, void *value)
+{
+ SETTING_TRACE_BEGIN;
+ bool *vconf_value;
+ vconf_value = (bool *)value;
+ if (system_setting_vconf_set_value_bool(VCONFKEY_SETAPPL_DEVELOPER_OPTION_STATE, *vconf_value)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+/* LCOV_EXCL_STOP */
+
+int system_setting_set_changed_callback_developer_option_state(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_DEVELOPER_OPTION_STATE, SYSTEM_SETTINGS_KEY_DEVELOPER_OPTION_STATE, SYSTEM_SETTING_CALLBACK_SLOT_2, user_data);
+}
+
+int system_setting_unset_changed_callback_developer_option_state(system_settings_key_e key)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_DEVELOPER_OPTION_STATE, SYSTEM_SETTING_CALLBACK_SLOT_2);
+}
+
+/* SYSTEM_SETTINGS_KEY_ACCESSIBILITY_GRAYSCALE */
+int system_setting_get_accessibility_grayscale(system_settings_key_e key, void **value)
+{
+ SETTING_TRACE_BEGIN;
+ bool vconf_value;
+
+ if (system_setting_vconf_get_value_bool(VCONFKEY_SETAPPL_ACCESSIBILITY_GREYSCALE, &vconf_value)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+ *value = (void *)vconf_value;
+
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+
+/* LCOV_EXCL_START */
+int system_setting_set_accessibility_grayscale(system_settings_key_e key, void *value)
+{
+ SETTING_TRACE_BEGIN;
+ bool *vconf_value;
+ vconf_value = (bool *)value;
+ if (system_setting_vconf_set_value_bool(VCONFKEY_SETAPPL_ACCESSIBILITY_GREYSCALE, *vconf_value)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+/* LCOV_EXCL_STOP */
+
+int system_setting_set_changed_callback_accessibility_grayscale(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_GREYSCALE, SYSTEM_SETTINGS_KEY_ACCESSIBILITY_GRAYSCALE, SYSTEM_SETTING_CALLBACK_SLOT_2, user_data);
+}
+
+int system_setting_unset_changed_callback_accessibility_grayscale(system_settings_key_e key)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_ACCESSIBILITY_GREYSCALE, SYSTEM_SETTING_CALLBACK_SLOT_2);
+}
+
+/* SYSTEM_SETTINGS_KEY_ACCESSIBILITY_NEGATIVE_COLOR */
+int system_setting_get_accessibility_negative_color(system_settings_key_e key, void **value)
+{
+ SETTING_TRACE_BEGIN;
+ bool vconf_value;
+
+ if (system_setting_vconf_get_value_bool(VCONFKEY_SETAPPL_ACCESSIBILITY_HIGH_CONTRAST, &vconf_value)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+ *value = (void *)vconf_value;
+
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+
+/* LCOV_EXCL_START */
+int system_setting_set_accessibility_negative_color(system_settings_key_e key, void *value)
+{
+ SETTING_TRACE_BEGIN;
+ bool *vconf_value;
+ vconf_value = (bool *)value;
+ if (system_setting_vconf_set_value_bool(VCONFKEY_SETAPPL_ACCESSIBILITY_HIGH_CONTRAST, *vconf_value)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+/* LCOV_EXCL_STOP */
+
+int system_setting_set_changed_callback_accessibility_negative_color(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_HIGH_CONTRAST, SYSTEM_SETTINGS_KEY_ACCESSIBILITY_NEGATIVE_COLOR, SYSTEM_SETTING_CALLBACK_SLOT_2, user_data);
+}
+
+int system_setting_unset_changed_callback_accessibility_negative_color(system_settings_key_e key)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_ACCESSIBILITY_HIGH_CONTRAST, SYSTEM_SETTING_CALLBACK_SLOT_2);
+}
+
+/* SYSTEM_SETTINGS_KEY_ROTARY_EVENT_ENABLED */
+/* LCOV_EXCL_START */
+int system_setting_get_rotary_event_enabled(system_settings_key_e key, void **value)
+{
+ SETTING_TRACE_BEGIN;
+ bool vconf_value;
+
+ if (system_setting_vconf_get_value_bool(VCONFKEY_SETAPPL_ROTARY_EVENT_ENABLED_BOOL, &vconf_value)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+ *value = (void *)vconf_value;
+
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+/* LCOV_EXCL_STOP */
+
+/* LCOV_EXCL_START */
+int system_setting_set_rotary_event_enabled(system_settings_key_e key, void *value)
+{
+ SETTING_TRACE_BEGIN;
+ bool *vconf_value;
+ vconf_value = (bool *)value;
+ if (system_setting_vconf_set_value_bool(VCONFKEY_SETAPPL_ROTARY_EVENT_ENABLED_BOOL, *vconf_value)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+/* LCOV_EXCL_STOP */
+
+/* LCOV_EXCL_START */
+int system_setting_set_changed_callback_rotary_event_enabled(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_ROTARY_EVENT_ENABLED_BOOL, SYSTEM_SETTINGS_KEY_ROTARY_EVENT_ENABLED, SYSTEM_SETTING_CALLBACK_SLOT_3, user_data);
+}
+/* LCOV_EXCL_STOP */
+
+/* LCOV_EXCL_START */
+int system_setting_unset_changed_callback_rotary_event_enabled(system_settings_key_e key)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_ROTARY_EVENT_ENABLED_BOOL, SYSTEM_SETTING_CALLBACK_SLOT_3);
+}
+/* LCOV_EXCL_STOP */
+