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"
301 int system_setting_add_incoming_call_ringtone(system_settings_key_e key, void *value)
304 char* pathval = (char*)value;
305 char* dnameval = NULL;
306 char* baseval = NULL;
310 JsonParser *parser = ss_json_ringtone_open_file(JSONFILE);
312 JsonParser *parser = ss_json_ringtone_load_from_data();
315 JsonNode *root = json_parser_get_root(parser);
319 int ret = SYSTEM_SETTINGS_ERROR_NONE;
320 if (false == ss_json_ringtone_contain(root, pathval)) {
321 // @todo : MAKE SURE THE ACTUAL FILE IS THERE ON PATHVAL(SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER)
322 ss_json_ringtone_add(root, JSONFILE, pathval, pathval);
323 SETTING_TRACE("pathval is : %s -- OK", pathval);
325 SETTING_TRACE("pathval is duplicated : %s", pathval);
326 ret = SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
329 dnameval = strdup(pathval);
330 baseval = strdup(pathval);
331 if (dnameval && baseval) {
332 SETTING_TRACE("---> dirname is : %s ", dirname(dnameval));
333 SETTING_TRACE("---> basename is : %s ", basename(baseval));
339 g_object_unref(parser);
346 int system_setting_del_incoming_call_ringtone(system_settings_key_e key, void *value)
349 char* pathval = (char*)value;
352 JsonParser* parser = ss_json_ringtone_open_file(JSONFILE);
354 JsonParser* parser = ss_json_ringtone_load_from_data();
356 JsonNode *root = json_parser_get_root(parser);
358 ss_json_ringtone_remove(root, JSONFILE, pathval);
359 //void ss_json_ringtone_remove(JsonNode *root, char* filename, char* path_to_del)
361 ss_json_ringtone_print(root);
363 g_object_unref(parser);
367 return SYSTEM_SETTINGS_ERROR_NONE;
371 /* LCOV_EXCL_START */
372 gint _compare_cb(gconstpointer d1, gconstpointer d2)
374 fileNodeInfo *pNode1 = (fileNodeInfo *)d1;
375 fileNodeInfo *pNode2 = (fileNodeInfo *)d2;
377 return strcmp(pNode1->media_name, pNode2->media_name);
382 * get the RINGTONE list
384 static void _get_default_ringtones(system_settings_key_e key, system_settings_iter_cb callback, void *data)
388 GList *filelist = NULL;
390 fileNodeInfo *node = NULL;
393 //-----------------------------------------------------------------------------------------------------------------
394 // 1. get the default ringtone list
395 //-----------------------------------------------------------------------------------------------------------------
396 int ret = get_filelist_from_dir_path(DEF_RINGTONE_FILE_PATH, &filelist);
398 SETTING_TRACE("Failed to get filelist, ret = %d %s", ret, DEF_RINGTONE_FILE_PATH);
401 filelist = g_list_sort(filelist, _compare_cb);
403 for (iter = filelist; iter != NULL; iter = g_list_next(iter)) {
404 node = (fileNodeInfo *)iter->data;
405 SETTING_TRACE("file path = (%d) : name:%s path:%s [%s]", ret, node->name, node->path, node->media_name);
406 // @todo assert NULL check
409 snprintf(temp, 1024, "%s/%s", node->path, node->name);
410 char* path = strdup(temp);
411 bool ret = callback(idx, (void *)(path), data);
417 SETTING_TRACE("quit the iteration by return value == false : %d", ret);
422 SETTING_TRACE("--> system_setting_data_iterator is NULL");
426 for (iter = filelist; iter != NULL; iter = g_list_next(iter)) {
427 node = (fileNodeInfo *)iter->data;
430 FREE(node->media_name);
433 g_list_free(filelist);
438 static void _get_user_ringtones(system_settings_key_e key, system_settings_iter_cb callback, void *data)
444 JsonParser* parser = ss_json_ringtone_open_file(JSONFILE);
446 JsonParser* parser = ss_json_ringtone_load_from_data();
449 JsonNode *root = json_parser_get_root(parser);
450 int size = json_array_get_length(json_node_get_array(root));
453 for (i = 0; i < size ; i++) {
454 JsonObject *ringtone = json_array_get_object_element(json_node_get_array(root), i);
455 char *nameval = (char *)json_object_get_string_member(ringtone, "name");
456 char *pathval = (char *)json_object_get_string_member(ringtone, "path");
457 SETTING_TRACE("(%s) --- (%s) \n", nameval, pathval);
458 if (callback && pathval) {
459 char* path = strdup(pathval);
460 bool ret = callback(i, (void *)(path), data);
462 SETTING_TRACE("quit the iteration by return value == false : %d", ret);
467 SETTING_TRACE("--> callback is NULL");
471 g_object_unref(parser);
474 int system_setting_list_incoming_call_ringtone(system_settings_key_e key, system_settings_iter_cb callback, void *data)
478 _get_default_ringtones(key, callback, data);
479 //-----------------------------------------------------------------------------------------------------------------
480 // 2. get the USER ringtone list
481 //-----------------------------------------------------------------------------------------------------------------
482 _get_user_ringtones(key, callback, data);
484 return SYSTEM_SETTINGS_ERROR_NONE;
488 /* LCOV_EXCL_START */
489 int system_setting_set_incoming_call_ringtone(system_settings_key_e key, void *value)
493 vconf_value = (char *)value;
495 int ret = _is_file_accessible(vconf_value);
497 if (system_setting_vconf_set_value_string(VCONFKEY_SETAPPL_CALL_RINGTONE_PATH_STR, vconf_value)) {
498 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
501 /* @todo add a common ret_handler */
505 return SYSTEM_SETTINGS_ERROR_NONE;
510 /* LCOV_EXCL_START */
511 int system_setting_set_email_alert_ringtone(system_settings_key_e key, void *value)
515 vconf_value = (char *)value;
517 int ret = _is_file_accessible(vconf_value);
519 if (system_setting_vconf_set_value_string(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR, vconf_value)) {
520 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
523 /*return SYSTEM_SETTINGS_ERROR_IO_ERROR;*/
524 /* @todo add a common ret_handler */
528 return SYSTEM_SETTINGS_ERROR_NONE;
532 /* LCOV_EXCL_START */
533 static bool dl_is_supported_image_type_load(char *path)
538 bool (*image_type_check)(char *path);
540 handle = dlopen(SETTING_UTILS_SO_FILE_PATH, RTLD_LAZY);
542 SETTING_TRACE("ERROR!! canNOT find libsystem-settings-util.so.0.1.0");
546 image_type_check = dlsym(handle, "__is_supported_image_type_load");
547 if ((error = dlerror()) != NULL) {
548 SETTING_TRACE("ERROR!! canNOT find __is_supported_image_type_load function at libsystem-settings-util.so.0.1.0");
553 ret = image_type_check(path);
560 /* LCOV_EXCL_START */
561 static int dl_is_available_font(char *str)
566 int (*check_available_font)(char *font_name);
568 handle = dlopen(SETTING_UTILS_SO_FILE_PATH, RTLD_LAZY);
570 SETTING_TRACE("ERROR!! canNOT find libsystem-settings-util.so.0.1.0");
574 check_available_font = dlsym(handle, "__is_available_font");
575 if ((error = dlerror()) != NULL) {
576 SETTING_TRACE("ERROR!! canNOT find __is_available_font function at libsystem-settings-util.so.0.1.0");
581 ret = check_available_font(str);
588 /* LCOV_EXCL_START */
589 static void dl_font_size_set()
593 void (*set_font_size)();
595 handle = dlopen(SETTING_UTILS_SO_FILE_PATH, RTLD_LAZY);
597 SETTING_TRACE("ERROR!! canNOT find libsystem-settings-util.so.0.1.0");
601 set_font_size = dlsym(handle, "__font_size_set");
602 if ((error = dlerror()) != NULL) {
603 SETTING_TRACE("ERROR!! canNOT find __font_size_set function at libsystem-settings-util.so.0.1.0");
615 /* LCOV_EXCL_START */
616 static void dl_font_config_set_notification()
620 void (*set_font_nodification)();
622 handle = dlopen(SETTING_UTILS_SO_FILE_PATH, RTLD_LAZY);
624 SETTING_TRACE("ERROR!! canNOT find libsystem-settings-util.so.0.1.0");
628 set_font_nodification = dlsym(handle, "font_config_set_notification");
629 if ((error = dlerror()) != NULL) {
630 SETTING_TRACE("ERROR!! canNOT find font_config_set_notification function at libsystem-settings-util.so.0.1.0");
635 set_font_nodification();
642 /* LCOV_EXCL_START */
643 static bool dl_font_config_set(char *font_name)
648 bool (*check_font_type)(char *font_name);
650 handle = dlopen(SETTING_UTILS_SO_FILE_PATH, RTLD_LAZY);
652 SETTING_TRACE("ERROR!! canNOT find libsystem-settings-util.so.0.1.0");
656 check_font_type = dlsym(handle, "font_config_set");
657 if ((error = dlerror()) != NULL) {
658 SETTING_TRACE("ERROR!! canNOT find font_config_set function at libsystem-settings-util.so.0.1.0");
663 ret = check_font_type(font_name);
670 /* LCOV_EXCL_START */
671 static char *dl_get_default_font_info()
676 char *(*get_font_info)();
678 handle = dlopen(SETTING_UTILS_SO_FILE_PATH, RTLD_LAZY);
680 SETTING_TRACE("ERROR!! canNOT find libsystem-settings-util.so.0.1.0");
684 get_font_info = dlsym(handle, "_get_default_font");
686 if ((error = dlerror()) != NULL) {
687 SETTING_TRACE("ERROR!! canNOT find _get_default_font function at libsystem-settings-util.so.0.1.0");
692 ret = get_font_info();
699 #ifdef TIZEN_WEARABLE
700 /* LCOV_EXCL_START */
701 static int system_setting_get_extended_wallpaper_num(const char *file_path, unsigned int *num)
705 const char *find_str = "extended_wallpaper_";
708 if (!(ch = strstr(file_path, find_str))) {
709 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
711 strncpy(buffer, file_path, ch - file_path);
712 buffer[ch - file_path] = 0;
713 sprintf(buffer + (ch - file_path), "%s%s", "", ch + strlen(find_str));
715 if (!isdigit(buffer[0])) {
716 SETTING_TRACE("%s is not number", buffer);
717 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
722 return SYSTEM_SETTINGS_ERROR_NONE;
726 /* LCOV_EXCL_START */
727 static int system_setting_copy_extended_wallpaper(const char *dest_file_path, const char *source_file_path)
730 if (!source_file_path || !dest_file_path) {
731 return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
737 fd = open(source_file_path, O_RDONLY);
739 SETTING_TRACE("file open failed: %s", source_file_path);
740 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
744 fd2 = open(dest_file_path, O_WRONLY | O_CREAT, S_IRWXU | S_IRWXG | S_IRWXO);
746 SETTING_TRACE("file creation failed: %s", dest_file_path);
748 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
751 while (read(fd, buf, sizeof(buf) - 1) > 0) {
752 write(fd2, buf, sizeof(buf) - 1);
758 if (chmod(dest_file_path, S_IRWXU | S_IRWXG | S_IRWXO) < 0) {
759 SETTING_TRACE("chmod failed: %s", dest_file_path);
762 return SYSTEM_SETTINGS_ERROR_NONE;
766 /* LCOV_EXCL_START */
767 static int system_setting_remove_oldest_extended_wallpaper()
772 char *min_image_name = NULL;
773 unsigned int min_image_num = 0;
774 unsigned int temp_image_num = 0;
777 if ((dp = opendir(_TZ_SYS_DATA"/setting/wallpaper")) == NULL) {
778 SETTING_TRACE("opendir error");
779 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
782 while ((dirp = readdir(dp))) {
783 if (!strcmp(dirp->d_name, ".") || !strcmp(dirp->d_name, ".."))
786 if (system_setting_get_extended_wallpaper_num(dirp->d_name, &temp_image_num)
787 != SYSTEM_SETTINGS_ERROR_NONE) {
788 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
791 if ((image_count == 0) || (min_image_num > temp_image_num)) {
792 min_image_num = temp_image_num;
793 min_image_name = dirp->d_name;
800 if (min_image_name) {
801 snprintf(buf, sizeof(buf) - 1, _TZ_SYS_DATA"/setting/wallpaper/%s", min_image_name);
802 if (remove(buf) < 0) { /* remove oldest image */
803 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
807 return SYSTEM_SETTINGS_ERROR_NONE;
811 /* LCOV_EXCL_START */
812 static int system_setting_check_extended_wallpaper(const char *file_path)
816 if (!file_path || !strlen(file_path))
818 snprintf(buffer, 512, "%s/.bgwallpaper", tzplatform_getenv(TZ_USER_CONTENT));
819 return (strstr(file_path, buffer) != NULL);
823 #define WALLPAPER_MAX_COUNT 10
825 /* LCOV_EXCL_START */
826 int system_setting_set_wallpaper_home_screen(system_settings_key_e key, void *value)
830 vconf_value = (char *)value;
832 bool isok = dl_is_supported_image_type_load(vconf_value);
835 SETTING_TRACE("path : %s is not supported file format", vconf_value);
836 return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
838 SETTING_TRACE("path : %s is SUPPORT file format", vconf_value);
841 /* error handling here */
842 if (_is_file_accessible(vconf_value) != 0)
843 return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
845 if (system_setting_vconf_set_value_string(VCONFKEY_BGSET, vconf_value)) {
846 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
850 #ifdef TIZEN_WEARABLE
851 if (system_setting_check_extended_wallpaper(vconf_value)) { /* New extended wallpaper */
854 unsigned int max_image_num = 0;
855 unsigned int temp_image_num = 0;
858 if ((dp = opendir(_TZ_SYS_DATA"/setting/wallpaper")) == NULL) {
859 SETTING_TRACE("Setting - dir open error!");
860 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
863 /* Check a max number of wallpapers */
864 while ((dirp = readdir(dp))) {
865 if (!strcmp(dirp->d_name, ".") || !strcmp(dirp->d_name, ".."))
868 if (system_setting_get_extended_wallpaper_num(dirp->d_name, &temp_image_num)
869 != SYSTEM_SETTINGS_ERROR_NONE) {
872 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
875 if ((image_count == 0) || (max_image_num < temp_image_num)) {
876 max_image_num = temp_image_num;
884 /* Numbering rule: Gear is odd number */
885 max_image_num = (max_image_num % 2 == 0) ? max_image_num + 1
888 char file_name_buffer[512];
889 snprintf(file_name_buffer, sizeof(file_name_buffer) - 1,
890 _TZ_SYS_DATA"/setting/wallpaper/extended_wallpaper_%d.jpg", max_image_num);
892 /* Copy image to _TZ_SYS_DATA/setting/wallpaper/ */
893 if (system_setting_copy_extended_wallpaper(file_name_buffer, vconf_value)
894 != SYSTEM_SETTINGS_ERROR_NONE) {
895 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
898 /* remove oldest wallpaper */
899 if (image_count >= WALLPAPER_MAX_COUNT) {
900 if (system_setting_remove_oldest_extended_wallpaper()
901 != SYSTEM_SETTINGS_ERROR_NONE) {
902 remove(file_name_buffer);
903 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
907 if (system_setting_vconf_set_value_string(VCONFKEY_BGSET, file_name_buffer)) {
908 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
911 if (system_setting_vconf_set_value_int(VCONFKEY_SETAPPL_WALLPAPER_CHANGED_NOTI_INT,
912 VCONFKEY_WALLPAPER_CHANGED_NOTI_GEAR)) {
913 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
916 if (system_setting_vconf_set_value_string(VCONFKEY_BGSET, vconf_value)) {
917 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
922 return SYSTEM_SETTINGS_ERROR_NONE;
926 /* LCOV_EXCL_START */
927 int system_setting_set_wallpaper_lock_screen(system_settings_key_e key, void *value)
931 vconf_value = (char *)value;
933 bool isok = dl_is_supported_image_type_load(vconf_value);
936 SETTING_TRACE("path : %s is not supported file format", vconf_value);
937 return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
939 SETTING_TRACE("path : %s is SUPPORT file format", vconf_value);
942 /* error handling here */
943 if (_is_file_accessible(vconf_value) != 0)
944 return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
946 if (system_setting_vconf_set_value_string(VCONFKEY_IDLE_LOCK_BGSET, vconf_value)) {
947 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
950 return SYSTEM_SETTINGS_ERROR_NONE;
954 /* LCOV_EXCL_START */
955 int system_setting_set_font_size(system_settings_key_e key, void *value)
959 vconf_value = *(int **)value;
961 if (*vconf_value < 0 || *vconf_value > SYSTEM_SETTINGS_FONT_SIZE_GIANT) {
962 return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
965 if (system_setting_vconf_set_value_int(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, *vconf_value)) {
966 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
970 return SYSTEM_SETTINGS_ERROR_NONE;
976 /* LCOV_EXCL_START */
977 void *font_conf_doc_parse(char *doc_name, char *font_name)
980 xmlDocPtr doc = NULL;
981 xmlNodePtr cur = NULL;
982 xmlNodePtr cur2 = NULL;
983 xmlNodePtr cur3 = NULL;
986 doc = xmlParseFile(doc_name);
988 cur = xmlDocGetRootElement(doc);
996 if (xmlStrcmp(cur->name, (const xmlChar *)"fontconfig")) {
1002 cur = cur->xmlChildrenNode;
1004 bool is_changed = false;
1005 while (cur != NULL) {
1006 if ((!xmlStrcmp(cur->name, (const xmlChar *)"match"))) {
1007 cur2 = cur->xmlChildrenNode;
1008 while (cur2 != NULL) {
1009 if ((!xmlStrcmp(cur2->name, (const xmlChar *)"edit"))) {
1010 xmlChar *name = xmlGetProp(cur2, (const xmlChar *)"name");
1011 /* if name is not 'family', break */
1012 if (xmlStrcmp(name, (const xmlChar *)"family")) {
1020 cur3 = cur2->xmlChildrenNode;
1021 while (cur3 != NULL) {
1022 if ((!xmlStrcmp(cur3->name, (const xmlChar *)"string"))) {
1023 xmlNodeSetContent(cur3->xmlChildrenNode, (const xmlChar *)font_name);
1024 key = xmlNodeListGetString(doc, cur3->xmlChildrenNode, 1);
1034 } else if ((!xmlStrcmp(cur->name, (const xmlChar *)"alias"))) {
1035 cur2 = cur->xmlChildrenNode;
1036 while (cur2 != NULL) {
1037 if ((!xmlStrcmp(cur2->name, (const xmlChar *)"family"))) {
1038 xmlNodeSetContent(cur2->xmlChildrenNode, (const xmlChar *)font_name);
1039 key = xmlNodeListGetString(doc, cur2->xmlChildrenNode, 1);
1043 } else if ((!xmlStrcmp(cur2->name, (const xmlChar *)"prefer"))) {
1044 cur3 = cur2->xmlChildrenNode;
1045 while (cur3 != NULL) {
1046 if ((!xmlStrcmp(cur3->name, (const xmlChar *)"family"))) {
1047 xmlNodeSetContent(cur3->xmlChildrenNode, (const xmlChar *)font_name);
1048 key = xmlNodeListGetString(doc, cur3->xmlChildrenNode, 1);
1072 /* LCOV_EXCL_STOP */
1074 /* LCOV_EXCL_START */
1075 int system_setting_set_font_type(system_settings_key_e key, void *value)
1077 SETTING_TRACE_BEGIN;
1078 char *font_name = NULL;
1079 font_name = (char *)value;
1081 /* get current font list */
1082 int is_found = dl_is_available_font(font_name);
1084 if (is_found == 1) {
1085 SETTING_TRACE("found font : %s ", font_name);
1087 SETTING_TRACE(" NOT found font : %s ", font_name);
1088 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1091 bool bsave = dl_font_config_set(font_name);
1094 SETTING_TRACE(" font type save error by font_config_set() ");
1095 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1097 SETTING_TRACE(" save OK - font_config_set() ");
1100 xmlDocPtr doc = (xmlDocPtr)font_conf_doc_parse(SETTING_FONT_CONF_FILE, font_name);
1102 xmlSaveFormatFile(SETTING_FONT_CONF_FILE, doc, 0);
1107 dl_font_config_set_notification();
1110 vconf_value = (char *)value;
1112 if (system_setting_vconf_set_value_string(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME, vconf_value)) {
1113 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1115 return SYSTEM_SETTINGS_ERROR_NONE;
1117 /* LCOV_EXCL_STOP */
1119 /* LCOV_EXCL_START */
1120 int system_setting_set_motion_activation(system_settings_key_e key, void *value)
1122 SETTING_TRACE_BEGIN;
1124 vconf_value = (bool *)value;
1125 if (system_setting_vconf_set_value_bool(VCONFKEY_SETAPPL_MOTION_ACTIVATION, *vconf_value)) {
1126 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1128 return SYSTEM_SETTINGS_ERROR_NONE;
1130 /* LCOV_EXCL_STOP */
1132 /* LCOV_EXCL_START */
1133 int system_setting_set_usb_debugging_option(system_settings_key_e key, void *value)
1135 SETTING_TRACE_BEGIN;
1137 vconf_value = (bool *)value;
1138 if (system_setting_vconf_set_value_bool(VCONFKEY_SETAPPL_USB_DEBUG_MODE_BOOL, *vconf_value)) {
1139 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1141 return SYSTEM_SETTINGS_ERROR_NONE;
1144 /* LCOV_EXCL_STOP */
1146 /* LCOV_EXCL_START */
1147 int system_setting_set_3g_data_network(system_settings_key_e key, void *value)
1149 SETTING_TRACE_BEGIN;
1151 vconf_value = (bool *)value;
1152 if (system_setting_vconf_set_value_bool(VCONFKEY_3G_ENABLE, *vconf_value)) {
1153 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1156 return SYSTEM_SETTINGS_ERROR_NONE;
1158 /* LCOV_EXCL_STOP */
1160 /* LCOV_EXCL_START */
1161 static int category_func(const char *name, void *user_data)
1163 SETTING_TRACE_BEGIN;
1164 static char *category = "lock-screen";
1165 if (name && !strcmp(name, category)) {
1166 SETTING_TRACE(" SAME ");
1169 SETTING_TRACE(" DIFFERENT -- %s, category -- %s ", name, category);
1175 /* LCOV_EXCL_STOP */
1179 * set 'swipe type' if current lockscreen app is 'com.samsung.lockscreen'
1183 /* LCOV_EXCL_START */
1184 int system_setting_set_lockscreen_app(system_settings_key_e key, void *value)
1186 SETTING_TRACE_BEGIN;
1188 vconf_value = (char *)value; /* ex) com.samsung.lockscreen */
1191 pkgmgrinfo_appinfo_h handle;
1192 r = pkgmgrinfo_appinfo_get_appinfo(vconf_value, &handle);
1193 if (r != PMINFO_R_OK) {
1194 SETTING_TRACE("*** pkginfo failed ");
1195 return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
1197 SETTING_TRACE("%p", handle);
1200 int ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)"lock-screen");
1201 if (ret != PMINFO_R_OK) {
1202 pkgmgrinfo_appinfo_destroy_appinfo(handle);
1203 return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
1206 pkgmgrinfo_appinfo_destroy_appinfo(handle);
1207 /*----------------------------------------------------------------------------------- */
1209 if (system_setting_vconf_get_value_int(VCONFKEY_SETAPPL_SCREEN_LOCK_TYPE_INT, &locktype)) {
1210 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1213 if (locktype == SETTING_SCREEN_LOCK_TYPE_PASSWORD)
1214 return SYSTEM_SETTINGS_ERROR_LOCKSCREEN_APP_PASSWORD_MODE;
1216 if (system_setting_vconf_set_value_string(VCONFKEY_SETAPPL_3RD_LOCK_PKG_NAME_STR, vconf_value)) {
1217 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1220 if (vconf_value && strcmp(vconf_value, "com.samsung.lockscreen") == 0) {
1221 if (system_setting_vconf_set_value_int(VCONFKEY_SETAPPL_SCREEN_LOCK_TYPE_INT, SETTING_SCREEN_LOCK_TYPE_SWIPE)) {
1222 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1225 return SYSTEM_SETTINGS_ERROR_NONE;
1227 /* LCOV_EXCL_STOP */
1229 /*/////////////////////////////////////////////////////////////////////////////////////////////// */
1232 int system_setting_set_changed_callback_incoming_call_ringtone(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1234 SETTING_TRACE_BEGIN;
1235 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);
1238 int system_setting_unset_changed_callback_incoming_call_ringtone(system_settings_key_e key)
1240 SETTING_TRACE_BEGIN;
1241 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_CALL_RINGTONE_PATH_STR, SYSTEM_SETTING_CALLBACK_SLOT_0);
1244 int system_setting_set_changed_callback_email_alert_ringtone(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1246 SETTING_TRACE_BEGIN;
1247 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);
1250 int system_setting_unset_changed_callback_email_alert_ringtone(system_settings_key_e key)
1252 SETTING_TRACE_BEGIN;
1253 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR, SYSTEM_SETTING_CALLBACK_SLOT_0);
1256 int system_setting_set_changed_callback_wallpaper_home_screen(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1258 SETTING_TRACE_BEGIN;
1259 return system_setting_vconf_set_changed_cb(VCONFKEY_BGSET, SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN, SYSTEM_SETTING_CALLBACK_SLOT_0, user_data);
1262 int system_setting_unset_changed_callback_wallpaper_home_screen(system_settings_key_e key)
1264 SETTING_TRACE_BEGIN;
1265 return system_setting_vconf_unset_changed_cb(VCONFKEY_BGSET, SYSTEM_SETTING_CALLBACK_SLOT_0);
1268 int system_setting_set_changed_callback_wallpaper_lock_screen(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1270 SETTING_TRACE_BEGIN;
1271 return system_setting_vconf_set_changed_cb(VCONFKEY_IDLE_LOCK_BGSET, SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN, SYSTEM_SETTING_CALLBACK_SLOT_0, user_data);
1274 int system_setting_unset_changed_callback_wallpaper_lock_screen(system_settings_key_e key)
1276 SETTING_TRACE_BEGIN;
1277 return system_setting_vconf_unset_changed_cb(VCONFKEY_IDLE_LOCK_BGSET, SYSTEM_SETTING_CALLBACK_SLOT_0);
1280 int system_setting_set_changed_callback_font_size(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1282 SETTING_TRACE_BEGIN;
1283 return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, SYSTEM_SETTINGS_KEY_FONT_SIZE, SYSTEM_SETTING_CALLBACK_SLOT_1, user_data);
1286 int system_setting_unset_changed_callback_font_size(system_settings_key_e key)
1288 SETTING_TRACE_BEGIN;
1289 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, SYSTEM_SETTING_CALLBACK_SLOT_1);
1292 int system_setting_set_changed_callback_usb_debugging_option(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1294 SETTING_TRACE_BEGIN;
1295 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);
1298 int system_setting_unset_changed_callback_usb_debugging_option(system_settings_key_e key)
1300 SETTING_TRACE_BEGIN;
1301 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_USB_DEBUG_MODE_BOOL, SYSTEM_SETTING_CALLBACK_SLOT_1);
1304 int system_setting_set_changed_callback_3g_data_network(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1306 SETTING_TRACE_BEGIN;
1307 return system_setting_vconf_set_changed_cb(VCONFKEY_3G_ENABLE, SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED, SYSTEM_SETTING_CALLBACK_SLOT_1, user_data);
1310 int system_setting_unset_changed_callback_3g_data_network(system_settings_key_e key)
1312 SETTING_TRACE_BEGIN;
1313 return system_setting_vconf_unset_changed_cb(VCONFKEY_3G_ENABLE, SYSTEM_SETTING_CALLBACK_SLOT_1);
1316 int system_setting_set_changed_callback_lockscreen_app(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1318 SETTING_TRACE_BEGIN;
1319 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);
1322 int system_setting_unset_changed_callback_lockscreen_app(system_settings_key_e key)
1324 SETTING_TRACE_BEGIN;
1325 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_3RD_LOCK_PKG_NAME_STR, SYSTEM_SETTING_CALLBACK_SLOT_1);
1330 * @todo need to add custom event notification method
1332 int system_setting_set_changed_callback_font_type(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1334 SETTING_TRACE_BEGIN;
1335 return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME, SYSTEM_SETTINGS_KEY_FONT_TYPE, SYSTEM_SETTING_CALLBACK_SLOT_2, user_data);
1338 int system_setting_unset_changed_callback_font_type(system_settings_key_e key)
1340 SETTING_TRACE_BEGIN;
1341 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME, SYSTEM_SETTING_CALLBACK_SLOT_2);
1344 /* TODO : 2th argument, callback, is not in use. */
1345 int system_setting_set_changed_callback_motion_activation(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1347 SETTING_TRACE_BEGIN;
1348 return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_MOTION_ACTIVATION, SYSTEM_SETTINGS_KEY_MOTION_ACTIVATION, SYSTEM_SETTING_CALLBACK_SLOT_3, user_data);
1351 int system_setting_unset_changed_callback_motion_activation(system_settings_key_e key)
1353 SETTING_TRACE_BEGIN;
1354 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_MOTION_ACTIVATION, SYSTEM_SETTING_CALLBACK_SLOT_3);
1357 /*//////////////////////////////////////////////////////////////////////////////////////// */
1358 /*--------------------------------------- */
1359 int system_setting_get_locale_country(system_settings_key_e key, void **value)
1361 SETTING_TRACE_BEGIN;
1362 char *vconf_value = NULL;
1363 if (system_setting_vconf_get_value_string(VCONFKEY_REGIONFORMAT, &vconf_value)) {
1364 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1367 /* parsing validation */
1369 char arr[21] = {0,};
1370 snprintf(arr, 20, "%s", vconf_value);
1371 for (int i = 0; i < strlen(arr); i++) {
1372 if ('.' == arr[i]) {
1374 SETTING_TRACE("replace . to NULL : %d", i);
1378 *value = strdup(arr);
1382 return SYSTEM_SETTINGS_ERROR_NONE;
1385 /* LCOV_EXCL_START */
1386 int system_setting_set_locale_country(system_settings_key_e key, void *value)
1388 SETTING_TRACE_BEGIN;
1389 char *vconf_value = NULL;
1390 vconf_value = (char *)value;
1392 char *ext = "UTF-8";
1395 snprintf(arr, 20, "%s.%s", vconf_value, ext);
1397 if (system_setting_vconf_set_value_string(VCONFKEY_REGIONFORMAT, arr)) {
1398 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1400 return SYSTEM_SETTINGS_ERROR_NONE;
1402 /* LCOV_EXCL_STOP */
1404 int system_setting_set_changed_callback_locale_country(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1406 SETTING_TRACE_BEGIN;
1407 return system_setting_vconf_set_changed_cb(VCONFKEY_REGIONFORMAT, SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY, SYSTEM_SETTING_CALLBACK_SLOT_3, user_data);
1410 int system_setting_unset_changed_callback_locale_country(system_settings_key_e key)
1412 SETTING_TRACE_BEGIN;
1413 return system_setting_vconf_unset_changed_cb(VCONFKEY_REGIONFORMAT, SYSTEM_SETTING_CALLBACK_SLOT_3);
1417 /*--------------------------------------- */
1418 int system_setting_get_locale_language(system_settings_key_e key, void **value)
1420 SETTING_TRACE_BEGIN;
1421 char *vconf_value = NULL;
1422 if (system_setting_vconf_get_value_string(VCONFKEY_LANGSET, &vconf_value)) {
1423 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1426 /* parsing validation */
1428 char arr[21] = {0,};
1429 snprintf(arr, 20, "%s", vconf_value);
1430 for (int i = 0; i < strlen(arr); i++) {
1431 if ('.' == arr[i]) {
1433 SETTING_TRACE("replace . to NULL : %d", i);
1437 *value = strdup(arr);
1440 return SYSTEM_SETTINGS_ERROR_NONE;
1443 /* LCOV_EXCL_START */
1444 int system_setting_set_locale_language(system_settings_key_e key, void *value)
1446 SETTING_TRACE_BEGIN;
1447 char *vconf_value = NULL;
1448 vconf_value = (char *)value;
1450 char *ext = "UTF-8";
1453 snprintf(arr, 20, "%s.%s", vconf_value, ext);
1455 if (system_setting_vconf_set_value_string(VCONFKEY_LANGSET, arr)) {
1456 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1458 return SYSTEM_SETTINGS_ERROR_NONE;
1460 /* LCOV_EXCL_STOP */
1462 int system_setting_set_changed_callback_locale_language(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1464 SETTING_TRACE_BEGIN;
1465 /*return system_setting_vconf_set_changed_cb(VCONFKEY_LANGSET, SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, 3, user_data ); */
1466 return system_setting_vconf_set_changed_cb(VCONFKEY_LANGSET, SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, SYSTEM_SETTING_CALLBACK_SLOT_5, user_data);
1469 int system_setting_unset_changed_callback_locale_language(system_settings_key_e key)
1471 SETTING_TRACE_BEGIN;
1472 return system_setting_vconf_unset_changed_cb(VCONFKEY_LANGSET, SYSTEM_SETTING_CALLBACK_SLOT_5);
1475 /*--------------------------------------- */
1476 /* LCOV_EXCL_START */
1477 int system_setting_get_locale_timeformat_24hour(system_settings_key_e key, void **value)
1479 SETTING_TRACE_BEGIN;
1482 if (system_setting_vconf_get_value_int(VCONFKEY_REGIONFORMAT_TIME1224, &vconf_value)) {
1483 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1486 bool ret_value = true;
1487 if (vconf_value == VCONFKEY_TIME_FORMAT_12)
1489 else if (vconf_value == VCONFKEY_TIME_FORMAT_24)
1492 *value = (void *)ret_value;
1494 return SYSTEM_SETTINGS_ERROR_NONE;
1496 /* LCOV_EXCL_STOP */
1498 int system_setting_set_locale_timeformat_24hour(system_settings_key_e key, void *value)
1500 SETTING_TRACE_BEGIN;
1503 vconf_value = (bool *)value;
1506 if (system_setting_vconf_set_value_int(VCONFKEY_REGIONFORMAT_TIME1224, VCONFKEY_TIME_FORMAT_24)) {
1507 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1511 if (system_setting_vconf_set_value_int(VCONFKEY_REGIONFORMAT_TIME1224, VCONFKEY_TIME_FORMAT_12)) {
1512 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1517 return SYSTEM_SETTINGS_ERROR_NONE;
1520 int system_setting_set_changed_callback_locale_timeformat_24hour(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1522 SETTING_TRACE_BEGIN;
1523 return system_setting_vconf_set_changed_cb(VCONFKEY_REGIONFORMAT_TIME1224, SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR, SYSTEM_SETTING_CALLBACK_SLOT_3, user_data);
1526 int system_setting_unset_changed_callback_locale_timeformat_24hour(system_settings_key_e key)
1528 SETTING_TRACE_BEGIN;
1529 return system_setting_vconf_unset_changed_cb(VCONFKEY_REGIONFORMAT_TIME1224, SYSTEM_SETTING_CALLBACK_SLOT_3);
1532 int system_setting_get_locale_timezone(system_settings_key_e key, void **value)
1535 ssize_t len = readlink(SETTING_TZONE_SYMLINK_PATH, tzpath, sizeof(tzpath)-1);
1539 SETTING_TRACE("parse error for SETTING_TZONE_SYMLINK_PATH");
1540 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1543 SETTING_TRACE("tzpath : %s ", &tzpath[20]);
1544 *value = strdup(&tzpath[20]);
1545 return SYSTEM_SETTINGS_ERROR_NONE;
1548 /* LCOV_EXCL_START */
1549 int system_setting_set_locale_timezone(system_settings_key_e key, void *value)
1551 SETTING_TRACE_BEGIN;
1552 char *timezone_value = NULL;
1553 timezone_value = (char *)value;
1556 snprintf(tz_path, 1024, "/usr/share/zoneinfo/%s", timezone_value);
1558 int is_load = _is_file_accessible(tz_path);
1560 alarmmgr_set_timezone(tz_path);
1562 if (system_setting_vconf_set_value_string(VCONFKEY_SETAPPL_TIMEZONE_ID, timezone_value)) {
1563 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1565 return SYSTEM_SETTINGS_ERROR_NONE;
1567 return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
1569 /* LCOV_EXCL_STOP */
1573 /* LCOV_EXCL_START */
1574 int system_setting_set_changed_callback_locale_timezone(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1576 return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_TIMEZONE_ID, SYSTEM_SETTINGS_KEY_LOCALE_TIMEZONE, SYSTEM_SETTING_CALLBACK_SLOT_4, user_data);
1578 /* LCOV_EXCL_STOP */
1580 /* LCOV_EXCL_START */
1581 int system_setting_unset_changed_callback_locale_timezone(system_settings_key_e key)
1583 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_TIMEZONE_ID, SYSTEM_SETTING_CALLBACK_SLOT_4);
1585 /* LCOV_EXCL_STOP */
1587 /* LCOV_EXCL_START */
1588 int system_setting_set_changed_callback_locale_timezone_changed(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1590 SETTING_TRACE_BEGIN;
1591 return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
1593 /* LCOV_EXCL_STOP */
1595 /* LCOV_EXCL_START */
1596 int system_setting_unset_changed_callback_locale_timezone_changed(system_settings_key_e key)
1598 SETTING_TRACE_BEGIN;
1599 return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
1601 /* LCOV_EXCL_STOP */
1604 /* LCOV_EXCL_START */
1605 int system_setting_get_time_changed(system_settings_key_e key, void **value)
1607 SETTING_TRACE_BEGIN;
1609 int ** val = (int**)value;
1610 cur_tick = time(NULL);
1612 /* struct tm * localtime = time (cur_tick); */
1613 /* printf("%s\n", ctime(&cur_tick); */
1614 return SYSTEM_SETTINGS_ERROR_NONE;
1617 /* LCOV_EXCL_STOP */
1619 int system_setting_set_changed_callback_time_changed(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1621 SETTING_TRACE_BEGIN;
1622 return system_setting_vconf_set_changed_cb(VCONFKEY_SYSTEM_TIME_CHANGED, SYSTEM_SETTINGS_KEY_TIME_CHANGED, SYSTEM_SETTING_CALLBACK_SLOT_3, user_data);
1625 int system_setting_unset_changed_callback_time_changed(system_settings_key_e key)
1627 SETTING_TRACE_BEGIN;
1628 return system_setting_vconf_unset_changed_cb(VCONFKEY_SYSTEM_TIME_CHANGED, SYSTEM_SETTING_CALLBACK_SLOT_3);
1631 /* SYSTEM_SETTINGS_KEY_SOUND_LOCK */
1632 int system_setting_get_sound_lock(system_settings_key_e key, void **value)
1634 SETTING_TRACE_BEGIN;
1637 if (system_setting_vconf_get_value_bool(VCONFKEY_SETAPPL_SOUND_LOCK_BOOL, &vconf_value)) {
1638 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1640 *value = (void *)vconf_value;
1642 return SYSTEM_SETTINGS_ERROR_NONE;
1645 int system_setting_set_changed_callback_sound_lock(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1647 SETTING_TRACE_BEGIN;
1648 return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_SOUND_LOCK_BOOL, SYSTEM_SETTINGS_KEY_SOUND_LOCK, SYSTEM_SETTING_CALLBACK_SLOT_3, user_data);
1651 int system_setting_unset_changed_callback_sound_lock(system_settings_key_e key)
1653 SETTING_TRACE_BEGIN;
1654 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_SOUND_LOCK_BOOL, SYSTEM_SETTING_CALLBACK_SLOT_3);
1658 * a = VCONFKEY_SETAPPL_SOUND_STATUS_BOOL b = VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL
1660 * a == false, b == false --> silent mode
1661 * a == true, b == false --> sound mode
1662 * a == false, b == true --> vibration mode
1664 /* LCOV_EXCL_START */
1665 int system_setting_get_sound_silent_mode(system_settings_key_e key, void **value)
1667 SETTING_TRACE_BEGIN;
1672 if (system_setting_vconf_get_value_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, &sound_cond)) {
1673 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1676 if (system_setting_vconf_get_value_bool(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, &vib_cond)) {
1677 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1680 if (sound_cond == false && vib_cond == false) {
1682 *value = (void *)vconf_value;
1684 vconf_value = false;
1685 *value = (void *)vconf_value;
1687 return SYSTEM_SETTINGS_ERROR_NONE;
1689 /* LCOV_EXCL_STOP */
1692 * a = VCONFKEY_SETAPPL_SOUND_STATUS_BOOL b = VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL
1694 * a == false, b == false --> silent mode
1695 * a == true, b == false --> sound mode
1697 int system_setting_set_sound_silent_mode(system_settings_key_e key, void *value)
1699 SETTING_TRACE_BEGIN;
1702 vconf_value = (bool *)value;
1704 bool vconf_sound = false;
1705 bool vconf_vib = false;
1708 vconf_sound = false;
1715 if (system_setting_vconf_set_value_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, vconf_sound)) {
1716 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1718 if (system_setting_vconf_set_value_bool(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, vconf_vib)) {
1719 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1722 return SYSTEM_SETTINGS_ERROR_NONE;
1728 int system_setting_set_changed_callback_sound_silent_mode(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1730 SETTING_TRACE_BEGIN;
1731 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);
1735 int system_setting_unset_changed_callback_sound_silent_mode(system_settings_key_e key)
1737 SETTING_TRACE_BEGIN;
1738 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, SYSTEM_SETTING_CALLBACK_SLOT_3);
1741 /* SYSTEM_SETTINGS_KEY_SOUND_TOUCH */
1742 int system_setting_get_sound_touch(system_settings_key_e key, void **value)
1744 SETTING_TRACE_BEGIN;
1747 int ret = system_setting_vconf_get_value_bool(VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL, &vconf_value);
1748 if (ret != SYSTEM_SETTINGS_ERROR_NONE) {
1751 *value = (void *)vconf_value;
1755 int system_setting_set_sound_touch(system_settings_key_e key, void *value)
1757 SETTING_TRACE_BEGIN;
1758 return system_setting_vconf_set_value_bool(VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL, *(bool *)value);
1762 int system_setting_set_changed_callback_sound_touch(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1764 SETTING_TRACE_BEGIN;
1765 return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL, SYSTEM_SETTINGS_KEY_SOUND_TOUCH, SYSTEM_SETTING_CALLBACK_SLOT_2, user_data);
1768 int system_setting_unset_changed_callback_sound_touch(system_settings_key_e key)
1770 SETTING_TRACE_BEGIN;
1771 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL, SYSTEM_SETTING_CALLBACK_SLOT_2);
1774 int system_setting_get_auto_rotation_mode(system_settings_key_e key, void **value)
1776 SETTING_TRACE_BEGIN;
1779 if (system_setting_vconf_get_value_bool(VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL, &vconf_value)) {
1780 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1782 *value = (void *)vconf_value;
1784 return SYSTEM_SETTINGS_ERROR_NONE;
1787 /* LCOV_EXCL_START */
1788 int system_setting_set_auto_rotation_mode(system_settings_key_e key, void *value)
1790 SETTING_TRACE_BEGIN;
1792 vconf_value = (bool *)value;
1793 if (system_setting_vconf_set_value_bool(VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL, *vconf_value)) {
1794 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1797 return SYSTEM_SETTINGS_ERROR_NONE;
1799 /* LCOV_EXCL_STOP */
1801 int system_setting_set_changed_callback_auto_rotation_mode(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1803 SETTING_TRACE_BEGIN;
1804 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);
1807 int system_setting_unset_changed_callback_auto_rotation_mode(system_settings_key_e key)
1809 SETTING_TRACE_BEGIN;
1810 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL, SYSTEM_SETTING_CALLBACK_SLOT_2);
1813 int system_setting_get_screen_backlight_time(system_settings_key_e key, void **value)
1815 SETTING_TRACE_BEGIN;
1817 int ** val = (int**)value;
1819 if (system_setting_vconf_get_value_int(VCONFKEY_SETAPPL_LCD_TIMEOUT_NORMAL, &vconf_value)) {
1820 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1822 **val = vconf_value;
1824 return SYSTEM_SETTINGS_ERROR_NONE;
1828 /* LCOV_EXCL_START */
1829 int system_setting_set_screen_backlight_time(system_settings_key_e key, void *value)
1831 SETTING_TRACE_BEGIN;
1833 vconf_value = *(int **)value;
1835 if (!(*vconf_value > 0 && *vconf_value <= 600)) {
1836 SETTING_TRACE(" ERR Betweeny here 0 ~ 600");
1837 return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
1840 if (system_setting_vconf_set_value_int(VCONFKEY_SETAPPL_LCD_TIMEOUT_NORMAL, *vconf_value)) {
1841 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1844 return SYSTEM_SETTINGS_ERROR_NONE;
1846 /* LCOV_EXCL_STOP */
1848 int system_setting_set_changed_callback_screen_backlight_time(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1850 SETTING_TRACE_BEGIN;
1851 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);
1854 int system_setting_unset_changed_callback_screen_backlight_time(system_settings_key_e key)
1856 SETTING_TRACE_BEGIN;
1857 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_LCD_TIMEOUT_NORMAL, SYSTEM_SETTING_CALLBACK_SLOT_2);
1860 int system_setting_get_sound_notification(system_settings_key_e key, void **value)
1862 SETTING_TRACE_BEGIN;
1863 char *vconf_value = NULL;
1864 if (system_setting_vconf_get_value_string(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR, &vconf_value)) {
1865 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1868 *value = vconf_value;
1869 return SYSTEM_SETTINGS_ERROR_NONE;
1872 /* LCOV_EXCL_START */
1873 int system_setting_set_sound_notification(system_settings_key_e key, void *value)
1875 SETTING_TRACE_BEGIN;
1876 char *vconf_value = NULL;
1877 vconf_value = (char *)value;
1879 int is_load = _is_file_accessible(vconf_value);
1881 //SETTING_TRACE(" system_setting_vconf_set_value_string(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR, %s) TRY", vconf_value);
1882 if (system_setting_vconf_set_value_string(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR, vconf_value)) {
1883 //SETTING_TRACE(" system_setting_vconf_set_value_string(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR, %s) FAIL", vconf_value);
1884 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1887 //SETTING_TRACE(" is_file_accessibile FAILED - system_setting_vconf_set_value_string(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR, %s) FAIL", vconf_value);
1888 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1891 return SYSTEM_SETTINGS_ERROR_NONE;
1893 /* LCOV_EXCL_STOP */
1895 int system_setting_set_changed_callback_sound_notification(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1897 SETTING_TRACE_BEGIN;
1898 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);
1901 int system_setting_unset_changed_callback_sound_notification(system_settings_key_e key)
1903 SETTING_TRACE_BEGIN;
1904 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR, SYSTEM_SETTING_CALLBACK_SLOT_0);
1907 int system_setting_get_notification_repetition_period(system_settings_key_e key, void **value)
1909 SETTING_TRACE_BEGIN;
1910 int ** val = (int**)value;
1913 if (system_setting_vconf_get_value_int(VCONFKEY_SETAPPL_NOTI_MSG_ALERT_REP_TYPE_INT, &vconf_value)) {
1914 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1916 **val = vconf_value;
1918 return SYSTEM_SETTINGS_ERROR_NONE;
1921 /* LCOV_EXCL_START */
1922 int system_setting_set_notification_repetition_period(system_settings_key_e key, void *value)
1924 SETTING_TRACE_BEGIN;
1926 vconf_value = *(int **)value;
1928 if (system_setting_vconf_set_value_int(VCONFKEY_SETAPPL_NOTI_MSG_ALERT_REP_TYPE_INT, *vconf_value)) {
1929 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1932 return SYSTEM_SETTINGS_ERROR_NONE;
1934 /* LCOV_EXCL_STOP */
1936 int system_setting_set_changed_callback_notification_repetition_period(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1938 SETTING_TRACE_BEGIN;
1939 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);
1942 int system_setting_unset_changed_callback_notification_repetition_period(system_settings_key_e key)
1944 SETTING_TRACE_BEGIN;
1945 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_NOTI_MSG_ALERT_REP_TYPE_INT, SYSTEM_SETTING_CALLBACK_SLOT_1);
1948 int system_setting_get_device_name(system_settings_key_e key, void **value)
1950 SETTING_TRACE_BEGIN;
1951 char *vconf_value = NULL;
1952 if (system_setting_vconf_get_value_string(VCONFKEY_SETAPPL_DEVICE_NAME_STR, &vconf_value)) {
1953 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1956 *value = vconf_value;
1957 return SYSTEM_SETTINGS_ERROR_NONE;
1960 /* LCOV_EXCL_START */
1961 int system_setting_set_device_name(system_settings_key_e key, void *value)
1963 SETTING_TRACE_BEGIN;
1964 char *vconf_value = NULL;
1965 vconf_value = (char *)value;
1967 if (system_setting_vconf_set_value_string(VCONFKEY_SETAPPL_DEVICE_NAME_STR, vconf_value)) {
1968 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1971 return SYSTEM_SETTINGS_ERROR_NONE;
1973 /* LCOV_EXCL_STOP */
1975 int system_setting_set_changed_callback_device_name(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
1977 SETTING_TRACE_BEGIN;
1978 return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_DEVICE_NAME_STR, SYSTEM_SETTINGS_KEY_DEVICE_NAME, SYSTEM_SETTING_CALLBACK_SLOT_0, user_data);
1981 int system_setting_unset_changed_callback_device_name(system_settings_key_e key)
1983 SETTING_TRACE_BEGIN;
1984 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_DEVICE_NAME_STR, SYSTEM_SETTING_CALLBACK_SLOT_0);
1987 /*---------------------------------------------- */
1988 int system_setting_get_network_flight_mode(system_settings_key_e key, void **value)
1990 SETTING_TRACE_BEGIN;
1992 if (system_setting_vconf_get_value_bool(VCONFKEY_TELEPHONY_FLIGHT_MODE, &vconf_value)) {
1993 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
1995 *value = (void *)vconf_value;
1997 return SYSTEM_SETTINGS_ERROR_NONE;
2000 int system_setting_set_changed_callback_network_flight_mode(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_TELEPHONY_FLIGHT_MODE, SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE, SYSTEM_SETTING_CALLBACK_SLOT_3, user_data);
2006 int system_setting_unset_changed_callback_network_flight_mode(system_settings_key_e key)
2008 SETTING_TRACE_BEGIN;
2009 return system_setting_vconf_unset_changed_cb(VCONFKEY_TELEPHONY_FLIGHT_MODE, SYSTEM_SETTING_CALLBACK_SLOT_3);
2012 int system_setting_get_network_wifi_notification(system_settings_key_e key, void **value)
2014 SETTING_TRACE_BEGIN;
2016 if (system_setting_vconf_get_value_int(VCONFKEY_WIFI_ENABLE_QS, &vconf_value)) {
2017 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2020 bret = (vconf_value == VCONFKEY_WIFI_QS_ENABLE) ? true : false;
2022 *value = (void *)bret;
2023 return SYSTEM_SETTINGS_ERROR_NONE;
2026 int system_setting_set_changed_callback_network_wifi_notification(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
2028 SETTING_TRACE_BEGIN;
2029 return system_setting_vconf_set_changed_cb(VCONFKEY_WIFI_ENABLE_QS, SYSTEM_SETTINGS_KEY_NETWORK_WIFI_NOTIFICATION, SYSTEM_SETTING_CALLBACK_SLOT_4, user_data);
2032 int system_setting_unset_changed_callback_network_wifi_notification(system_settings_key_e key)
2034 SETTING_TRACE_BEGIN;
2035 return system_setting_vconf_unset_changed_cb(VCONFKEY_WIFI_ENABLE_QS, SYSTEM_SETTING_CALLBACK_SLOT_4);
2038 /* LCOV_EXCL_START */
2039 int system_setting_get_lock_state(system_settings_key_e key, void **value)
2042 int ** val = (int**)value;
2044 if (system_setting_vconf_get_value_int(VCONFKEY_IDLE_LOCK_STATE_READ_ONLY, &vconf_value)) {
2045 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2047 **val = vconf_value;
2049 return SYSTEM_SETTINGS_ERROR_NONE;
2051 /* LCOV_EXCL_STOP */
2053 /* LCOV_EXCL_START */
2054 int system_setting_set_lock_state(system_settings_key_e key, void *value)
2056 SETTING_TRACE_BEGIN;
2058 vconf_value = *(int **)value;
2060 if (system_setting_vconf_set_value_int(VCONFKEY_IDLE_LOCK_STATE_READ_ONLY, *vconf_value)) {
2061 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2064 return SYSTEM_SETTINGS_ERROR_NONE;
2066 /* LCOV_EXCL_STOP */
2068 /* LCOV_EXCL_START */
2069 int system_setting_set_changed_callback_lock_state(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
2071 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);
2073 /* LCOV_EXCL_STOP */
2075 /* LCOV_EXCL_START */
2076 int system_setting_unset_changed_callback_lock_state(system_settings_key_e key)
2078 return system_setting_vconf_unset_changed_cb(VCONFKEY_IDLE_LOCK_STATE_READ_ONLY, SYSTEM_SETTING_CALLBACK_SLOT_4);
2080 /* LCOV_EXCL_STOP */
2082 //----------------------------------------------------------------------------------------------------------------------------
2084 #define DEFAULT_ADS_ID "00000000-0000-0000-0000-000000000000"
2086 int system_setting_get_ads_id(system_settings_key_e key, void **value)
2088 SETTING_TRACE_BEGIN;
2089 int optout_value = 0;
2090 if (system_setting_vconf_get_value_int(VCONFKEY_SETAPPL_AD_ID_OPT_OUT, &optout_value)) {
2091 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2094 if (optout_value == 1) {
2095 *value = strdup(DEFAULT_ADS_ID);
2096 return SYSTEM_SETTINGS_ERROR_NONE;
2099 char *vconf_value = NULL;
2100 if (system_setting_vconf_get_value_string(VCONFKEY_SETAPPL_AD_ID, &vconf_value)) {
2101 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2104 *value = vconf_value;
2105 return SYSTEM_SETTINGS_ERROR_NONE;
2109 #if DEBUG_DUMP_CONTEXT
2110 void make_ad_id(void)
2113 char uuid_unparsed[50] = {0};
2114 uuid_generate(uuid_value);
2115 uuid_unparse(uuid_value, uuid_unparsed);
2116 system_setting_set_ad_id(key, uuid_unparsed); //example of setting the value
2119 int system_setting_set_ads_id(system_settings_key_e key, void *value)
2121 SETTING_TRACE_BEGIN;
2122 char *vconf_value = NULL;
2123 vconf_value = (char *)value;
2125 if (system_setting_vconf_set_value_string(VCONFKEY_SETAPPL_AD_ID, vconf_value)) {
2126 SETTING_TRACE("Setting VCONFKEY_SETAPPL_AD_ID failed");
2127 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2130 return SYSTEM_SETTINGS_ERROR_NONE;
2133 int system_setting_set_changed_callback_ads_id(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
2135 SETTING_TRACE_BEGIN;
2136 return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_AD_ID, SYSTEM_SETTINGS_KEY_ADS_ID, SYSTEM_SETTING_CALLBACK_SLOT_0, user_data);
2139 int system_setting_unset_changed_callback_ads_id(system_settings_key_e key)
2141 SETTING_TRACE_BEGIN;
2142 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_AD_ID, SYSTEM_SETTING_CALLBACK_SLOT_0);
2145 int system_settings_feature_check_bool(char *path)
2147 bool feature_data = false;
2148 int ret = system_info_get_platform_bool(path, &feature_data);
2149 if (ret != SYSTEM_INFO_ERROR_NONE) {
2150 SETTING_TRACE("Setting - reading feature data failed, %d", ret);
2151 return SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
2154 ret = (feature_data == true) ? SYSTEM_SETTINGS_ERROR_NONE : SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
2160 int system_setting_feature_check_incoming_call(void *value)
2162 static bool first_query = true;
2163 static int ret = SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
2165 if (first_query == true) {
2166 ret = system_settings_feature_check_bool(SETTING_INCOMING_CALL_PATH);
2167 first_query = false;
2173 int system_setting_feature_check_home_screen(void *value)
2175 static bool first_query = true;
2176 static int ret = SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
2178 if (first_query == true) {
2179 ret = system_settings_feature_check_bool(SETTING_HOME_SCREEN_PATH);
2180 first_query = false;
2186 int system_setting_feature_check_lock_screen(void *value)
2188 static bool first_query = true;
2189 static int ret = SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
2191 if (first_query == true) {
2192 ret = system_settings_feature_check_bool(SETTING_LOCK_SCREEN_PATH);
2193 first_query = false;
2199 int system_setting_feature_check_notification_email(void *value)
2201 static bool first_query = true;
2202 static int ret = SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
2204 if (first_query == true) {
2205 ret = system_settings_feature_check_bool(SETTING_NOTIFICATION_EMAIL_PATH);
2206 first_query = false;
2212 int system_setting_feature_check_wifi(void *value)
2214 static bool first_query = true;
2215 static int ret = SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
2217 if (first_query == true) {
2218 ret = system_settings_feature_check_bool(SETTING_WIFI_PATH);
2219 first_query = false;
2225 int system_setting_feature_check_telephony(void *value)
2227 static bool first_query = true;
2228 static int ret = SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
2230 if (first_query == true) {
2231 ret = system_settings_feature_check_bool(SETTING_TELEPHONY_PATH);
2232 first_query = false;
2239 int system_setting_feature_check_font(void *value)
2241 static bool first_query = true;
2242 static int ret = SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
2244 if (first_query == true) {
2245 ret = system_settings_feature_check_bool(SETTING_FONT_PATH);
2246 first_query = false;
2252 int system_setting_feature_check_accessibility_grayscale(void *value)
2254 static bool first_query = true;
2255 static int ret = SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
2257 if (first_query == true) {
2258 ret = system_settings_feature_check_bool(SETTING_ACCESSIBILITY_GRAYSCALE_PATH);
2259 first_query = false;
2265 int system_setting_feature_check_accessibility_negative(void *value)
2267 static bool first_query = true;
2268 static int ret = SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
2270 if (first_query == true) {
2271 ret = system_settings_feature_check_bool(SETTING_ACCESSIBILITY_NEGATIVE_PATH);
2272 first_query = false;
2278 int system_setting_feature_check_wearable_profile(void *value)
2280 static bool first_query = true;
2281 static int ret = SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
2283 if (first_query == true) {
2284 char *profile_data = NULL;
2285 int rotary_feature = SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
2286 ret = system_info_get_platform_string(SETTING_PROFILE_PATH, &profile_data);
2287 if (ret != SYSTEM_INFO_ERROR_NONE) {
2288 SETTING_TRACE("Setting - reading profile string failed, %d", ret);
2289 return SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
2292 rotary_feature = system_settings_feature_check_bool(SETTING_INPUT_ROTATING_BEZEL_PATH);
2294 if ((rotary_feature == SYSTEM_SETTINGS_ERROR_NONE) && profile_data && !strcmp(profile_data, "wearable"))
2295 ret = SYSTEM_SETTINGS_ERROR_NONE;
2297 ret = SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
2302 first_query = false;
2308 /* LCOV_EXCL_START */
2309 int system_setting_get_uds_state(system_settings_key_e key, void **value)
2311 int ** p_value = (int**)value;
2313 char *vconf_string_value = NULL;
2315 if (system_setting_vconf_get_value_int(VCONFKEY_SETAPPL_UDSM, &vconf_value)) {
2316 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2319 SETTING_TRACE("[%s] udsm: %d", __FUNCTION__, vconf_value);
2321 if (vconf_value == SYSTEM_SETTINGS_UDS_ON) {
2322 if (system_setting_vconf_get_value_string(VCONFKEY_SETAPPL_UDSM_PKGID_LIST, &vconf_string_value))
2323 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2325 if (vconf_string_value) {
2326 if (!strcmp(vconf_string_value, "NONE")) {
2327 vconf_value = SYSTEM_SETTINGS_UDS_ON;
2329 char *app_id = NULL;
2330 char *package_id = NULL;
2331 pid_t pid = getpid();
2333 int ret = app_manager_get_app_id(pid, &app_id);
2334 if (ret != APP_MANAGER_ERROR_NONE) {
2335 free(vconf_string_value);
2336 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2341 result = package_manager_get_package_id_by_app_id(app_id, &package_id);
2342 if (result != PACKAGE_MANAGER_ERROR_NONE) {
2343 SETTING_TRACE("package_manager_get_package_id_by_app_id returned error! %d", result);
2345 free(vconf_string_value);
2346 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2349 SETTING_TRACE("[%s] udsm_pkg_list : %s", __FUNCTION__, vconf_string_value);
2352 if (package_id && strstr(vconf_string_value, package_id)) {
2353 vconf_value = SYSTEM_SETTINGS_UDS_ON_WHITELISTED;
2354 SETTING_TRACE("[%s] pkg id : %s", __FUNCTION__, package_id);
2356 vconf_value = SYSTEM_SETTINGS_UDS_ON;
2360 free(vconf_string_value);
2364 **p_value = vconf_value;
2367 return SYSTEM_SETTINGS_ERROR_NONE;
2369 /* LCOV_EXCL_STOP */
2371 /* LCOV_EXCL_START */
2372 int system_setting_set_changed_callback_uds_state(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
2374 return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_UDSM, SYSTEM_SETTINGS_KEY_ULTRA_DATA_SAVE, SYSTEM_SETTING_CALLBACK_SLOT_4, user_data);
2376 /* LCOV_EXCL_STOP */
2378 /* LCOV_EXCL_START */
2379 int system_setting_unset_changed_callback_uds_state(system_settings_key_e key)
2381 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_UDSM, SYSTEM_SETTING_CALLBACK_SLOT_4);
2383 /* LCOV_EXCL_STOP */
2385 /* LCOV_EXCL_START */
2386 int system_setting_set_changed_callback_uds_pkg_list(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
2388 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);
2390 /* LCOV_EXCL_STOP */
2392 /* LCOV_EXCL_START */
2393 int system_setting_unset_changed_callback_uds_pkg_list(system_settings_key_e key)
2395 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_UDSM_PKGID_LIST, SYSTEM_SETTING_CALLBACK_SLOT_4);
2397 /* LCOV_EXCL_STOP */
2399 /* SYSTEM_SETTINGS_KEY_ACCESSIBILITY_TTS */
2400 int system_setting_get_accessibility_tts(system_settings_key_e key, void **value)
2402 SETTING_TRACE_BEGIN;
2405 int ret = system_setting_vconf_get_value_bool(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, &vconf_value);
2406 if (ret != SYSTEM_SETTINGS_ERROR_NONE) {
2409 *value = (void *)vconf_value;
2413 /* LCOV_EXCL_START */
2414 int system_setting_set_accessibility_tts(system_settings_key_e key, void *value)
2416 SETTING_TRACE_BEGIN;
2418 vconf_value = (bool *)value;
2419 if (system_setting_vconf_set_value_bool(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, *vconf_value)) {
2420 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2423 return SYSTEM_SETTINGS_ERROR_NONE;
2425 /* LCOV_EXCL_STOP */
2427 int system_setting_set_changed_callback_accessibility_tts(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
2429 SETTING_TRACE_BEGIN;
2430 return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, SYSTEM_SETTINGS_KEY_ACCESSIBILITY_TTS, SYSTEM_SETTING_CALLBACK_SLOT_2, user_data);
2433 int system_setting_unset_changed_callback_accessibility_tts(system_settings_key_e key)
2435 SETTING_TRACE_BEGIN;
2436 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, SYSTEM_SETTING_CALLBACK_SLOT_2);
2439 /* SYSTEM_SETTINGS_KEY_VIBRATION */
2440 int system_setting_get_vibration(system_settings_key_e key, void **value)
2442 SETTING_TRACE_BEGIN;
2445 if (system_setting_vconf_get_value_bool(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, &vconf_value)) {
2446 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2448 *value = (void *)vconf_value;
2450 return SYSTEM_SETTINGS_ERROR_NONE;
2453 /* LCOV_EXCL_START */
2454 int system_setting_set_vibration(system_settings_key_e key, void *value)
2456 SETTING_TRACE_BEGIN;
2458 vconf_value = (bool *)value;
2459 if (system_setting_vconf_set_value_bool(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, *vconf_value)) {
2460 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2463 return SYSTEM_SETTINGS_ERROR_NONE;
2465 /* LCOV_EXCL_STOP */
2467 int system_setting_set_changed_callback_vibration(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
2469 SETTING_TRACE_BEGIN;
2470 return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, SYSTEM_SETTINGS_KEY_VIBRATION, SYSTEM_SETTING_CALLBACK_SLOT_2, user_data);
2473 int system_setting_unset_changed_callback_vibration(system_settings_key_e key)
2475 SETTING_TRACE_BEGIN;
2476 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, SYSTEM_SETTING_CALLBACK_SLOT_2);
2479 /* SYSTEM_SETTINGS_KEY_AUTOMATIC_TIME_UPDATE */
2480 int system_setting_get_automatic_time_update(system_settings_key_e key, void **value)
2482 SETTING_TRACE_BEGIN;
2485 if (system_setting_vconf_get_value_bool(VCONFKEY_SETAPPL_STATE_AUTOMATIC_TIME_UPDATE_BOOL, &vconf_value)) {
2486 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2488 *value = (void *)vconf_value;
2490 return SYSTEM_SETTINGS_ERROR_NONE;
2493 /* LCOV_EXCL_START */
2494 int system_setting_set_automatic_time_update(system_settings_key_e key, void *value)
2496 SETTING_TRACE_BEGIN;
2498 vconf_value = (bool *)value;
2499 if (system_setting_vconf_set_value_bool(VCONFKEY_SETAPPL_STATE_AUTOMATIC_TIME_UPDATE_BOOL, *vconf_value)) {
2500 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2503 return SYSTEM_SETTINGS_ERROR_NONE;
2505 /* LCOV_EXCL_STOP */
2507 int system_setting_set_changed_callback_automatic_time_update(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
2509 SETTING_TRACE_BEGIN;
2510 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);
2513 int system_setting_unset_changed_callback_automatic_time_update(system_settings_key_e key)
2515 SETTING_TRACE_BEGIN;
2516 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_STATE_AUTOMATIC_TIME_UPDATE_BOOL, SYSTEM_SETTING_CALLBACK_SLOT_2);
2519 /* SYSTEM_SETTINGS_KEY_DEVELOPER_OPTION_STATE */
2520 int system_setting_get_developer_option_state(system_settings_key_e key, void **value)
2522 SETTING_TRACE_BEGIN;
2525 if (system_setting_vconf_get_value_bool(VCONFKEY_SETAPPL_DEVELOPER_OPTION_STATE, &vconf_value)) {
2526 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2528 *value = (void *)vconf_value;
2530 return SYSTEM_SETTINGS_ERROR_NONE;
2533 /* LCOV_EXCL_START */
2534 int system_setting_set_developer_option_state(system_settings_key_e key, void *value)
2536 SETTING_TRACE_BEGIN;
2538 vconf_value = (bool *)value;
2539 if (system_setting_vconf_set_value_bool(VCONFKEY_SETAPPL_DEVELOPER_OPTION_STATE, *vconf_value)) {
2540 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2543 return SYSTEM_SETTINGS_ERROR_NONE;
2545 /* LCOV_EXCL_STOP */
2547 int system_setting_set_changed_callback_developer_option_state(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
2549 SETTING_TRACE_BEGIN;
2550 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);
2553 int system_setting_unset_changed_callback_developer_option_state(system_settings_key_e key)
2555 SETTING_TRACE_BEGIN;
2556 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_DEVELOPER_OPTION_STATE, SYSTEM_SETTING_CALLBACK_SLOT_2);
2559 /* SYSTEM_SETTINGS_KEY_ACCESSIBILITY_GRAYSCALE */
2560 int system_setting_get_accessibility_grayscale(system_settings_key_e key, void **value)
2562 SETTING_TRACE_BEGIN;
2565 if (system_setting_vconf_get_value_bool(VCONFKEY_SETAPPL_ACCESSIBILITY_GREYSCALE, &vconf_value)) {
2566 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2568 *value = (void *)vconf_value;
2570 return SYSTEM_SETTINGS_ERROR_NONE;
2573 /* LCOV_EXCL_START */
2574 int system_setting_set_accessibility_grayscale(system_settings_key_e key, void *value)
2576 SETTING_TRACE_BEGIN;
2578 vconf_value = (bool *)value;
2579 if (system_setting_vconf_set_value_bool(VCONFKEY_SETAPPL_ACCESSIBILITY_GREYSCALE, *vconf_value)) {
2580 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2583 return SYSTEM_SETTINGS_ERROR_NONE;
2585 /* LCOV_EXCL_STOP */
2587 int system_setting_set_changed_callback_accessibility_grayscale(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
2589 SETTING_TRACE_BEGIN;
2590 return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_ACCESSIBILITY_GREYSCALE, SYSTEM_SETTINGS_KEY_ACCESSIBILITY_GRAYSCALE, SYSTEM_SETTING_CALLBACK_SLOT_2, user_data);
2593 int system_setting_unset_changed_callback_accessibility_grayscale(system_settings_key_e key)
2595 SETTING_TRACE_BEGIN;
2596 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_ACCESSIBILITY_GREYSCALE, SYSTEM_SETTING_CALLBACK_SLOT_2);
2599 /* SYSTEM_SETTINGS_KEY_ACCESSIBILITY_NEGATIVE_COLOR */
2600 int system_setting_get_accessibility_negative_color(system_settings_key_e key, void **value)
2602 SETTING_TRACE_BEGIN;
2605 if (system_setting_vconf_get_value_bool(VCONFKEY_SETAPPL_ACCESSIBILITY_HIGH_CONTRAST, &vconf_value)) {
2606 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2608 *value = (void *)vconf_value;
2610 return SYSTEM_SETTINGS_ERROR_NONE;
2613 /* LCOV_EXCL_START */
2614 int system_setting_set_accessibility_negative_color(system_settings_key_e key, void *value)
2616 SETTING_TRACE_BEGIN;
2618 vconf_value = (bool *)value;
2619 if (system_setting_vconf_set_value_bool(VCONFKEY_SETAPPL_ACCESSIBILITY_HIGH_CONTRAST, *vconf_value)) {
2620 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2623 return SYSTEM_SETTINGS_ERROR_NONE;
2625 /* LCOV_EXCL_STOP */
2627 int system_setting_set_changed_callback_accessibility_negative_color(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
2629 SETTING_TRACE_BEGIN;
2630 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);
2633 int system_setting_unset_changed_callback_accessibility_negative_color(system_settings_key_e key)
2635 SETTING_TRACE_BEGIN;
2636 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_ACCESSIBILITY_HIGH_CONTRAST, SYSTEM_SETTING_CALLBACK_SLOT_2);
2639 /* SYSTEM_SETTINGS_KEY_ROTARY_EVENT_ENABLED */
2640 /* LCOV_EXCL_START */
2641 int system_setting_get_rotary_event_enabled(system_settings_key_e key, void **value)
2643 SETTING_TRACE_BEGIN;
2646 if (system_setting_vconf_get_value_bool(VCONFKEY_SETAPPL_ROTARY_EVENT_ENABLED_BOOL, &vconf_value)) {
2647 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2649 *value = (void *)vconf_value;
2651 return SYSTEM_SETTINGS_ERROR_NONE;
2653 /* LCOV_EXCL_STOP */
2655 /* LCOV_EXCL_START */
2656 int system_setting_set_rotary_event_enabled(system_settings_key_e key, void *value)
2658 SETTING_TRACE_BEGIN;
2660 vconf_value = (bool *)value;
2661 if (system_setting_vconf_set_value_bool(VCONFKEY_SETAPPL_ROTARY_EVENT_ENABLED_BOOL, *vconf_value)) {
2662 return SYSTEM_SETTINGS_ERROR_IO_ERROR;
2665 return SYSTEM_SETTINGS_ERROR_NONE;
2667 /* LCOV_EXCL_STOP */
2669 /* LCOV_EXCL_START */
2670 int system_setting_set_changed_callback_rotary_event_enabled(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
2672 SETTING_TRACE_BEGIN;
2673 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);
2675 /* LCOV_EXCL_STOP */
2677 /* LCOV_EXCL_START */
2678 int system_setting_unset_changed_callback_rotary_event_enabled(system_settings_key_e key)
2680 SETTING_TRACE_BEGIN;
2681 return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_ROTARY_EVENT_ENABLED_BOOL, SYSTEM_SETTING_CALLBACK_SLOT_3);
2683 /* LCOV_EXCL_STOP */