2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
26 #include <sys/types.h>
36 #include <libxml/xmlmemory.h>
37 #include <libxml/parser.h>
39 #include <fontconfig/fontconfig.h>
41 #include <pkgmgr-info.h>
42 #include <package_manager.h>
43 #include <app_manager.h>
45 #include <system_settings.h>
46 #include <system_settings_private.h>
47 #include <system_settings_ringtones.h>
48 #include <system_settings_json.h>
50 #include <system-setting-config.h>
52 #include <tzplatform_config.h>
55 #include <system_info.h>
57 #define SETTING_FONT_CONF_FILE _TZ_SYS_ETC"/fonts/conf.avail/99-tizen.conf"
58 #define SETTING_DEFAULT_FONT_CONF_FILE _TZ_SYS_ETC"/fonts/conf.avail/99-tizen.conf"
60 #define SETTING_TIME_ZONEINFO_PATH "/usr/share/zoneinfo/"
61 #define SETTING_TIME_SHARE_LOCAL_PATH "/usr/share/locale"
62 #define SETTING_TZONE_SYMLINK_PATH "/opt/etc/localtime"
65 #define __FREE(del, arg) do { \
67 del((void *)(arg)); /*cast any argument to (void*) to avoid build warring*/\
71 #define FREE(arg) __FREE(free, arg)
73 #ifdef SETTING_ARCH_64
74 #define SETTING_UTILS_SO_FILE_PATH "/usr/lib64/libsystem-settings-util.so.0.1.0"
76 #define SETTING_UTILS_SO_FILE_PATH "/usr/lib/libsystem-settings-util.so.0.1.0"
79 int _is_file_accessible(const char *path);
81 static bool dl_is_supported_image_type_load(char *path);
82 static bool dl_font_config_set(char *font_name);
83 static char *dl_get_default_font_info();
84 static int dl_is_available_font(char *str);
85 static void dl_font_size_set();
86 static void dl_font_config_set_notification();
89 * VCONFKEY_SETAPPL_CALL_RINGTONE_PATH_STR has a path of the ringtone file which user choose
90 * @return the ringtone file path specified by user in normal case
91 * if it's not accessable, return the default ringtone path
93 int system_setting_get_incoming_call_ringtone(system_settings_key_e key, void **value)
96 char *vconf_value = NULL;
97 if (system_setting_vconf_get_value_string(VCONFKEY_SETAPPL_CALL_RINGTONE_PATH_STR, &vconf_value)) {
98 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
101 /* check to see if it's accessable -> OK */
102 /* no --> default ringtone path VCONFKEY_SETAPPL_CALL_RINGTONE_DEFAULT_PATH_STR */
103 int is_load = _is_file_accessible(vconf_value);
105 *value = vconf_value;
106 } else { /* not zero on errro */
107 *value = vconf_get_str(VCONFKEY_SETAPPL_CALL_RINGTONE_DEFAULT_PATH_STR);
111 /**value = vconf_value; */
112 return SYSTEM_SETTINGS_ERROR_NONE;
116 int system_setting_get_email_alert_ringtone(system_settings_key_e key, void **value)
119 char *vconf_value = NULL;
120 if (system_setting_vconf_get_value_string(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR, &vconf_value)) {
121 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
124 /* check to see if it's accessable -> OK */
125 /* no --> default ringtone path VCONFKEY_SETAPPL_NOTI_RINGTONE_DEFAULT_PATH_STR */
126 int is_load = _is_file_accessible(vconf_value);
128 *value = vconf_value;
129 } else { /* not zero on errro */
130 *value = vconf_get_str(VCONFKEY_SETAPPL_NOTI_RINGTONE_DEFAULT_PATH_STR);
134 return SYSTEM_SETTINGS_ERROR_NONE;
138 int system_setting_get_wallpaper_home_screen(system_settings_key_e key, void **value)
142 if (system_setting_vconf_get_value_string(VCONFKEY_BGSET, &vconf_value)) {
143 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
145 *value = vconf_value;
146 return SYSTEM_SETTINGS_ERROR_NONE;
150 int system_setting_get_wallpaper_lock_screen(system_settings_key_e key, void **value)
155 if (system_setting_vconf_get_value_string(VCONFKEY_IDLE_LOCK_BGSET, &vconf_value)) {
156 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
158 *value = vconf_value;
160 return SYSTEM_SETTINGS_ERROR_NONE;
164 /* [int] vconf GET */
165 int system_setting_get_font_size(system_settings_key_e key, void **value)
169 int ** val = (int**)value;
171 if (system_setting_vconf_get_value_int(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, &vconf_value)) {
172 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
176 return SYSTEM_SETTINGS_ERROR_NONE;
180 int system_setting_get_default_font_type(system_settings_key_e key, void **value)
183 char *font_name = dl_get_default_font_info();
185 *value = (void *)font_name;
186 return SYSTEM_SETTINGS_ERROR_NONE;
188 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
192 /* [int] vconf GET */
193 int system_setting_get_font_type(system_settings_key_e key, void **value)
196 char *font_name = NULL;
198 if (system_setting_vconf_get_value_string(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME, &font_name)) {
199 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
203 return SYSTEM_SETTINGS_ERROR_NONE;
207 int system_setting_get_motion_activation(system_settings_key_e key, void **value)
212 if (system_setting_vconf_get_value_bool(VCONFKEY_SETAPPL_MOTION_ACTIVATION, &vconf_value)) {
213 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
215 *value = (void *)vconf_value;
217 return SYSTEM_SETTINGS_ERROR_NONE;
220 int system_setting_get_usb_debugging_option(system_settings_key_e key, void **value)
225 if (system_setting_vconf_get_value_bool(VCONFKEY_SETAPPL_USB_DEBUG_MODE_BOOL, &vconf_value)) {
226 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
228 *value = (void *)vconf_value;
230 return SYSTEM_SETTINGS_ERROR_NONE;
233 int system_setting_get_3g_data_network(system_settings_key_e key, void **value)
238 if (system_setting_vconf_get_value_bool(VCONFKEY_3G_ENABLE, &vconf_value)) {
239 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
241 *value = (void *)vconf_value;
243 return SYSTEM_SETTINGS_ERROR_NONE;
245 /*////////////////////////////////////////////////////////////////////////////////////////////////// */
249 * get current lock scren app package name (string)
251 * @return SYSTEM_SETTINGS_ERROR_LOCKSCREEN_APP_PASSWORD_MODE raise exception if current lock type is 'password'
253 int system_setting_get_lockscreen_app(system_settings_key_e key, void **value)
256 char *pkg_name = NULL;
258 if (system_setting_vconf_get_value_int(VCONFKEY_SETAPPL_SCREEN_LOCK_TYPE_INT, &locktype)) {
259 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
262 if (system_setting_vconf_get_value_string(VCONFKEY_SETAPPL_3RD_LOCK_PKG_NAME_STR, &pkg_name)) {
263 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
266 if (pkg_name && strcmp(pkg_name, "com.samsung.lockscreen") == 0 && locktype == SETTING_SCREEN_LOCK_TYPE_PASSWORD) {
268 return SYSTEM_SETTINGS_ERROR_LOCKSCREEN_APP_PASSWORD_MODE;
272 return SYSTEM_SETTINGS_ERROR_NONE;
276 /*////////////////////////////////////////////////////////////////////////////////////////////////// */
278 int _is_file_accessible(const char *path)
281 int ret = access(path , R_OK);
283 SETTING_TRACE("found the file %s", path);
286 /* error code : 13 */
287 SETTING_TRACE("found the file %s --- error code : %d ", path, errno);
294 /*////////////////////////////////////////////////////////////////////////////////////////////////// */
295 // @todo move to CMake
296 #define DEF_RINGTONE_FILE_PATH SETTING_DEF_RES"/Ringtones"
298 #define USR_RINGTONE_FILE_PATH "/home/owner/content/Sounds/Ringtones"
299 #define JSONFILE "/opt/home/owner/apps_rw/org.tizen.setting/data/.user-ringtones.json"
302 static char* _get_json_file_path()
309 int system_setting_add_incoming_call_ringtone(system_settings_key_e key, void *value)
312 char* pathval = (char*)value;
313 char* dnameval = NULL;
314 char* baseval = NULL;
318 JsonParser *parser = ss_json_ringtone_open_file(JSONFILE);
320 JsonParser *parser = ss_json_ringtone_load_from_data();
323 JsonNode *root = json_parser_get_root(parser);
327 int ret = SYSTEM_SETTINGS_ERROR_NONE;
328 if (false == ss_json_ringtone_contain(root, pathval)) {
329 // @todo : MAKE SURE THE ACTUAL FILE IS THERE ON PATHVAL(SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER)
330 ss_json_ringtone_add(root, JSONFILE, pathval, pathval);
331 SETTING_TRACE("pathval is : %s -- OK", pathval);
333 SETTING_TRACE("pathval is duplicated : %s", pathval);
334 ret = SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
337 dnameval = strdup(pathval);
338 baseval = strdup(pathval);
339 if (dnameval && baseval) {
340 SETTING_TRACE("---> dirname is : %s ", dirname(dnameval));
341 SETTING_TRACE("---> basename is : %s ", basename(baseval));
347 g_object_unref(parser);
354 int system_setting_del_incoming_call_ringtone(system_settings_key_e key, void *value)
357 char* pathval = (char*)value;
360 JsonParser* parser = ss_json_ringtone_open_file(JSONFILE);
362 JsonParser* parser = ss_json_ringtone_load_from_data();
364 JsonNode *root = json_parser_get_root(parser);
366 ss_json_ringtone_remove(root, JSONFILE, pathval);
367 //void ss_json_ringtone_remove(JsonNode *root, char* filename, char* path_to_del)
369 ss_json_ringtone_print(root);
371 g_object_unref(parser);
375 return SYSTEM_SETTINGS_ERROR_NONE;
379 /* LCOV_EXCL_START */
380 gint _compare_cb(gconstpointer d1, gconstpointer d2)
382 fileNodeInfo *pNode1 = (fileNodeInfo *)d1;
383 fileNodeInfo *pNode2 = (fileNodeInfo *)d2;
385 return strcmp(pNode1->media_name, pNode2->media_name);
390 * get the RINGTONE list
392 static void _get_default_ringtones(system_settings_key_e key, system_settings_iter_cb callback, void *data)
396 GList *filelist = NULL;
398 fileNodeInfo *node = NULL;
401 //-----------------------------------------------------------------------------------------------------------------
402 // 1. get the default ringtone list
403 //-----------------------------------------------------------------------------------------------------------------
404 int ret = get_filelist_from_dir_path(DEF_RINGTONE_FILE_PATH, &filelist);
406 SETTING_TRACE("Failed to get filelist, ret = %d %s", ret, DEF_RINGTONE_FILE_PATH);
409 filelist = g_list_sort(filelist, _compare_cb);
411 for (iter = filelist; iter != NULL; iter = g_list_next(iter)) {
412 node = (fileNodeInfo *)iter->data;
413 SETTING_TRACE("file path = (%d) : name:%s path:%s [%s]", ret, node->name, node->path, node->media_name);
414 // @todo assert NULL check
417 snprintf(temp, 1024, "%s/%s", node->path, node->name);
418 char* path = strdup(temp);
419 bool ret = callback(idx, (void *)(path), data);
425 SETTING_TRACE("quit the iteration by return value == false : %d", ret);
430 SETTING_TRACE("--> system_setting_data_iterator is NULL");
434 for (iter = filelist; iter != NULL; iter = g_list_next(iter)) {
435 node = (fileNodeInfo *)iter->data;
438 FREE(node->media_name);
441 g_list_free(filelist);
446 static void _get_user_ringtones(system_settings_key_e key, system_settings_iter_cb callback, void *data)
452 JsonParser* parser = ss_json_ringtone_open_file(JSONFILE);
454 JsonParser* parser = ss_json_ringtone_load_from_data();
457 JsonNode *root = json_parser_get_root(parser);
458 int size = json_array_get_length(json_node_get_array(root));
461 for (i = 0; i < size ; i++) {
462 JsonObject *ringtone = json_array_get_object_element(json_node_get_array(root), i);
463 char *nameval = (char *)json_object_get_string_member(ringtone, "name");
464 char *pathval = (char *)json_object_get_string_member(ringtone, "path");
465 SETTING_TRACE("(%s) --- (%s) \n", nameval, pathval);
466 if (callback && pathval) {
467 char* path = strdup(pathval);
468 bool ret = callback(i, (void *)(path), data);
470 SETTING_TRACE("quit the iteration by return value == false : %d", ret);
475 SETTING_TRACE("--> callback is NULL");
479 g_object_unref(parser);
482 int system_setting_list_incoming_call_ringtone(system_settings_key_e key, system_settings_iter_cb callback, void *data)
486 _get_default_ringtones(key, callback, data);
487 //-----------------------------------------------------------------------------------------------------------------
488 // 2. get the USER ringtone list
489 //-----------------------------------------------------------------------------------------------------------------
490 _get_user_ringtones(key, callback, data);
492 return SYSTEM_SETTINGS_ERROR_NONE;
496 /* LCOV_EXCL_START */
497 int system_setting_set_incoming_call_ringtone(system_settings_key_e key, void *value)
501 vconf_value = (char *)value;
503 int ret = _is_file_accessible(vconf_value);
505 if (system_setting_vconf_set_value_string(VCONFKEY_SETAPPL_CALL_RINGTONE_PATH_STR, vconf_value)) {
506 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
509 /* @todo add a common ret_handler */
513 return SYSTEM_SETTINGS_ERROR_NONE;
518 /* LCOV_EXCL_START */
519 int system_setting_set_email_alert_ringtone(system_settings_key_e key, void *value)
523 vconf_value = (char *)value;
525 int ret = _is_file_accessible(vconf_value);
527 if (system_setting_vconf_set_value_string(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR, vconf_value)) {
528 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
531 /*return SYSTEM_SETTINGS_ERROR_IO_ERROR;*/
532 /* @todo add a common ret_handler */
536 return SYSTEM_SETTINGS_ERROR_NONE;
540 /* LCOV_EXCL_START */
541 static bool dl_is_supported_image_type_load(char *path)
546 bool (*image_type_check)(char *path);
548 handle = dlopen(SETTING_UTILS_SO_FILE_PATH, RTLD_LAZY);
550 SETTING_TRACE("ERROR!! canNOT find libsystem-settings-util.so.0.1.0");
554 image_type_check = dlsym(handle, "__is_supported_image_type_load");
555 if ((error = dlerror()) != NULL) {
556 SETTING_TRACE("ERROR!! canNOT find __is_supported_image_type_load function at libsystem-settings-util.so.0.1.0");
561 ret = image_type_check(path);
568 /* LCOV_EXCL_START */
569 static int dl_is_available_font(char *str)
574 int (*check_available_font)(char *font_name);
576 handle = dlopen(SETTING_UTILS_SO_FILE_PATH, RTLD_LAZY);
578 SETTING_TRACE("ERROR!! canNOT find libsystem-settings-util.so.0.1.0");
582 check_available_font = dlsym(handle, "__is_available_font");
583 if ((error = dlerror()) != NULL) {
584 SETTING_TRACE("ERROR!! canNOT find __is_available_font function at libsystem-settings-util.so.0.1.0");
589 ret = check_available_font(str);
596 /* LCOV_EXCL_START */
597 static void dl_font_size_set()
601 void (*set_font_size)();
603 handle = dlopen(SETTING_UTILS_SO_FILE_PATH, RTLD_LAZY);
605 SETTING_TRACE("ERROR!! canNOT find libsystem-settings-util.so.0.1.0");
609 set_font_size = dlsym(handle, "__font_size_set");
610 if ((error = dlerror()) != NULL) {
611 SETTING_TRACE("ERROR!! canNOT find __font_size_set function at libsystem-settings-util.so.0.1.0");
623 /* LCOV_EXCL_START */
624 static void dl_font_config_set_notification()
628 void (*set_font_nodification)();
630 handle = dlopen(SETTING_UTILS_SO_FILE_PATH, RTLD_LAZY);
632 SETTING_TRACE("ERROR!! canNOT find libsystem-settings-util.so.0.1.0");
636 set_font_nodification = dlsym(handle, "font_config_set_notification");
637 if ((error = dlerror()) != NULL) {
638 SETTING_TRACE("ERROR!! canNOT find font_config_set_notification function at libsystem-settings-util.so.0.1.0");
643 set_font_nodification();
650 /* LCOV_EXCL_START */
651 static bool dl_font_config_set(char *font_name)
656 bool (*check_font_type)(char *font_name);
658 handle = dlopen(SETTING_UTILS_SO_FILE_PATH, RTLD_LAZY);
660 SETTING_TRACE("ERROR!! canNOT find libsystem-settings-util.so.0.1.0");
664 check_font_type = dlsym(handle, "font_config_set");
665 if ((error = dlerror()) != NULL) {
666 SETTING_TRACE("ERROR!! canNOT find font_config_set function at libsystem-settings-util.so.0.1.0");
671 ret = check_font_type(font_name);
678 /* LCOV_EXCL_START */
679 static char *dl_get_default_font_info()
684 char *(*get_font_info)();
686 handle = dlopen(SETTING_UTILS_SO_FILE_PATH, RTLD_LAZY);
688 SETTING_TRACE("ERROR!! canNOT find libsystem-settings-util.so.0.1.0");
692 get_font_info = dlsym(handle, "_get_default_font");
694 if ((error = dlerror()) != NULL) {
695 SETTING_TRACE("ERROR!! canNOT find _get_default_font function at libsystem-settings-util.so.0.1.0");
700 ret = get_font_info();
707 #ifdef TIZEN_WEARABLE
708 /* LCOV_EXCL_START */
709 static int system_setting_get_extended_wallpaper_num(const char *file_path, unsigned int *num)
713 const char *find_str = "extended_wallpaper_";
716 if (!(ch = strstr(file_path, find_str))) {
717 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
719 strncpy(buffer, file_path, ch - file_path);
720 buffer[ch - file_path] = 0;
721 sprintf(buffer + (ch - file_path), "%s%s", "", ch + strlen(find_str));
723 if (!isdigit(buffer[0])) {
724 SETTING_TRACE("%s is not number", buffer);
725 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
730 return SYSTEM_SETTINGS_ERROR_NONE;
734 /* LCOV_EXCL_START */
735 static int system_setting_copy_extended_wallpaper(const char *dest_file_path, const char *source_file_path)
738 if (!source_file_path || !dest_file_path) {
739 return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
745 fd = open(source_file_path, O_RDONLY);
747 SETTING_TRACE("file open failed: %s", source_file_path);
748 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
752 fd2 = open(dest_file_path, O_WRONLY | O_CREAT, S_IRWXU | S_IRWXG | S_IRWXO);
754 SETTING_TRACE("file creation failed: %s", dest_file_path);
756 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
759 while (read(fd, buf, sizeof(buf) - 1) > 0) {
760 write(fd2, buf, sizeof(buf) - 1);
766 if (chmod(dest_file_path, S_IRWXU | S_IRWXG | S_IRWXO) < 0) {
767 SETTING_TRACE("chmod failed: %s", dest_file_path);
770 return SYSTEM_SETTINGS_ERROR_NONE;
774 /* LCOV_EXCL_START */
775 static int system_setting_remove_oldest_extended_wallpaper()
780 char *min_image_name = NULL;
781 unsigned int min_image_num = 0;
782 unsigned int temp_image_num = 0;
785 if ((dp = opendir(_TZ_SYS_DATA"/setting/wallpaper")) == NULL) {
786 SETTING_TRACE("opendir error");
787 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
790 while ((dirp = readdir(dp))) {
791 if (!strcmp(dirp->d_name, ".") || !strcmp(dirp->d_name, ".."))
794 if (system_setting_get_extended_wallpaper_num(dirp->d_name, &temp_image_num)
795 != SYSTEM_SETTINGS_ERROR_NONE) {
796 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
799 if ((image_count == 0) || (min_image_num > temp_image_num)) {
800 min_image_num = temp_image_num;
801 min_image_name = dirp->d_name;
808 if (min_image_name) {
809 snprintf(buf, sizeof(buf) - 1, _TZ_SYS_DATA"/setting/wallpaper/%s", min_image_name);
810 if (remove(buf) < 0) { /* remove oldest image */
811 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
815 return SYSTEM_SETTINGS_ERROR_NONE;
819 /* LCOV_EXCL_START */
820 static int system_setting_check_extended_wallpaper(const char *file_path)
824 if (!file_path || !strlen(file_path))
826 snprintf(buffer, 512, "%s/.bgwallpaper", tzplatform_getenv(TZ_USER_CONTENT));
827 return (strstr(file_path, buffer) != NULL);
831 #define WALLPAPER_MAX_COUNT 10
833 /* LCOV_EXCL_START */
834 int system_setting_set_wallpaper_home_screen(system_settings_key_e key, void *value)
838 vconf_value = (char *)value;
840 bool isok = dl_is_supported_image_type_load(vconf_value);
843 SETTING_TRACE("path : %s is not supported file format", vconf_value);
844 return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
846 SETTING_TRACE("path : %s is SUPPORT file format", vconf_value);
849 /* error handling here */
850 if (_is_file_accessible(vconf_value) != 0)
851 return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
853 if (system_setting_vconf_set_value_string(VCONFKEY_BGSET, vconf_value)) {
854 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
858 #ifdef TIZEN_WEARABLE
859 if (system_setting_check_extended_wallpaper(vconf_value)) { /* New extended wallpaper */
862 unsigned int max_image_num = 0;
863 unsigned int temp_image_num = 0;
866 if ((dp = opendir(_TZ_SYS_DATA"/setting/wallpaper")) == NULL) {
867 SETTING_TRACE("Setting - dir open error!");
868 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
871 /* Check a max number of wallpapers */
872 while ((dirp = readdir(dp))) {
873 if (!strcmp(dirp->d_name, ".") || !strcmp(dirp->d_name, ".."))
876 if (system_setting_get_extended_wallpaper_num(dirp->d_name, &temp_image_num)
877 != SYSTEM_SETTINGS_ERROR_NONE) {
880 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
883 if ((image_count == 0) || (max_image_num < temp_image_num)) {
884 max_image_num = temp_image_num;
892 /* Numbering rule: Gear is odd number */
893 max_image_num = (max_image_num % 2 == 0) ? max_image_num + 1
896 char file_name_buffer[512];
897 snprintf(file_name_buffer, sizeof(file_name_buffer) - 1,
898 _TZ_SYS_DATA"/setting/wallpaper/extended_wallpaper_%d.jpg", max_image_num);
900 /* Copy image to _TZ_SYS_DATA/setting/wallpaper/ */
901 if (system_setting_copy_extended_wallpaper(file_name_buffer, vconf_value)
902 != SYSTEM_SETTINGS_ERROR_NONE) {
903 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
906 /* remove oldest wallpaper */
907 if (image_count >= WALLPAPER_MAX_COUNT) {
908 if (system_setting_remove_oldest_extended_wallpaper()
909 != SYSTEM_SETTINGS_ERROR_NONE) {
910 remove(file_name_buffer);
911 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
915 if (system_setting_vconf_set_value_string(VCONFKEY_BGSET, file_name_buffer)) {
916 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
919 if (system_setting_vconf_set_value_int(VCONFKEY_SETAPPL_WALLPAPER_CHANGED_NOTI_INT,
920 VCONFKEY_WALLPAPER_CHANGED_NOTI_GEAR)) {
921 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
924 if (system_setting_vconf_set_value_string(VCONFKEY_BGSET, vconf_value)) {
925 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
930 return SYSTEM_SETTINGS_ERROR_NONE;
934 /* LCOV_EXCL_START */
935 int system_setting_set_wallpaper_lock_screen(system_settings_key_e key, void *value)
939 vconf_value = (char *)value;
941 bool isok = dl_is_supported_image_type_load(vconf_value);
944 SETTING_TRACE("path : %s is not supported file format", vconf_value);
945 return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
947 SETTING_TRACE("path : %s is SUPPORT file format", vconf_value);
950 /* error handling here */
951 if (_is_file_accessible(vconf_value) != 0)
952 return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
954 if (system_setting_vconf_set_value_string(VCONFKEY_IDLE_LOCK_BGSET, vconf_value)) {
955 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
958 return SYSTEM_SETTINGS_ERROR_NONE;
962 /* LCOV_EXCL_START */
963 int system_setting_set_font_size(system_settings_key_e key, void *value)
967 vconf_value = *(int **)value;
969 if (*vconf_value < 0 || *vconf_value > SYSTEM_SETTINGS_FONT_SIZE_GIANT) {
970 return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
973 if (system_setting_vconf_set_value_int(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, *vconf_value)) {
974 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
978 return SYSTEM_SETTINGS_ERROR_NONE;
984 /* LCOV_EXCL_START */
985 void *font_conf_doc_parse(char *doc_name, char *font_name)
988 xmlDocPtr doc = NULL;
989 xmlNodePtr cur = NULL;
990 xmlNodePtr cur2 = NULL;
991 xmlNodePtr cur3 = NULL;
994 doc = xmlParseFile(doc_name);
996 cur = xmlDocGetRootElement(doc);
1004 if (xmlStrcmp(cur->name, (const xmlChar *)"fontconfig")) {
1010 cur = cur->xmlChildrenNode;
1012 bool is_changed = false;
1013 while (cur != NULL) {
1014 if ((!xmlStrcmp(cur->name, (const xmlChar *)"match"))) {
1015 cur2 = cur->xmlChildrenNode;
1016 while (cur2 != NULL) {
1017 if ((!xmlStrcmp(cur2->name, (const xmlChar *)"edit"))) {
1018 xmlChar *name = xmlGetProp(cur2, (const xmlChar *)"name");
1019 /* if name is not 'family', break */
1020 if (xmlStrcmp(name, (const xmlChar *)"family")) {
1028 cur3 = cur2->xmlChildrenNode;
1029 while (cur3 != NULL) {
1030 if ((!xmlStrcmp(cur3->name, (const xmlChar *)"string"))) {
1031 xmlNodeSetContent(cur3->xmlChildrenNode, (const xmlChar *)font_name);
1032 key = xmlNodeListGetString(doc, cur3->xmlChildrenNode, 1);
1042 } else if ((!xmlStrcmp(cur->name, (const xmlChar *)"alias"))) {
1043 cur2 = cur->xmlChildrenNode;
1044 while (cur2 != NULL) {
1045 if ((!xmlStrcmp(cur2->name, (const xmlChar *)"family"))) {
1046 xmlNodeSetContent(cur2->xmlChildrenNode, (const xmlChar *)font_name);
1047 key = xmlNodeListGetString(doc, cur2->xmlChildrenNode, 1);
1051 } else if ((!xmlStrcmp(cur2->name, (const xmlChar *)"prefer"))) {
1052 cur3 = cur2->xmlChildrenNode;
1053 while (cur3 != NULL) {
1054 if ((!xmlStrcmp(cur3->name, (const xmlChar *)"family"))) {
1055 xmlNodeSetContent(cur3->xmlChildrenNode, (const xmlChar *)font_name);
1056 key = xmlNodeListGetString(doc, cur3->xmlChildrenNode, 1);
1080 /* LCOV_EXCL_STOP */
1082 /* LCOV_EXCL_START */
1083 int system_setting_set_font_type(system_settings_key_e key, void *value)
1085 SETTING_TRACE_BEGIN;
1086 char *font_name = NULL;
1087 font_name = (char *)value;
1089 /* get current font list */
1090 int is_found = dl_is_available_font(font_name);
1092 if (is_found == 1) {
1093 SETTING_TRACE("found font : %s ", font_name);
1095 SETTING_TRACE(" NOT found font : %s ", font_name);
1096 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1099 bool bsave = dl_font_config_set(font_name);
1102 SETTING_TRACE(" font type save error by font_config_set() ");
1103 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1105 SETTING_TRACE(" save OK - font_config_set() ");
1108 xmlDocPtr doc = (xmlDocPtr)font_conf_doc_parse(SETTING_FONT_CONF_FILE, font_name);
1110 xmlSaveFormatFile(SETTING_FONT_CONF_FILE, doc, 0);
1115 dl_font_config_set_notification();
1118 vconf_value = (char *)value;
1120 if (system_setting_vconf_set_value_string(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME, vconf_value)) {
1121 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1123 return SYSTEM_SETTINGS_ERROR_NONE;
1125 /* LCOV_EXCL_STOP */
1127 /* LCOV_EXCL_START */
1128 int system_setting_set_motion_activation(system_settings_key_e key, void *value)
1130 SETTING_TRACE_BEGIN;
1132 vconf_value = (bool *)value;
1133 if (system_setting_vconf_set_value_bool(VCONFKEY_SETAPPL_MOTION_ACTIVATION, *vconf_value)) {
1134 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1136 return SYSTEM_SETTINGS_ERROR_NONE;
1138 /* LCOV_EXCL_STOP */
1140 /* LCOV_EXCL_START */
1141 int system_setting_set_usb_debugging_option(system_settings_key_e key, void *value)
1143 SETTING_TRACE_BEGIN;
1145 vconf_value = (bool *)value;
1146 if (system_setting_vconf_set_value_bool(VCONFKEY_SETAPPL_USB_DEBUG_MODE_BOOL, *vconf_value)) {
1147 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1149 return SYSTEM_SETTINGS_ERROR_NONE;
1152 /* LCOV_EXCL_STOP */
1154 /* LCOV_EXCL_START */
1155 int system_setting_set_3g_data_network(system_settings_key_e key, void *value)
1157 SETTING_TRACE_BEGIN;
1159 vconf_value = (bool *)value;
1160 if (system_setting_vconf_set_value_bool(VCONFKEY_3G_ENABLE, *vconf_value)) {
1161 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1164 return SYSTEM_SETTINGS_ERROR_NONE;
1166 /* LCOV_EXCL_STOP */
1168 /* LCOV_EXCL_START */
1169 static int category_func(const char *name, void *user_data)
1171 SETTING_TRACE_BEGIN;
1172 static char *category = "lock-screen";
1173 if (name && !strcmp(name, category)) {
1174 SETTING_TRACE(" SAME ");
1177 SETTING_TRACE(" DIFFERENT -- %s, category -- %s ", name, category);
1183 /* LCOV_EXCL_STOP */
1187 * set 'swipe type' if current lockscreen app is 'com.samsung.lockscreen'
1191 /* LCOV_EXCL_START */
1192 int system_setting_set_lockscreen_app(system_settings_key_e key, void *value)
1194 SETTING_TRACE_BEGIN;
1196 vconf_value = (char *)value; /* ex) com.samsung.lockscreen */
1199 pkgmgrinfo_appinfo_h handle;
1200 r = pkgmgrinfo_appinfo_get_appinfo(vconf_value, &handle);
1201 if (r != PMINFO_R_OK) {
1202 SETTING_TRACE("*** pkginfo failed ");
1203 return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
1205 SETTING_TRACE("%p", handle);
1208 int ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)"lock-screen");
1209 if (ret != PMINFO_R_OK) {
1210 pkgmgrinfo_appinfo_destroy_appinfo(handle);
1211 return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
1214 pkgmgrinfo_appinfo_destroy_appinfo(handle);
1215 /*----------------------------------------------------------------------------------- */
1217 if (system_setting_vconf_get_value_int(VCONFKEY_SETAPPL_SCREEN_LOCK_TYPE_INT, &locktype)) {
1218 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1221 if (locktype == SETTING_SCREEN_LOCK_TYPE_PASSWORD)
1222 return SYSTEM_SETTINGS_ERROR_LOCKSCREEN_APP_PASSWORD_MODE;
1224 if (system_setting_vconf_set_value_string(VCONFKEY_SETAPPL_3RD_LOCK_PKG_NAME_STR, vconf_value)) {
1225 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1228 if (vconf_value && strcmp(vconf_value, "com.samsung.lockscreen") == 0) {
1229 if (system_setting_vconf_set_value_int(VCONFKEY_SETAPPL_SCREEN_LOCK_TYPE_INT, SETTING_SCREEN_LOCK_TYPE_SWIPE)) {
1230 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1233 return SYSTEM_SETTINGS_ERROR_NONE;
1235 /* LCOV_EXCL_STOP */
1237 /*/////////////////////////////////////////////////////////////////////////////////////////////// */
1240 int system_setting_set_changed_callback_incoming_call_ringtone(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1242 SETTING_TRACE_BEGIN;
1243 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);
1246 int system_setting_unset_changed_callback_incoming_call_ringtone(system_settings_key_e key)
1248 SETTING_TRACE_BEGIN;
1249 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_CALL_RINGTONE_PATH_STR, SYSTEM_SETTING_CALLBACK_SLOT_0);
1252 int system_setting_set_changed_callback_email_alert_ringtone(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1254 SETTING_TRACE_BEGIN;
1255 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);
1258 int system_setting_unset_changed_callback_email_alert_ringtone(system_settings_key_e key)
1260 SETTING_TRACE_BEGIN;
1261 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR, SYSTEM_SETTING_CALLBACK_SLOT_0);
1264 int system_setting_set_changed_callback_wallpaper_home_screen(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1266 SETTING_TRACE_BEGIN;
1267 return system_setting_vconf_set_changed_cb(VCONFKEY_BGSET, SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN, SYSTEM_SETTING_CALLBACK_SLOT_0, user_data);
1270 int system_setting_unset_changed_callback_wallpaper_home_screen(system_settings_key_e key)
1272 SETTING_TRACE_BEGIN;
1273 return system_setting_vconf_unset_changed_cb(VCONFKEY_BGSET, SYSTEM_SETTING_CALLBACK_SLOT_0);
1276 int system_setting_set_changed_callback_wallpaper_lock_screen(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1278 SETTING_TRACE_BEGIN;
1279 return system_setting_vconf_set_changed_cb(VCONFKEY_IDLE_LOCK_BGSET, SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN, SYSTEM_SETTING_CALLBACK_SLOT_0, user_data);
1282 int system_setting_unset_changed_callback_wallpaper_lock_screen(system_settings_key_e key)
1284 SETTING_TRACE_BEGIN;
1285 return system_setting_vconf_unset_changed_cb(VCONFKEY_IDLE_LOCK_BGSET, SYSTEM_SETTING_CALLBACK_SLOT_0);
1288 int system_setting_set_changed_callback_font_size(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1290 SETTING_TRACE_BEGIN;
1291 return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, SYSTEM_SETTINGS_KEY_FONT_SIZE, SYSTEM_SETTING_CALLBACK_SLOT_1, user_data);
1294 int system_setting_unset_changed_callback_font_size(system_settings_key_e key)
1296 SETTING_TRACE_BEGIN;
1297 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, SYSTEM_SETTING_CALLBACK_SLOT_1);
1300 int system_setting_set_changed_callback_usb_debugging_option(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1302 SETTING_TRACE_BEGIN;
1303 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);
1306 int system_setting_unset_changed_callback_usb_debugging_option(system_settings_key_e key)
1308 SETTING_TRACE_BEGIN;
1309 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_USB_DEBUG_MODE_BOOL, SYSTEM_SETTING_CALLBACK_SLOT_1);
1312 int system_setting_set_changed_callback_3g_data_network(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1314 SETTING_TRACE_BEGIN;
1315 return system_setting_vconf_set_changed_cb(VCONFKEY_3G_ENABLE, SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED, SYSTEM_SETTING_CALLBACK_SLOT_1, user_data);
1318 int system_setting_unset_changed_callback_3g_data_network(system_settings_key_e key)
1320 SETTING_TRACE_BEGIN;
1321 return system_setting_vconf_unset_changed_cb(VCONFKEY_3G_ENABLE, SYSTEM_SETTING_CALLBACK_SLOT_1);
1324 int system_setting_set_changed_callback_lockscreen_app(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1326 SETTING_TRACE_BEGIN;
1327 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);
1330 int system_setting_unset_changed_callback_lockscreen_app(system_settings_key_e key)
1332 SETTING_TRACE_BEGIN;
1333 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_3RD_LOCK_PKG_NAME_STR, SYSTEM_SETTING_CALLBACK_SLOT_1);
1338 * @todo need to add custom event notification method
1340 int system_setting_set_changed_callback_font_type(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1342 SETTING_TRACE_BEGIN;
1343 return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME, SYSTEM_SETTINGS_KEY_FONT_TYPE, SYSTEM_SETTING_CALLBACK_SLOT_2, user_data);
1346 int system_setting_unset_changed_callback_font_type(system_settings_key_e key)
1348 SETTING_TRACE_BEGIN;
1349 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME, SYSTEM_SETTING_CALLBACK_SLOT_2);
1352 /* TODO : 2th argument, callback, is not in use. */
1353 int system_setting_set_changed_callback_motion_activation(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1355 SETTING_TRACE_BEGIN;
1356 return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_MOTION_ACTIVATION, SYSTEM_SETTINGS_KEY_MOTION_ACTIVATION, SYSTEM_SETTING_CALLBACK_SLOT_3, user_data);
1359 int system_setting_unset_changed_callback_motion_activation(system_settings_key_e key)
1361 SETTING_TRACE_BEGIN;
1362 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_MOTION_ACTIVATION, SYSTEM_SETTING_CALLBACK_SLOT_3);
1365 /*//////////////////////////////////////////////////////////////////////////////////////// */
1366 /*--------------------------------------- */
1367 int system_setting_get_locale_country(system_settings_key_e key, void **value)
1369 SETTING_TRACE_BEGIN;
1370 char *vconf_value = NULL;
1371 if (system_setting_vconf_get_value_string(VCONFKEY_REGIONFORMAT, &vconf_value)) {
1372 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1375 /* parsing validation */
1377 char arr[21] = {0,};
1378 snprintf(arr, 20, "%s", vconf_value);
1379 for (int i = 0; i < strlen(arr); i++) {
1380 if ('.' == arr[i]) {
1382 SETTING_TRACE("replace . to NULL : %d", i);
1386 *value = strdup(arr);
1390 return SYSTEM_SETTINGS_ERROR_NONE;
1393 /* LCOV_EXCL_START */
1394 int system_setting_set_locale_country(system_settings_key_e key, void *value)
1396 SETTING_TRACE_BEGIN;
1397 char *vconf_value = NULL;
1398 vconf_value = (char *)value;
1400 char *ext = "UTF-8";
1403 snprintf(arr, 20, "%s.%s", vconf_value, ext);
1405 if (system_setting_vconf_set_value_string(VCONFKEY_REGIONFORMAT, arr)) {
1406 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1408 return SYSTEM_SETTINGS_ERROR_NONE;
1410 /* LCOV_EXCL_STOP */
1412 int system_setting_set_changed_callback_locale_country(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1414 SETTING_TRACE_BEGIN;
1415 return system_setting_vconf_set_changed_cb(VCONFKEY_REGIONFORMAT, SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY, SYSTEM_SETTING_CALLBACK_SLOT_3, user_data);
1418 int system_setting_unset_changed_callback_locale_country(system_settings_key_e key)
1420 SETTING_TRACE_BEGIN;
1421 return system_setting_vconf_unset_changed_cb(VCONFKEY_REGIONFORMAT, SYSTEM_SETTING_CALLBACK_SLOT_3);
1425 /*--------------------------------------- */
1426 int system_setting_get_locale_language(system_settings_key_e key, void **value)
1428 SETTING_TRACE_BEGIN;
1429 char *vconf_value = NULL;
1430 if (system_setting_vconf_get_value_string(VCONFKEY_LANGSET, &vconf_value)) {
1431 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1434 /* parsing validation */
1436 char arr[21] = {0,};
1437 snprintf(arr, 20, "%s", vconf_value);
1438 for (int i = 0; i < strlen(arr); i++) {
1439 if ('.' == arr[i]) {
1441 SETTING_TRACE("replace . to NULL : %d", i);
1445 *value = strdup(arr);
1448 return SYSTEM_SETTINGS_ERROR_NONE;
1451 /* LCOV_EXCL_START */
1452 int system_setting_set_locale_language(system_settings_key_e key, void *value)
1454 SETTING_TRACE_BEGIN;
1455 char *vconf_value = NULL;
1456 vconf_value = (char *)value;
1458 char *ext = "UTF-8";
1461 snprintf(arr, 20, "%s.%s", vconf_value, ext);
1463 if (system_setting_vconf_set_value_string(VCONFKEY_LANGSET, arr)) {
1464 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1466 return SYSTEM_SETTINGS_ERROR_NONE;
1468 /* LCOV_EXCL_STOP */
1470 int system_setting_set_changed_callback_locale_language(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1472 SETTING_TRACE_BEGIN;
1473 /*return system_setting_vconf_set_changed_cb(VCONFKEY_LANGSET, SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, 3, user_data ); */
1474 return system_setting_vconf_set_changed_cb(VCONFKEY_LANGSET, SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, SYSTEM_SETTING_CALLBACK_SLOT_5, user_data);
1477 int system_setting_unset_changed_callback_locale_language(system_settings_key_e key)
1479 SETTING_TRACE_BEGIN;
1480 return system_setting_vconf_unset_changed_cb(VCONFKEY_LANGSET, SYSTEM_SETTING_CALLBACK_SLOT_5);
1483 /*--------------------------------------- */
1484 /* LCOV_EXCL_START */
1485 int system_setting_get_locale_timeformat_24hour(system_settings_key_e key, void **value)
1487 SETTING_TRACE_BEGIN;
1490 if (system_setting_vconf_get_value_int(VCONFKEY_REGIONFORMAT_TIME1224, &vconf_value)) {
1491 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1494 bool ret_value = true;
1495 if (vconf_value == VCONFKEY_TIME_FORMAT_12)
1497 else if (vconf_value == VCONFKEY_TIME_FORMAT_24)
1500 *value = (void *)ret_value;
1502 return SYSTEM_SETTINGS_ERROR_NONE;
1504 /* LCOV_EXCL_STOP */
1506 int system_setting_set_locale_timeformat_24hour(system_settings_key_e key, void *value)
1508 SETTING_TRACE_BEGIN;
1511 vconf_value = (bool *)value;
1514 if (system_setting_vconf_set_value_int(VCONFKEY_REGIONFORMAT_TIME1224, VCONFKEY_TIME_FORMAT_24)) {
1515 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1519 if (system_setting_vconf_set_value_int(VCONFKEY_REGIONFORMAT_TIME1224, VCONFKEY_TIME_FORMAT_12)) {
1520 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1525 return SYSTEM_SETTINGS_ERROR_NONE;
1528 int system_setting_set_changed_callback_locale_timeformat_24hour(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1530 SETTING_TRACE_BEGIN;
1531 return system_setting_vconf_set_changed_cb(VCONFKEY_REGIONFORMAT_TIME1224, SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR, SYSTEM_SETTING_CALLBACK_SLOT_3, user_data);
1534 int system_setting_unset_changed_callback_locale_timeformat_24hour(system_settings_key_e key)
1536 SETTING_TRACE_BEGIN;
1537 return system_setting_vconf_unset_changed_cb(VCONFKEY_REGIONFORMAT_TIME1224, SYSTEM_SETTING_CALLBACK_SLOT_3);
1540 int system_setting_get_locale_timezone(system_settings_key_e key, void **value)
1543 ssize_t len = readlink(SETTING_TZONE_SYMLINK_PATH, tzpath, sizeof(tzpath)-1);
1547 SETTING_TRACE("parse error for SETTING_TZONE_SYMLINK_PATH");
1548 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1551 SETTING_TRACE("tzpath : %s ", &tzpath[20]);
1552 *value = strdup(&tzpath[20]);
1553 return SYSTEM_SETTINGS_ERROR_NONE;
1556 /* LCOV_EXCL_START */
1557 int system_setting_set_locale_timezone(system_settings_key_e key, void *value)
1559 SETTING_TRACE_BEGIN;
1560 char *timezone_value = NULL;
1561 timezone_value = (char *)value;
1564 snprintf(tz_path, 1024, "/usr/share/zoneinfo/%s", timezone_value);
1566 int is_load = _is_file_accessible(tz_path);
1568 alarmmgr_set_timezone(tz_path);
1570 if (system_setting_vconf_set_value_string(VCONFKEY_SETAPPL_TIMEZONE_ID, timezone_value)) {
1571 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1573 return SYSTEM_SETTINGS_ERROR_NONE;
1575 return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
1577 /* LCOV_EXCL_STOP */
1581 /* LCOV_EXCL_START */
1582 int system_setting_set_changed_callback_locale_timezone(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1584 return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_TIMEZONE_ID, SYSTEM_SETTINGS_KEY_LOCALE_TIMEZONE, SYSTEM_SETTING_CALLBACK_SLOT_4, user_data);
1586 /* LCOV_EXCL_STOP */
1588 /* LCOV_EXCL_START */
1589 int system_setting_unset_changed_callback_locale_timezone(system_settings_key_e key)
1591 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_TIMEZONE_ID, SYSTEM_SETTING_CALLBACK_SLOT_4);
1593 /* LCOV_EXCL_STOP */
1595 /* LCOV_EXCL_START */
1596 int system_setting_set_changed_callback_locale_timezone_changed(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1598 SETTING_TRACE_BEGIN;
1599 return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
1601 /* LCOV_EXCL_STOP */
1603 /* LCOV_EXCL_START */
1604 int system_setting_unset_changed_callback_locale_timezone_changed(system_settings_key_e key)
1606 SETTING_TRACE_BEGIN;
1607 return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
1609 /* LCOV_EXCL_STOP */
1612 /* LCOV_EXCL_START */
1613 int system_setting_get_time_changed(system_settings_key_e key, void **value)
1615 SETTING_TRACE_BEGIN;
1617 int ** val = (int**)value;
1618 cur_tick = time(NULL);
1620 /* struct tm * localtime = time (cur_tick); */
1621 /* printf("%s\n", ctime(&cur_tick); */
1622 return SYSTEM_SETTINGS_ERROR_NONE;
1625 /* LCOV_EXCL_STOP */
1627 int system_setting_set_changed_callback_time_changed(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1629 SETTING_TRACE_BEGIN;
1630 return system_setting_vconf_set_changed_cb(VCONFKEY_SYSTEM_TIME_CHANGED, SYSTEM_SETTINGS_KEY_TIME_CHANGED, SYSTEM_SETTING_CALLBACK_SLOT_3, user_data);
1633 int system_setting_unset_changed_callback_time_changed(system_settings_key_e key)
1635 SETTING_TRACE_BEGIN;
1636 return system_setting_vconf_unset_changed_cb(VCONFKEY_SYSTEM_TIME_CHANGED, SYSTEM_SETTING_CALLBACK_SLOT_3);
1641 /* SYSTEM_SETTINGS_KEY_SOUND_LOCK */
1642 int system_setting_get_sound_lock(system_settings_key_e key, void **value)
1644 SETTING_TRACE_BEGIN;
1647 if (system_setting_vconf_get_value_bool(VCONFKEY_SETAPPL_SOUND_LOCK_BOOL, &vconf_value)) {
1648 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1650 *value = (void *)vconf_value;
1652 return SYSTEM_SETTINGS_ERROR_NONE;
1655 int system_setting_set_changed_callback_sound_lock(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1657 SETTING_TRACE_BEGIN;
1658 return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_SOUND_LOCK_BOOL, SYSTEM_SETTINGS_KEY_SOUND_LOCK, SYSTEM_SETTING_CALLBACK_SLOT_3, user_data);
1661 int system_setting_unset_changed_callback_sound_lock(system_settings_key_e key)
1663 SETTING_TRACE_BEGIN;
1664 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_SOUND_LOCK_BOOL, SYSTEM_SETTING_CALLBACK_SLOT_3);
1668 * a = VCONFKEY_SETAPPL_SOUND_STATUS_BOOL b = VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL
1670 * a == false, b == false --> silent mode
1671 * a == true, b == false --> sound mode
1672 * a == false, b == true --> vibration mode
1674 /* LCOV_EXCL_START */
1675 int system_setting_get_sound_silent_mode(system_settings_key_e key, void **value)
1677 SETTING_TRACE_BEGIN;
1682 if (system_setting_vconf_get_value_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, &sound_cond)) {
1683 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1686 if (system_setting_vconf_get_value_bool(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, &vib_cond)) {
1687 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1690 if (sound_cond == false && vib_cond == false) {
1692 *value = (void *)vconf_value;
1694 vconf_value = false;
1695 *value = (void *)vconf_value;
1697 return SYSTEM_SETTINGS_ERROR_NONE;
1699 /* LCOV_EXCL_STOP */
1702 * a = VCONFKEY_SETAPPL_SOUND_STATUS_BOOL b = VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL
1704 * a == false, b == false --> silent mode
1705 * a == true, b == false --> sound mode
1707 int system_setting_set_sound_silent_mode(system_settings_key_e key, void *value)
1709 SETTING_TRACE_BEGIN;
1712 vconf_value = (bool *)value;
1714 bool vconf_sound = false;
1715 bool vconf_vib = false;
1718 vconf_sound = false;
1725 if (system_setting_vconf_set_value_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, vconf_sound)) {
1726 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1728 if (system_setting_vconf_set_value_bool(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, vconf_vib)) {
1729 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1732 return SYSTEM_SETTINGS_ERROR_NONE;
1738 int system_setting_set_changed_callback_sound_silent_mode(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1740 SETTING_TRACE_BEGIN;
1741 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);
1745 int system_setting_unset_changed_callback_sound_silent_mode(system_settings_key_e key)
1747 SETTING_TRACE_BEGIN;
1748 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, SYSTEM_SETTING_CALLBACK_SLOT_3);
1751 /* SYSTEM_SETTINGS_KEY_SOUND_TOUCH */
1752 int system_setting_get_sound_touch(system_settings_key_e key, void **value)
1754 SETTING_TRACE_BEGIN;
1757 int ret = system_setting_vconf_get_value_bool(VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL, &vconf_value);
1758 if (ret != SYSTEM_SETTINGS_ERROR_NONE) {
1761 *value = (void *)vconf_value;
1765 int system_setting_set_sound_touch(system_settings_key_e key, void *value)
1767 SETTING_TRACE_BEGIN;
1768 return system_setting_vconf_set_value_bool(VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL, *(bool *)value);
1772 int system_setting_set_changed_callback_sound_touch(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1774 SETTING_TRACE_BEGIN;
1775 return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL, SYSTEM_SETTINGS_KEY_SOUND_TOUCH, SYSTEM_SETTING_CALLBACK_SLOT_2, user_data);
1778 int system_setting_unset_changed_callback_sound_touch(system_settings_key_e key)
1780 SETTING_TRACE_BEGIN;
1781 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL, SYSTEM_SETTING_CALLBACK_SLOT_2);
1785 /* SYSTEM_SETTINGS_KEY_SOUND_LOCK */
1786 int system_setting_get_sound_lock(system_settings_key_e key, void **value)
1790 if (system_setting_vconf_get_value_bool(VCONFKEY_SETAPPL_SOUND_LOCK_BOOL, &vconf_value)) {
1791 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1793 *value = (void *)vconf_value;
1795 return SYSTEM_SETTINGS_ERROR_NONE;
1799 int system_setting_get_auto_rotation_mode(system_settings_key_e key, void **value)
1801 SETTING_TRACE_BEGIN;
1804 if (system_setting_vconf_get_value_bool(VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL, &vconf_value)) {
1805 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1807 *value = (void *)vconf_value;
1809 return SYSTEM_SETTINGS_ERROR_NONE;
1812 /* LCOV_EXCL_START */
1813 int system_setting_set_auto_rotation_mode(system_settings_key_e key, void *value)
1815 SETTING_TRACE_BEGIN;
1817 vconf_value = (bool *)value;
1818 if (system_setting_vconf_set_value_bool(VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL, *vconf_value)) {
1819 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1822 return SYSTEM_SETTINGS_ERROR_NONE;
1824 /* LCOV_EXCL_STOP */
1826 int system_setting_set_changed_callback_auto_rotation_mode(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1828 SETTING_TRACE_BEGIN;
1829 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);
1832 int system_setting_unset_changed_callback_auto_rotation_mode(system_settings_key_e key)
1834 SETTING_TRACE_BEGIN;
1835 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL, SYSTEM_SETTING_CALLBACK_SLOT_2);
1838 int system_setting_get_screen_backlight_time(system_settings_key_e key, void **value)
1840 SETTING_TRACE_BEGIN;
1842 int ** val = (int**)value;
1844 if (system_setting_vconf_get_value_int(VCONFKEY_SETAPPL_LCD_TIMEOUT_NORMAL, &vconf_value)) {
1845 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1847 **val = vconf_value;
1849 return SYSTEM_SETTINGS_ERROR_NONE;
1853 /* LCOV_EXCL_START */
1854 int system_setting_set_screen_backlight_time(system_settings_key_e key, void *value)
1856 SETTING_TRACE_BEGIN;
1858 vconf_value = *(int **)value;
1860 if (!(*vconf_value > 0 && *vconf_value <= 600)) {
1861 SETTING_TRACE(" ERR Betweeny here 0 ~ 600");
1862 return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
1865 if (system_setting_vconf_set_value_int(VCONFKEY_SETAPPL_LCD_TIMEOUT_NORMAL, *vconf_value)) {
1866 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1869 return SYSTEM_SETTINGS_ERROR_NONE;
1871 /* LCOV_EXCL_STOP */
1873 int system_setting_set_changed_callback_screen_backlight_time(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1875 SETTING_TRACE_BEGIN;
1876 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);
1879 int system_setting_unset_changed_callback_screen_backlight_time(system_settings_key_e key)
1881 SETTING_TRACE_BEGIN;
1882 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_LCD_TIMEOUT_NORMAL, SYSTEM_SETTING_CALLBACK_SLOT_2);
1885 int system_setting_get_sound_notification(system_settings_key_e key, void **value)
1887 SETTING_TRACE_BEGIN;
1888 char *vconf_value = NULL;
1889 if (system_setting_vconf_get_value_string(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR, &vconf_value)) {
1890 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1893 *value = vconf_value;
1894 return SYSTEM_SETTINGS_ERROR_NONE;
1897 /* LCOV_EXCL_START */
1898 int system_setting_set_sound_notification(system_settings_key_e key, void *value)
1900 SETTING_TRACE_BEGIN;
1901 char *vconf_value = NULL;
1902 vconf_value = (char *)value;
1904 int is_load = _is_file_accessible(vconf_value);
1906 //SETTING_TRACE(" system_setting_vconf_set_value_string(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR, %s) TRY", vconf_value);
1907 if (system_setting_vconf_set_value_string(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR, vconf_value)) {
1908 //SETTING_TRACE(" system_setting_vconf_set_value_string(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR, %s) FAIL", vconf_value);
1909 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1912 //SETTING_TRACE(" is_file_accessibile FAILED - system_setting_vconf_set_value_string(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR, %s) FAIL", vconf_value);
1913 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1916 return SYSTEM_SETTINGS_ERROR_NONE;
1918 /* LCOV_EXCL_STOP */
1920 int system_setting_set_changed_callback_sound_notification(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1922 SETTING_TRACE_BEGIN;
1923 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);
1926 int system_setting_unset_changed_callback_sound_notification(system_settings_key_e key)
1928 SETTING_TRACE_BEGIN;
1929 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR, SYSTEM_SETTING_CALLBACK_SLOT_0);
1932 int system_setting_get_notification_repetition_period(system_settings_key_e key, void **value)
1934 SETTING_TRACE_BEGIN;
1935 int ** val = (int**)value;
1938 if (system_setting_vconf_get_value_int(VCONFKEY_SETAPPL_NOTI_MSG_ALERT_REP_TYPE_INT, &vconf_value)) {
1939 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1941 **val = vconf_value;
1943 return SYSTEM_SETTINGS_ERROR_NONE;
1946 /* LCOV_EXCL_START */
1947 int system_setting_set_notification_repetition_period(system_settings_key_e key, void *value)
1949 SETTING_TRACE_BEGIN;
1951 vconf_value = *(int **)value;
1953 if (system_setting_vconf_set_value_int(VCONFKEY_SETAPPL_NOTI_MSG_ALERT_REP_TYPE_INT, *vconf_value)) {
1954 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1957 return SYSTEM_SETTINGS_ERROR_NONE;
1959 /* LCOV_EXCL_STOP */
1961 int system_setting_set_changed_callback_notification_repetition_period(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1963 SETTING_TRACE_BEGIN;
1964 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);
1967 int system_setting_unset_changed_callback_notification_repetition_period(system_settings_key_e key)
1969 SETTING_TRACE_BEGIN;
1970 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_NOTI_MSG_ALERT_REP_TYPE_INT, SYSTEM_SETTING_CALLBACK_SLOT_1);
1973 int system_setting_get_device_name(system_settings_key_e key, void **value)
1975 SETTING_TRACE_BEGIN;
1976 char *vconf_value = NULL;
1977 if (system_setting_vconf_get_value_string(VCONFKEY_SETAPPL_DEVICE_NAME_STR, &vconf_value)) {
1978 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1981 *value = vconf_value;
1982 return SYSTEM_SETTINGS_ERROR_NONE;
1985 /* LCOV_EXCL_START */
1986 int system_setting_set_device_name(system_settings_key_e key, void *value)
1988 SETTING_TRACE_BEGIN;
1989 char *vconf_value = NULL;
1990 vconf_value = (char *)value;
1992 if (system_setting_vconf_set_value_string(VCONFKEY_SETAPPL_DEVICE_NAME_STR, vconf_value)) {
1993 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1996 return SYSTEM_SETTINGS_ERROR_NONE;
1998 /* LCOV_EXCL_STOP */
2000 int system_setting_set_changed_callback_device_name(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
2002 SETTING_TRACE_BEGIN;
2003 return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_DEVICE_NAME_STR, SYSTEM_SETTINGS_KEY_DEVICE_NAME, SYSTEM_SETTING_CALLBACK_SLOT_0, user_data);
2006 int system_setting_unset_changed_callback_device_name(system_settings_key_e key)
2008 SETTING_TRACE_BEGIN;
2009 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_DEVICE_NAME_STR, SYSTEM_SETTING_CALLBACK_SLOT_0);
2012 /*---------------------------------------------- */
2013 int system_setting_get_network_flight_mode(system_settings_key_e key, void **value)
2015 SETTING_TRACE_BEGIN;
2017 if (system_setting_vconf_get_value_bool(VCONFKEY_TELEPHONY_FLIGHT_MODE, &vconf_value)) {
2018 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2020 *value = (void *)vconf_value;
2022 return SYSTEM_SETTINGS_ERROR_NONE;
2025 int system_setting_set_changed_callback_network_flight_mode(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
2027 SETTING_TRACE_BEGIN;
2028 return system_setting_vconf_set_changed_cb(VCONFKEY_TELEPHONY_FLIGHT_MODE, SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE, SYSTEM_SETTING_CALLBACK_SLOT_3, user_data);
2031 int system_setting_unset_changed_callback_network_flight_mode(system_settings_key_e key)
2033 SETTING_TRACE_BEGIN;
2034 return system_setting_vconf_unset_changed_cb(VCONFKEY_TELEPHONY_FLIGHT_MODE, SYSTEM_SETTING_CALLBACK_SLOT_3);
2037 int system_setting_get_network_wifi_notification(system_settings_key_e key, void **value)
2039 SETTING_TRACE_BEGIN;
2041 if (system_setting_vconf_get_value_int(VCONFKEY_WIFI_ENABLE_QS, &vconf_value)) {
2042 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2045 bret = (vconf_value == VCONFKEY_WIFI_QS_ENABLE) ? true : false;
2047 *value = (void *)bret;
2048 return SYSTEM_SETTINGS_ERROR_NONE;
2051 int system_setting_set_changed_callback_network_wifi_notification(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
2053 SETTING_TRACE_BEGIN;
2054 return system_setting_vconf_set_changed_cb(VCONFKEY_WIFI_ENABLE_QS, SYSTEM_SETTINGS_KEY_NETWORK_WIFI_NOTIFICATION, SYSTEM_SETTING_CALLBACK_SLOT_4, user_data);
2057 int system_setting_unset_changed_callback_network_wifi_notification(system_settings_key_e key)
2059 SETTING_TRACE_BEGIN;
2060 return system_setting_vconf_unset_changed_cb(VCONFKEY_WIFI_ENABLE_QS, SYSTEM_SETTING_CALLBACK_SLOT_4);
2063 /* LCOV_EXCL_START */
2064 int system_setting_get_lock_state(system_settings_key_e key, void **value)
2067 int ** val = (int**)value;
2069 if (system_setting_vconf_get_value_int(VCONFKEY_IDLE_LOCK_STATE_READ_ONLY, &vconf_value)) {
2070 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2072 **val = vconf_value;
2074 return SYSTEM_SETTINGS_ERROR_NONE;
2076 /* LCOV_EXCL_STOP */
2078 /* LCOV_EXCL_START */
2079 int system_setting_set_lock_state(system_settings_key_e key, void *value)
2081 SETTING_TRACE_BEGIN;
2083 vconf_value = *(int **)value;
2085 if (system_setting_vconf_set_value_int(VCONFKEY_IDLE_LOCK_STATE_READ_ONLY, *vconf_value)) {
2086 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2089 return SYSTEM_SETTINGS_ERROR_NONE;
2091 /* LCOV_EXCL_STOP */
2093 /* LCOV_EXCL_START */
2094 int system_setting_set_changed_callback_lock_state(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
2096 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);
2098 /* LCOV_EXCL_STOP */
2100 /* LCOV_EXCL_START */
2101 int system_setting_unset_changed_callback_lock_state(system_settings_key_e key)
2103 return system_setting_vconf_unset_changed_cb(VCONFKEY_IDLE_LOCK_STATE_READ_ONLY, SYSTEM_SETTING_CALLBACK_SLOT_4);
2105 /* LCOV_EXCL_STOP */
2107 //----------------------------------------------------------------------------------------------------------------------------
2109 #define DEFAULT_ADS_ID "00000000-0000-0000-0000-000000000000"
2111 int system_setting_get_ads_id(system_settings_key_e key, void **value)
2113 SETTING_TRACE_BEGIN;
2114 int optout_value = 0;
2115 if (system_setting_vconf_get_value_int(VCONFKEY_SETAPPL_AD_ID_OPT_OUT, &optout_value)) {
2116 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2119 if (optout_value == 1) {
2120 *value = strdup(DEFAULT_ADS_ID);
2121 return SYSTEM_SETTINGS_ERROR_NONE;
2124 char *vconf_value = NULL;
2125 if (system_setting_vconf_get_value_string(VCONFKEY_SETAPPL_AD_ID, &vconf_value)) {
2126 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2129 *value = vconf_value;
2130 return SYSTEM_SETTINGS_ERROR_NONE;
2135 void make_ad_id(void)
2138 char uuid_unparsed[50] = {0};
2139 uuid_generate(uuid_value);
2140 uuid_unparse(uuid_value, uuid_unparsed);
2141 system_setting_set_ad_id(key, uuid_unparsed); //example of setting the value
2144 int system_setting_set_ads_id(system_settings_key_e key, void *value)
2146 SETTING_TRACE_BEGIN;
2147 char *vconf_value = NULL;
2148 vconf_value = (char *)value;
2150 if (system_setting_vconf_set_value_string(VCONFKEY_SETAPPL_AD_ID, vconf_value)) {
2151 SETTING_TRACE("Setting VCONFKEY_SETAPPL_AD_ID failed");
2152 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2155 return SYSTEM_SETTINGS_ERROR_NONE;
2158 int system_setting_set_changed_callback_ads_id(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
2160 SETTING_TRACE_BEGIN;
2161 return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_AD_ID, SYSTEM_SETTINGS_KEY_ADS_ID, SYSTEM_SETTING_CALLBACK_SLOT_0, user_data);
2164 int system_setting_unset_changed_callback_ads_id(system_settings_key_e key)
2166 SETTING_TRACE_BEGIN;
2167 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_AD_ID, SYSTEM_SETTING_CALLBACK_SLOT_0);
2170 int system_settings_feature_check_bool(char *path)
2172 bool feature_data = false;
2173 int ret = system_info_get_platform_bool(path, &feature_data);
2174 if (ret != SYSTEM_INFO_ERROR_NONE) {
2175 SETTING_TRACE("Setting - reading feature data failed, %d", ret);
2176 return SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
2179 ret = (feature_data == true) ? SYSTEM_SETTINGS_ERROR_NONE : SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
2185 int system_setting_feature_check_incoming_call(void *value)
2187 static bool first_query = true;
2188 static int ret = SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
2190 if (first_query == true) {
2191 ret = system_settings_feature_check_bool(SETTING_INCOMING_CALL_PATH);
2192 first_query = false;
2198 int system_setting_feature_check_home_screen(void *value)
2200 static bool first_query = true;
2201 static int ret = SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
2203 if (first_query == true) {
2204 ret = system_settings_feature_check_bool(SETTING_HOME_SCREEN_PATH);
2205 first_query = false;
2211 int system_setting_feature_check_lock_screen(void *value)
2213 static bool first_query = true;
2214 static int ret = SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
2216 if (first_query == true) {
2217 ret = system_settings_feature_check_bool(SETTING_LOCK_SCREEN_PATH);
2218 first_query = false;
2224 int system_setting_feature_check_notification_email(void *value)
2226 static bool first_query = true;
2227 static int ret = SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
2229 if (first_query == true) {
2230 ret = system_settings_feature_check_bool(SETTING_NOTIFICATION_EMAIL_PATH);
2231 first_query = false;
2237 int system_setting_feature_check_wifi(void *value)
2239 static bool first_query = true;
2240 static int ret = SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
2242 if (first_query == true) {
2243 ret = system_settings_feature_check_bool(SETTING_WIFI_PATH);
2244 first_query = false;
2250 int system_setting_feature_check_telephony(void *value)
2252 static bool first_query = true;
2253 static int ret = SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
2255 if (first_query == true) {
2256 ret = system_settings_feature_check_bool(SETTING_TELEPHONY_PATH);
2257 first_query = false;
2264 int system_setting_feature_check_font(void *value)
2266 static bool first_query = true;
2267 static int ret = SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
2269 if (first_query == true) {
2270 ret = system_settings_feature_check_bool(SETTING_FONT_PATH);
2271 first_query = false;
2277 int system_setting_feature_check_accessibility_grayscale(void *value)
2279 static bool first_query = true;
2280 static int ret = SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
2282 if (first_query == true) {
2283 ret = system_settings_feature_check_bool(SETTING_ACCESSIBILITY_GRAYSCALE_PATH);
2284 first_query = false;
2290 int system_setting_feature_check_accessibility_negative(void *value)
2292 static bool first_query = true;
2293 static int ret = SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
2295 if (first_query == true) {
2296 ret = system_settings_feature_check_bool(SETTING_ACCESSIBILITY_NEGATIVE_PATH);
2297 first_query = false;
2303 int system_setting_feature_check_wearable_profile(void *value)
2305 static bool first_query = true;
2306 static int ret = SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
2308 if (first_query == true) {
2309 char *profile_data = NULL;
2310 int rotary_feature = SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
2311 ret = system_info_get_platform_string(SETTING_PROFILE_PATH, &profile_data);
2312 if (ret != SYSTEM_INFO_ERROR_NONE) {
2313 SETTING_TRACE("Setting - reading profile string failed, %d", ret);
2314 return SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
2317 rotary_feature = system_settings_feature_check_bool(SETTING_INPUT_ROTATING_BEZEL_PATH);
2319 if ((rotary_feature == SYSTEM_SETTINGS_ERROR_NONE) && profile_data && !strcmp(profile_data, "wearable"))
2320 ret = SYSTEM_SETTINGS_ERROR_NONE;
2322 ret = SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
2327 first_query = false;
2333 /* LCOV_EXCL_START */
2334 int system_setting_get_uds_state(system_settings_key_e key, void **value)
2336 int ** p_value = (int**)value;
2338 char *vconf_string_value = NULL;
2340 if (system_setting_vconf_get_value_int(VCONFKEY_SETAPPL_UDSM, &vconf_value)) {
2341 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2344 SETTING_TRACE("[%s] udsm: %d", __FUNCTION__, vconf_value);
2346 if (vconf_value == SYSTEM_SETTINGS_UDS_ON) {
2347 if (system_setting_vconf_get_value_string(VCONFKEY_SETAPPL_UDSM_PKGID_LIST, &vconf_string_value))
2348 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2350 if (vconf_string_value) {
2351 if (!strcmp(vconf_string_value, "NONE")) {
2352 vconf_value = SYSTEM_SETTINGS_UDS_ON;
2354 char *app_id = NULL;
2355 char *package_id = NULL;
2356 pid_t pid = getpid();
2358 int ret = app_manager_get_app_id(pid, &app_id);
2359 if (ret != APP_MANAGER_ERROR_NONE) {
2360 free(vconf_string_value);
2361 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2366 result = package_manager_get_package_id_by_app_id(app_id, &package_id);
2367 if (result != PACKAGE_MANAGER_ERROR_NONE) {
2368 SETTING_TRACE("package_manager_get_package_id_by_app_id returned error! %d", result);
2369 free(vconf_string_value);
2370 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2373 SETTING_TRACE("[%s] udsm_pkg_list : %s", __FUNCTION__, vconf_string_value);
2376 if (package_id && strstr(vconf_string_value, package_id)) {
2377 vconf_value = SYSTEM_SETTINGS_UDS_ON_WHITELISTED;
2378 SETTING_TRACE("[%s] pkg id : %s", __FUNCTION__, package_id);
2380 vconf_value = SYSTEM_SETTINGS_UDS_ON;
2384 free(vconf_string_value);
2388 **p_value = vconf_value;
2391 return SYSTEM_SETTINGS_ERROR_NONE;
2393 /* LCOV_EXCL_STOP */
2395 /* LCOV_EXCL_START */
2396 int system_setting_set_changed_callback_uds_state(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
2398 return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_UDSM, SYSTEM_SETTINGS_KEY_ULTRA_DATA_SAVE, SYSTEM_SETTING_CALLBACK_SLOT_4, user_data);
2400 /* LCOV_EXCL_STOP */
2402 /* LCOV_EXCL_START */
2403 int system_setting_unset_changed_callback_uds_state(system_settings_key_e key)
2405 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_UDSM, SYSTEM_SETTING_CALLBACK_SLOT_4);
2407 /* LCOV_EXCL_STOP */
2409 /* LCOV_EXCL_START */
2410 int system_setting_set_changed_callback_uds_pkg_list(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
2412 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);
2414 /* LCOV_EXCL_STOP */
2416 /* LCOV_EXCL_START */
2417 int system_setting_unset_changed_callback_uds_pkg_list(system_settings_key_e key)
2419 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_UDSM_PKGID_LIST, SYSTEM_SETTING_CALLBACK_SLOT_4);
2421 /* LCOV_EXCL_STOP */
2423 /* SYSTEM_SETTINGS_KEY_ACCESSIBILITY_TTS */
2424 int system_setting_get_accessibility_tts(system_settings_key_e key, void **value)
2426 SETTING_TRACE_BEGIN;
2429 int ret = system_setting_vconf_get_value_bool(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, &vconf_value);
2430 if (ret != SYSTEM_SETTINGS_ERROR_NONE) {
2433 *value = (void *)vconf_value;
2437 /* LCOV_EXCL_START */
2438 int system_setting_set_accessibility_tts(system_settings_key_e key, void *value)
2440 SETTING_TRACE_BEGIN;
2442 vconf_value = (bool *)value;
2443 if (system_setting_vconf_set_value_bool(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, *vconf_value)) {
2444 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2447 return SYSTEM_SETTINGS_ERROR_NONE;
2449 /* LCOV_EXCL_STOP */
2451 int system_setting_set_changed_callback_accessibility_tts(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
2453 SETTING_TRACE_BEGIN;
2454 return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, SYSTEM_SETTINGS_KEY_ACCESSIBILITY_TTS, SYSTEM_SETTING_CALLBACK_SLOT_2, user_data);
2457 int system_setting_unset_changed_callback_accessibility_tts(system_settings_key_e key)
2459 SETTING_TRACE_BEGIN;
2460 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, SYSTEM_SETTING_CALLBACK_SLOT_2);
2463 /* SYSTEM_SETTINGS_KEY_VIBRATION */
2464 int system_setting_get_vibration(system_settings_key_e key, void **value)
2466 SETTING_TRACE_BEGIN;
2469 if (system_setting_vconf_get_value_bool(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, &vconf_value)) {
2470 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2472 *value = (void *)vconf_value;
2474 return SYSTEM_SETTINGS_ERROR_NONE;
2477 /* LCOV_EXCL_START */
2478 int system_setting_set_vibration(system_settings_key_e key, void *value)
2480 SETTING_TRACE_BEGIN;
2482 vconf_value = (bool *)value;
2483 if (system_setting_vconf_set_value_bool(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, *vconf_value)) {
2484 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2487 return SYSTEM_SETTINGS_ERROR_NONE;
2489 /* LCOV_EXCL_STOP */
2491 int system_setting_set_changed_callback_vibration(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
2493 SETTING_TRACE_BEGIN;
2494 return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, SYSTEM_SETTINGS_KEY_VIBRATION, SYSTEM_SETTING_CALLBACK_SLOT_2, user_data);
2497 int system_setting_unset_changed_callback_vibration(system_settings_key_e key)
2499 SETTING_TRACE_BEGIN;
2500 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, SYSTEM_SETTING_CALLBACK_SLOT_2);
2503 /* SYSTEM_SETTINGS_KEY_AUTOMATIC_TIME_UPDATE */
2504 int system_setting_get_automatic_time_update(system_settings_key_e key, void **value)
2506 SETTING_TRACE_BEGIN;
2509 if (system_setting_vconf_get_value_bool(VCONFKEY_SETAPPL_STATE_AUTOMATIC_TIME_UPDATE_BOOL, &vconf_value)) {
2510 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2512 *value = (void *)vconf_value;
2514 return SYSTEM_SETTINGS_ERROR_NONE;
2517 /* LCOV_EXCL_START */
2518 int system_setting_set_automatic_time_update(system_settings_key_e key, void *value)
2520 SETTING_TRACE_BEGIN;
2522 vconf_value = (bool *)value;
2523 if (system_setting_vconf_set_value_bool(VCONFKEY_SETAPPL_STATE_AUTOMATIC_TIME_UPDATE_BOOL, *vconf_value)) {
2524 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2527 return SYSTEM_SETTINGS_ERROR_NONE;
2529 /* LCOV_EXCL_STOP */
2531 int system_setting_set_changed_callback_automatic_time_update(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
2533 SETTING_TRACE_BEGIN;
2534 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);
2537 int system_setting_unset_changed_callback_automatic_time_update(system_settings_key_e key)
2539 SETTING_TRACE_BEGIN;
2540 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_STATE_AUTOMATIC_TIME_UPDATE_BOOL, SYSTEM_SETTING_CALLBACK_SLOT_2);
2543 /* SYSTEM_SETTINGS_KEY_DEVELOPER_OPTION_STATE */
2544 int system_setting_get_developer_option_state(system_settings_key_e key, void **value)
2546 SETTING_TRACE_BEGIN;
2549 if (system_setting_vconf_get_value_bool(VCONFKEY_SETAPPL_DEVELOPER_OPTION_STATE, &vconf_value)) {
2550 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2552 *value = (void *)vconf_value;
2554 return SYSTEM_SETTINGS_ERROR_NONE;
2557 /* LCOV_EXCL_START */
2558 int system_setting_set_developer_option_state(system_settings_key_e key, void *value)
2560 SETTING_TRACE_BEGIN;
2562 vconf_value = (bool *)value;
2563 if (system_setting_vconf_set_value_bool(VCONFKEY_SETAPPL_DEVELOPER_OPTION_STATE, *vconf_value)) {
2564 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2567 return SYSTEM_SETTINGS_ERROR_NONE;
2569 /* LCOV_EXCL_STOP */
2571 int system_setting_set_changed_callback_developer_option_state(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
2573 SETTING_TRACE_BEGIN;
2574 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);
2577 int system_setting_unset_changed_callback_developer_option_state(system_settings_key_e key)
2579 SETTING_TRACE_BEGIN;
2580 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_DEVELOPER_OPTION_STATE, SYSTEM_SETTING_CALLBACK_SLOT_2);
2583 /* SYSTEM_SETTINGS_KEY_ACCESSIBILITY_GRAYSCALE */
2584 int system_setting_get_accessibility_grayscale(system_settings_key_e key, void **value)
2586 SETTING_TRACE_BEGIN;
2589 if (system_setting_vconf_get_value_bool(VCONFKEY_SETAPPL_ACCESSIBILITY_GREYSCALE, &vconf_value)) {
2590 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2592 *value = (void *)vconf_value;
2594 return SYSTEM_SETTINGS_ERROR_NONE;
2597 /* LCOV_EXCL_START */
2598 int system_setting_set_accessibility_grayscale(system_settings_key_e key, void *value)
2600 SETTING_TRACE_BEGIN;
2602 vconf_value = (bool *)value;
2603 if (system_setting_vconf_set_value_bool(VCONFKEY_SETAPPL_ACCESSIBILITY_GREYSCALE, *vconf_value)) {
2604 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2607 return SYSTEM_SETTINGS_ERROR_NONE;
2609 /* LCOV_EXCL_STOP */
2611 int system_setting_set_changed_callback_accessibility_grayscale(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
2613 SETTING_TRACE_BEGIN;
2614 return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_ACCESSIBILITY_GREYSCALE, SYSTEM_SETTINGS_KEY_ACCESSIBILITY_GRAYSCALE, SYSTEM_SETTING_CALLBACK_SLOT_2, user_data);
2617 int system_setting_unset_changed_callback_accessibility_grayscale(system_settings_key_e key)
2619 SETTING_TRACE_BEGIN;
2620 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_ACCESSIBILITY_GREYSCALE, SYSTEM_SETTING_CALLBACK_SLOT_2);
2623 /* SYSTEM_SETTINGS_KEY_ACCESSIBILITY_NEGATIVE_COLOR */
2624 int system_setting_get_accessibility_negative_color(system_settings_key_e key, void **value)
2626 SETTING_TRACE_BEGIN;
2629 if (system_setting_vconf_get_value_bool(VCONFKEY_SETAPPL_ACCESSIBILITY_HIGH_CONTRAST, &vconf_value)) {
2630 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2632 *value = (void *)vconf_value;
2634 return SYSTEM_SETTINGS_ERROR_NONE;
2637 /* LCOV_EXCL_START */
2638 int system_setting_set_accessibility_negative_color(system_settings_key_e key, void *value)
2640 SETTING_TRACE_BEGIN;
2642 vconf_value = (bool *)value;
2643 if (system_setting_vconf_set_value_bool(VCONFKEY_SETAPPL_ACCESSIBILITY_HIGH_CONTRAST, *vconf_value)) {
2644 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2647 return SYSTEM_SETTINGS_ERROR_NONE;
2649 /* LCOV_EXCL_STOP */
2651 int system_setting_set_changed_callback_accessibility_negative_color(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
2653 SETTING_TRACE_BEGIN;
2654 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);
2657 int system_setting_unset_changed_callback_accessibility_negative_color(system_settings_key_e key)
2659 SETTING_TRACE_BEGIN;
2660 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_ACCESSIBILITY_HIGH_CONTRAST, SYSTEM_SETTING_CALLBACK_SLOT_2);
2663 /* SYSTEM_SETTINGS_KEY_ROTARY_EVENT_ENABLED */
2664 /* LCOV_EXCL_START */
2665 int system_setting_get_rotary_event_enabled(system_settings_key_e key, void **value)
2667 SETTING_TRACE_BEGIN;
2670 if (system_setting_vconf_get_value_bool(VCONFKEY_SETAPPL_ROTARY_EVENT_ENABLED_BOOL, &vconf_value)) {
2671 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2673 *value = (void *)vconf_value;
2675 return SYSTEM_SETTINGS_ERROR_NONE;
2677 /* LCOV_EXCL_STOP */
2679 /* LCOV_EXCL_START */
2680 int system_setting_set_rotary_event_enabled(system_settings_key_e key, void *value)
2682 SETTING_TRACE_BEGIN;
2684 vconf_value = (bool *)value;
2685 if (system_setting_vconf_set_value_bool(VCONFKEY_SETAPPL_ROTARY_EVENT_ENABLED_BOOL, *vconf_value)) {
2686 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2689 return SYSTEM_SETTINGS_ERROR_NONE;
2691 /* LCOV_EXCL_STOP */
2693 /* LCOV_EXCL_START */
2694 int system_setting_set_changed_callback_rotary_event_enabled(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
2696 SETTING_TRACE_BEGIN;
2697 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);
2699 /* LCOV_EXCL_STOP */
2701 /* LCOV_EXCL_START */
2702 int system_setting_unset_changed_callback_rotary_event_enabled(system_settings_key_e key)
2704 SETTING_TRACE_BEGIN;
2705 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_ROTARY_EVENT_ENABLED_BOOL, SYSTEM_SETTING_CALLBACK_SLOT_3);
2707 /* LCOV_EXCL_STOP */