3 * * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
5 * Contact: MyoungJune Park <mj2004.park@samsung.com>
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <sound_manager.h>
24 #include <appcore-common.h>
28 #include "setting-main.h"
31 #include <setting-cfg.h>
33 #include <setting-common-search.h>
34 #include <elm_object.h>
38 #include <system_settings.h>
40 #define KEY_END "XF86Stop"
41 //#define SUPPORT_UG_MESSAGE
44 #define SETTING_SOUND_VOL_MAX 15
45 #define SETTING_DEFAULT_RINGTONE_VOL_INT 11
46 #define SETTING_DEFAULT_NOTI_VOL_INT 11
47 #define SETTING_DEFAULT_MEDIA_VOL_INT 9
49 const char *fixed_grid_pref_key[] = {
64 int g_geometry_x, g_geometry_y, g_geometry_w, g_geometry_h;
65 extern int aul_listen_app_dead_signal(int (*func)(int signal, void *data), void *data);
67 /* This API is defined in <app_service_private.h>. But, cannot include and it is not a managed API.
68 The way to resolve : 1. Add extern.
69 2. Use bundle pointer originally
70 At first, choose No.1 */
71 extern int app_control_create_request(bundle *data, app_control_h *service);
74 setting_main_appdata *g_main_ad;
75 const char *menu_group[] = {KeyStr_Connectivity,
76 KeyStr_ShareAndTransfer,
82 KeyStr_DownloadedAPPs,
85 static Cfg_Item_Type setting_main_sfinder_handler(app_control_h service, void* data, int (*func)(void* d1));
87 static Ea_Theme_Color_Table *_changeable_colors_set()
89 Ea_Theme_Color_Table *table;
91 table = ea_theme_color_table_new("/usr/apps/org.tizen.setting/shared/res/tables/org.tizen.setting.xml");
92 ea_theme_colors_set(table, EA_THEME_STYLE_LIGHT);
97 static void _changeable_colors_free(Ea_Theme_Color_Table *table)
99 // when the process is killed, you don’t need to call this
100 ea_theme_colors_unset(table, EA_THEME_STYLE_LIGHT);
101 ea_theme_color_table_free(table);
106 void termination_handler(int signum)
109 // do something for signal handling
110 //SETTING_TRACE_DEBUG(">>>>>>>>>>>>>>>>> SIGTERM >>>>>>>>>>>>>>> SETTING ");
116 #if LOW_BATTERY_DO_NOTHING
118 /* in case of low battery, don't terminate itself.*/
121 * The event process when battery becomes low.
123 static void setting_main_low_battery_cb(void *data)
126 setting_main_appdata *ad = data;
130 ug_send_event(UG_EVENT_LOW_BATTERY);
136 #if SUPPORT_APP_ROATION
137 static void _rot_changed_cb(void *data, Evas_Object *obj, void *event_info)
140 setting_main_appdata *ad = (setting_main_appdata *)data;
141 if (ad == NULL || ad->win_main == NULL )
145 int change_ang = elm_win_rotation_get(ad->win_main);
146 SETTING_TRACE_DEBUG("....change_ang:%d",change_ang);
147 SETTING_TRACE_DEBUG("current_rotation:%d",ad->current_rotation);
148 //Send the rotation event to UGs..
149 enum ug_event event = UG_EVENT_ROTATE_PORTRAIT;
150 switch (change_ang) {
151 case APP_DEVICE_ORIENTATION_0:
152 event = UG_EVENT_ROTATE_PORTRAIT;
154 case APP_DEVICE_ORIENTATION_180:
155 event = UG_EVENT_ROTATE_PORTRAIT_UPSIDEDOWN;
157 case APP_DEVICE_ORIENTATION_270:
158 event = UG_EVENT_ROTATE_LANDSCAPE;
160 case APP_DEVICE_ORIENTATION_90:
161 event = UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN;
166 SETTING_TRACE_DEBUG("diff:%d",elm_win_rotation_get(ad->win_main) - ad->current_rotation);
168 if (change_ang != ad->current_rotation)
170 int diff = change_ang - ad->current_rotation;
176 * @todo if app didn't launch UG, is the call required to invoke?
178 ug_send_event(event);
185 if (ad->list_type == SETTING_GRID_VIEW)
188 Evas_Object *genlist = NULL;
190 genlist = ad->sc_gl[SC_All_Grid];
192 //elm_genlist_realized_items_update(ad->sc_gl[SC_All_Grid]);
193 //list = elm_genlist_realized_items_get(ad->sc_gl[SC_All_Grid]);
194 it = elm_genlist_first_item_get(genlist);
196 elm_genlist_item_update(it);
197 it = elm_genlist_item_next_get(it);
201 genlist = ad->edit_genlist;
202 if (ad->edit_genlist)
204 //elm_genlist_realized_items_update(ad->edit_genlist);
205 it = elm_genlist_first_item_get(genlist);
207 elm_genlist_item_update(it);
208 it = elm_genlist_item_next_get(it);
213 ad->current_rotation = change_ang;
220 * The event process when region is changes.
222 static void setting_main_region_changed_cb(void *data)
224 setting_main_appdata *ad = data;
228 ug_send_event(UG_EVENT_REGION_CHANGE);
233 * The event process when win object is destroyed
235 static void setting_main_del_win(void *data, Evas_Object *obj, void *event)
240 void profile_changed_cb(void *data, Evas_Object * obj, void *event)
242 const char *profile = elm_config_profile_get();
244 if (strcmp(profile, "desktop") == 0)
246 elm_win_indicator_mode_set (obj, ELM_WIN_INDICATOR_HIDE);
250 elm_win_indicator_mode_set (obj, ELM_WIN_INDICATOR_SHOW);
255 * To create a win object, the win is shared between the App and all its UGs
257 static Evas_Object *setting_main_create_win(const char *name)
264 eo = (Evas_Object*) app_get_preinitialized_window(name);
266 eo = elm_win_util_standard_add(name, name);
268 // elm_win_util_standard_add creates bg inside
271 //bg = elm_bg_add(eo);
272 bg = app_get_preinitialized_background();
282 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
283 elm_win_resize_object_add(eo, bg);
284 evas_object_show(bg);
287 elm_win_title_set(eo, name);
288 evas_object_smart_callback_add(eo, "delete,request", setting_main_del_win, NULL);
289 evas_object_smart_callback_add(eo, "profile,changed", profile_changed_cb, NULL);
290 //elm_win_conformant_set(eo, EINA_TRUE);
291 ecore_x_window_size_get(ecore_x_window_root_first_get(),
293 evas_object_resize(eo, w, h);
295 LAUNCH_SETTING_OUT();
301 * exceptional process, reset the env vars by Setting vconf VCONFKEY_LANGSET
303 static void setting_main_lang_changed_cb(void *data)
306 retm_if(!data, "Invalid argument: data is NULL");
307 //FIX the crash when switch from Portrait mode to landscape mode,
308 //It is so strange the data is no longer correct
309 //and ....why it is invoked
310 //setting_main_appdata *ad = data;
311 setting_main_appdata *ad = g_main_ad;
316 KeyStr_MotionControl,
317 "IDS_ST_BODY_GENERAL",
318 KeyStr_DownloadedAPPs
322 for (;i < SETTING_TAB_VIEW_MAX; i++)
324 //SETTING_TRACE("_(tab_str[%d]):%s", i, _(tab_str[i]));
325 if (ad->ctrl_item[i])
326 elm_object_item_text_set(ad->ctrl_item[i], _(tab_str[i]));
330 if (ad->data_bright) {
331 tmp = ad->data_bright->sub_desc;
332 ad->data_bright->sub_desc= (char*)g_strdup(get_brightness_mode_str());
335 if (ad->data_backlight) {
336 tmp = ad->data_backlight->sub_desc;
337 ad->data_backlight->sub_desc= get_pa_backlight_time_str();
340 if (ad->data_screenmode) {
341 tmp = ad->data_screenmode->sub_desc;
342 ad->data_screenmode->sub_desc= get_pa_screen_mode_str();
348 i = SETTING_TAB_VIEW_INVALID;
349 for (i = SETTING_TAB_VIEW_QUICK_SETTINGS; i < SETTING_TAB_VIEW_MAX; i++)
351 if(ad->sub_view[i]) {
352 list = elm_genlist_realized_items_get(ad->sub_view[i]);
353 EINA_LIST_FOREACH(list, l, it)
355 __add_gl_tts_feature(it);
356 elm_genlist_item_update(it);
363 for (i = SC_All_List; i < SC_Max; i++)
365 //if (ad->sc_gl[i]) elm_genlist_realized_items_update(ad->sc_gl[i]);
367 list = elm_genlist_realized_items_get(ad->sc_gl[i]);
368 EINA_LIST_FOREACH(list, l, it)
370 __add_gl_tts_feature(it);
371 elm_genlist_item_update(it);
377 elm_object_item_part_text_set(ad->main_navi_it, "elm.text.title", _("IDS_ST_OPT_SETTINGS"));
378 setting_navi_items_update(ad->navibar_main);
380 if (ad->isInUGMode && ad->ug)
382 Evas_Object *layout = (Evas_Object *)ug_get_layout(ad->ug);
385 Evas_Object *navi_bar = NULL;
386 navi_bar = elm_object_part_content_get(layout, "elm.swallow.content");
387 setting_navi_items_update(navi_bar);
389 ug_send_event(UG_EVENT_LANG_CHANGE);
394 static Eina_Bool __update_gengrid_delayer(void *data)
397 setting_main_appdata *ad = data;
398 retvm_if(!data, ECORE_CALLBACK_CANCEL, "Invalid argument: data is NULL");
401 elm_gengrid_realized_items_update(ad->gengrid);
403 //After return False, the idler will be deleted directly,so here set ad->set_idler as NULL directly.
404 ad->update_idler = NULL;
405 return ECORE_CALLBACK_CANCEL;
409 * the event process when other VCONFS changes
411 static void setting_other_vconf_change_cb(keynode_t *key, void *data)
413 setting_main_appdata *ad = data;
414 retm_if(!data, "Invalid argument: data is NULL");
416 Setting_GenGroupItem_Data* item_to_update = NULL;
417 char *vconf_name = vconf_keynode_get_name(key);
418 SETTING_TRACE("the value of [ %s ] just changed", vconf_name);
421 if (!safeStrCmp(vconf_name, VCONFKEY_TELEPHONY_FLIGHT_MODE)) {
423 vconf_get_bool(VCONFKEY_TELEPHONY_FLIGHT_MODE, &flightmode);
424 //Flight mode is ON : Network menu dimmed
425 SETTING_TRACE("vconf flight [%d]", flightmode);
426 for (i = VIEW_All_List; i < VIEW_Max; i++)
428 setting_genlist_item_disabled_set(ad->gl_data_item[i][GL_Network], flightmode);
429 setting_genlist_item_disabled_set(ad->gl_data_item[i][GL_PM], flightmode);
430 item_to_update = ad->gl_data_item[i][GL_FlightMode];
433 item_to_update->chk_status = flightmode;
434 const char *tmp = item_to_update->l_swallow_path;
435 SETTING_TRACE("status:%d", flightmode);
438 item_to_update->l_swallow_path = (char *)g_strdup(SETTING_ICON_PATH_CFG"settings_flightoff1.png");
442 item_to_update->l_swallow_path = (char *)g_strdup(SETTING_ICON_PATH_CFG"A01-1_icon_Flight_Mode.png");
446 elm_genlist_item_fields_update(item_to_update->item, "*", ELM_GENLIST_ITEM_FIELD_CONTENT);
453 #if SUPPORT_NETWORK_RESTRICTION
454 } else if (!safeStrCmp(vconf_name, VCONFKEY_SETAPPL_NETWORK_RESTRICT_MODE)) {
456 vconf_get_bool( VCONFKEY_SETAPPL_NETWORK_RESTRICT_MODE, &status );
458 // Update network restriction mode UI
459 for (i = VIEW_All_List; i < VIEW_Max; i++)
461 setting_genlist_item_disabled_set(ad->gl_data_item[i][GL_MobileApp], status);
462 setting_genlist_item_disabled_set(ad->gl_data_item[i][GL_WiFi], status);
463 setting_force_update_gl_item_chk_status(ad->gl_data_item[i][GL_NetRestriction], status );
468 } else if (!safeStrCmp(vconf_name, VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL)) {
469 SETTING_TRACE_DEBUG("%s updated", vconf_name);
471 vconf_get_bool(VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL, &status);
472 for (i = VIEW_All_List; i < VIEW_Max; i++)
474 setting_force_update_gl_item_chk_status(ad->gl_data_item[i][GL_Landscape], status);
479 int angle = elm_win_rotation_get(ad->win_main);
480 elm_win_rotation_with_resize_set(ad->win_main, angle);
484 elm_win_rotation_with_resize_set(ad->win_main, 0);
487 } else if (!safeStrCmp(vconf_name, VCONFKEY_SETAPPL_WALLPAPER_APPLY_COLORTHEME_BOOL)) {
489 SETTING_TRACE_DEBUG("%s updated", vconf_name);
491 vconf_get_bool(VCONFKEY_SETAPPL_WALLPAPER_APPLY_COLORTHEME_BOOL, &status);
493 // only work if status = 1, else it skip the procedure
497 char *homescreen_path = NULL;
498 int ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN, &homescreen_path);
499 SETTING_TRACE("current homescreen_path : (%s) ", homescreen_path);
501 //-----------------------------------------------------------------------------------------------
504 int theme_index = 0; // default = 0
506 int* pcolor = mp_collect_color_set_image(homescreen_path, 1);
507 SETTING_TRACE("******************************************************");
508 SETTING_TRACE(" (homescreen: %s) -- mp_collect_color_set_image: (%d) ", homescreen_path, *pcolor);
509 int *rgb = mp_collect_color_get_RGB(pcolor, 1);
510 SETTING_TRACE("r=%d, g=%d, b=%d", rgb[0], rgb[1], rgb[2]);
512 theme_index = ea_theme_suitable_theme_get(rgb[0], rgb[1], rgb[2]);
513 SETTING_TRACE(" (theme index: %d) - ea_theme_suitable_theme_get", theme_index);
514 SETTING_TRACE("******************************************************");
516 //-----------------------------------------------------------------------------------------------
517 // function call with the index & vconf set
518 vconf_set_int(VCONFKEY_SETAPPL_CHANGE_UI_THEME_INT, theme_index);
520 Eina_Bool result = ea_theme_input_colors_set(theme_index);
521 if( result == EINA_TRUE ) {
522 ea_theme_system_colors_apply();
527 } else if (!safeStrCmp(vconf_name, VCONFKEY_NFC_STATE)) {
528 SETTING_TRACE_DEBUG("%s updated", vconf_name);
530 ecore_timer_del(ad->nfc_timer);
531 ad->nfc_timer = NULL;
535 vconf_get_bool(VCONFKEY_NFC_STATE, &status);
537 for (i = VIEW_All_List; i < VIEW_Max; i++)
539 item_to_update = ad->gl_data_item[i][GL_NFC];
542 item_to_update->swallow_type = SWALLOW_Type_1ICON_1RADIO;
543 item_to_update->chk_status = status;
544 elm_object_item_data_set(item_to_update->item, item_to_update);
545 elm_genlist_item_fields_update(item_to_update->item, "elm.icon.2", ELM_GENLIST_ITEM_FIELD_CONTENT);
550 int sbeam_status = 0;
551 vconf_get_bool(VCONFKEY_NFC_SBEAM, &sbeam_status);
553 vconf_set_bool(VCONFKEY_NFC_SBEAM, !sbeam_status);
556 } else if (!safeStrCmp(vconf_name, VCONFKEY_NFC_SBEAM)) {
557 SETTING_TRACE_DEBUG("%s updated", vconf_name);
560 vconf_get_bool(VCONFKEY_NFC_SBEAM, &status);
561 for (i = VIEW_All_List; i < VIEW_Max; i++)
563 item_to_update = ad->gl_data_item[i][GL_SBeam];
566 item_to_update->chk_status = status;
567 elm_genlist_item_fields_update(item_to_update->item, "elm.icon.2", ELM_GENLIST_ITEM_FIELD_CONTENT);
571 } else if (!safeStrCmp(vconf_name, VCONFKEY_SETAPPL_DM_DRIVING_MODE)) {
572 SETTING_TRACE_DEBUG("%s updated", vconf_name);
573 /* cfg set_item_state has do the work, need to del it, or it will be a issue */
576 vconf_get_bool(VCONFKEY_SETAPPL_DM_DRIVING_MODE, &status);
577 for (i = VIEW_All_List; i < VIEW_Max; i++)
579 item_to_update = ad->gl_data_item[i][GL_DM];
580 setting_force_update_gl_item_chk_status(item_to_update, status);
582 #if SUPPORT_POWERSAVING
583 } else if (!safeStrCmp(vconf_name, VCONFKEY_SETAPPL_PWRSV_SYSMODE_STATUS)) {
584 SETTING_TRACE_DEBUG("%s updated", vconf_name);
586 vconf_get_bool(VCONFKEY_SETAPPL_PWRSV_SYSMODE_STATUS, &status);
587 for (i = VIEW_All_List; i < VIEW_Max; i++)
589 item_to_update = ad->gl_data_item[i][GL_PM];
590 setting_force_update_gl_item_chk_status(item_to_update, status);
593 #if SUPPORT_BLOCKINGMODE
594 } else if (!safeStrCmp(vconf_name, VCONFKEY_SETAPPL_BLOCKINGMODE_BLOCKINGMODE)) {
595 SETTING_TRACE_DEBUG("%s updated", vconf_name);
597 vconf_get_bool(VCONFKEY_SETAPPL_BLOCKINGMODE_BLOCKINGMODE, &status);
598 for (i = VIEW_All_List; i < VIEW_Max; i++)
600 item_to_update = ad->gl_data_item[i][GL_BM];
601 setting_force_update_gl_item_chk_status(item_to_update, status);
604 #if SUPPORT_PERSONALPAGE
605 } else if(!safeStrCmp(vconf_name, VCONFKEY_SETAPPL_PERSONAL_MODE_STATUS_BOOL)) {
606 SETTING_TRACE_DEBUG("%s updated", vconf_name);
609 vconf_get_bool(VCONFKEY_SETAPPL_PERSONAL_MODE_STATUS_BOOL, &status);
611 for (i = VIEW_All_List; i < VIEW_Max; i++)
613 item_to_update = ad->gl_data_item[i][GL_PersonalPage];
614 setting_force_update_gl_item_chk_status(item_to_update, status);
617 #if SUPPORT_GUESTMODE
618 } else if (!safeStrCmp(vconf_name, VCONFKEY_SETAPPL_GM_GUEST_MODE)) {
619 SETTING_TRACE_DEBUG("%s updated", vconf_name);
621 vconf_get_bool(VCONFKEY_SETAPPL_GM_GUEST_MODE, &status);
623 for (i = VIEW_All_List; i < VIEW_Max; i++)
625 item_to_update = ad->gl_data_item[i][GL_GuestMode];
626 setting_force_update_gl_item_chk_status(item_to_update, status);
629 } else if (!safeStrCmp(vconf_name, VCONFKEY_SETAPPL_ACCESSIBILITY_TTS)) {
630 SETTING_TRACE_DEBUG("%s updated", vconf_name);
631 SETTING_TRACE_DEBUG(" TTS update genlist -------------- portrait ");
632 SETTING_TRACE_DEBUG(" TTS update genlist -------------- landscape ");
633 //ad->isTopUpdate = true;
634 SETTING_TRACE("...........");
635 //elm_gengrid_realized_items_update(ad->gengrid);
637 if (ad->update_idler) {
638 ecore_timer_del(ad->update_idler);
639 ad->update_idler = NULL;
641 ad->update_idler = ecore_timer_add(0.5, (Ecore_Task_Cb) __update_gengrid_delayer, ad);
643 } else if (!safeStrCmp(vconf_name, VCONFKEY_SETAPPL_SOUND_STATUS_BOOL)
644 || !safeStrCmp(vconf_name, VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL)) {
645 } else if (!safeStrCmp(vconf_name, VCONFKEY_QUICKSETTING_MULTIWINDOW_ENABLED)){
647 vconf_get_bool(VCONFKEY_QUICKSETTING_MULTIWINDOW_ENABLED, &status);
649 for (i = VIEW_All_List; i < VIEW_Max; i++)
651 item_to_update = ad->gl_data_item[i][GL_MultiWin];
652 setting_force_update_gl_item_chk_status(item_to_update, status);
654 } else if(!safeStrCmp(vconf_name, VCONFKEY_SETAPPL_DEVELOPER_OPTION_STATE)){
655 //int dev_op_state = 0;
656 #ifndef BINARY_RELEASE_TYPE_ENG
657 /*for user binary: need to check develop_option_state vconf value*/
658 if (ad->sub_view[SETTING_TAB_VIEW_GENERAL]) {
659 SETTING_TRACE("redraw Gernel Tab");
660 evas_object_del(ad->sub_view[SETTING_TAB_VIEW_GENERAL]);
661 ad->sub_view[SETTING_TAB_VIEW_GENERAL] = NULL;
664 setting_search_genlist_update(ad);
667 } else if(!safeStrCmp(vconf_name, VCONFKEY_SETAPPL_ENHANCED_TOUCH)){
669 vconf_get_bool(VCONFKEY_SETAPPL_ENHANCED_TOUCH, &status);
671 for (i = VIEW_All_List; i < VIEW_Max; i++)
673 SETTING_TRACE("ad->gl_data_item[%d][GL_TouchSens]:%p", i,ad->gl_data_item[i][GL_TouchSens]);
674 item_to_update = ad->gl_data_item[i][GL_TouchSens];
675 setting_force_update_gl_item_chk_status(item_to_update, status);
681 * the event process when int VCONFS changes
682 * @todo code clean - it has big if-else structure
684 static void setting_int_vconf_change_cb(keynode_t *key, void *data)
686 setting_main_appdata *ad = data;
687 retm_if(!data, "Invalid argument: data is NULL");
689 int status = vconf_keynode_get_int(key);
690 char *vconf_name = vconf_keynode_get_name(key);
691 SETTING_TRACE("Enter %s(%s=%d)", __FUNCTION__, vconf_name, status);
693 Setting_GenGroupItem_Data* item_to_update = NULL;
695 if (!safeStrCmp(vconf_name, VCONFKEY_WIFI_STATE)) {
696 // do handling in case of VCONFKEY_WIFI_STATE
697 SETTING_TRACE_DEBUG("%s updated", vconf_name);
698 SETTING_TRACE("status:%d", status);
699 int on_off_state = EINA_FALSE;
701 case VCONFKEY_WIFI_OFF:
702 on_off_state = EINA_FALSE;
705 case VCONFKEY_WIFI_UNCONNECTED:
707 //item_to_update->chk_status = EINA_FALSE;
708 //item_to_update->swallow_type = SWALLOW_Type_1ICON_1PROCESS;
709 //elm_object_item_data_set(item_to_update->item, item_to_update);
710 //elm_genlist_item_update(item_to_update->item);
712 bool last_state = FALSE;
713 int r = preference_get_boolean(WIFI_LAST_ON_OFF_STATE, &last_state);
716 SETTING_TRACE("ERROR, r:%d", r);
718 char *ap_name = vconf_get_str(VCONFKEY_WIFI_CONNECTED_AP_NAME);
719 SETTING_TRACE("Connect AP:%s", ap_name);
723 SETTING_TRACE("on -> off");
724 if (isEmptyStr(ap_name))
726 if (OP_WIFI_TURNING_ON == ad->wifi_op
727 || OP_WIFI_TURNING_OFF == ad->wifi_op)
729 SETTING_TRACE("Operating in Setting(ad->wifi_op:%d)", ad->wifi_op);
730 //ad->wifi_op = OP_WIFI_TURNING_INVALID;
731 //on_off_state = EINA_FALSE;
736 SETTING_TRACE("Operating in Other App");
742 on_off_state = EINA_FALSE;
748 SETTING_TRACE("off -> on");
749 on_off_state = EINA_TRUE;
753 case VCONFKEY_WIFI_CONNECTED:
754 case VCONFKEY_WIFI_TRANSFER:
756 on_off_state = EINA_TRUE;
759 SETTING_TRACE_ERROR("Invalid wifi status!");
762 ad->wifi_op = OP_WIFI_TURNING_INVALID;
763 if (ad->wifi_timer) {
764 ecore_timer_del(ad->wifi_timer);
765 ad->wifi_timer = NULL;
768 for (i = VIEW_All_List; i < VIEW_Max; i++)
770 item_to_update = ad->gl_data_item[i][GL_WiFi];
774 item_to_update->chk_status = on_off_state;
775 item_to_update->swallow_type = SWALLOW_Type_1ICON_1RADIO;
776 elm_object_item_data_set(item_to_update->item, item_to_update);
777 elm_genlist_item_update(item_to_update->item);
780 preference_set_boolean(WIFI_LAST_ON_OFF_STATE, on_off_state);
782 else if (!safeStrCmp(vconf_name, VCONFKEY_CALL_STATE)) {
783 // do handling in case of VCONFKEY_CALL_STATE
784 //In call situation : Wi-fi / Tethering / Network menu dimmed
785 for (i = VIEW_All_List; i < VIEW_Max; i++)
787 status = (VCONFKEY_CALL_OFF != status);
788 setting_genlist_item_disabled_set(ad->gl_data_item[i][GL_WiFi], status);
789 setting_genlist_item_disabled_set(ad->gl_data_item[i][GL_MobileApp], status);
792 } else if (!safeStrCmp(vconf_name, VCONFKEY_BT_STATUS)) {
793 // do handling in case of VCONFKEY_BT_STATUS
794 SETTING_TRACE_DEBUG("%s updated", vconf_name);
796 ecore_timer_del(ad->bt_timer);
800 for (i = VIEW_All_List; i < VIEW_Max; i++)
802 item_to_update = ad->gl_data_item[i][GL_BT];
805 item_to_update->swallow_type = SWALLOW_Type_1ICON_1RADIO;
806 item_to_update->chk_status = status;
807 elm_object_item_data_set(item_to_update->item, item_to_update);
808 elm_genlist_item_fields_update(item_to_update->item, "elm.icon.2", ELM_GENLIST_ITEM_FIELD_CONTENT);
812 } else if (!safeStrCmp(vconf_name, VCONFKEY_ALLSHARE_STATUS)) {
813 // do handling in case of VCONFKEY_BT_STATUS
814 SETTING_TRACE_DEBUG("%s updated", vconf_name);
816 for (i = VIEW_All_List; i < VIEW_Max; i++)
818 item_to_update = ad->gl_data_item[i][GL_NearByDev];
821 item_to_update->swallow_type = SWALLOW_Type_1ICON_1RADIO;
822 item_to_update->chk_status = status;
823 elm_object_item_data_set(item_to_update->item, item_to_update);
824 elm_genlist_item_fields_update(item_to_update->item, "elm.icon.2", ELM_GENLIST_ITEM_FIELD_CONTENT);
828 } else if (!safeStrCmp(vconf_name, VCONFKEY_MOBILE_HOTSPOT_MODE)) {
829 } else if (!safeStrCmp(vconf_name, VCONFKEY_SYSMAN_BATTERY_STATUS_LOW)) {
830 // do handling in case of VCONFKEY_SYSMAN_BATTERY_STATUS_LOW
831 status = (status <= VCONFKEY_SYSMAN_BAT_CRITICAL_LOW);
832 for (i = VIEW_All_List; i < VIEW_Max; i++)
834 setting_genlist_item_disabled_set(ad->gl_data_item[i][GL_Bright], status);
837 } else if (!safeStrCmp(vconf_name, VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT)) {
838 // do handling in case of VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT
840 for (i = VIEW_All_List; i < VIEW_Max; i++)
842 item_to_update = ad->gl_data_item[i][GL_Bright];
845 G_FREE(item_to_update->sub_desc);
846 item_to_update->sub_desc = (char *)g_strdup(get_brightness_mode_str());
847 elm_object_item_data_set(item_to_update->item, item_to_update);
848 elm_genlist_item_update(item_to_update->item);
851 } else if (!safeStrCmp(vconf_name, VCONFKEY_SETAPPL_LCD_TIMEOUT_NORMAL)) {
853 for (i = VIEW_All_List; i < VIEW_Max; i++)
855 item_to_update = ad->gl_data_item[i][GL_Backlight];
858 char backlight_time_str[MAX_DISPLAY_NAME_LEN_ON_UI];
860 snprintf(backlight_time_str, sizeof(backlight_time_str), "%s",
861 _("IDS_ST_BODY_ALWAYS_ON"));
862 } else if (status == 60) {
863 snprintf(backlight_time_str, sizeof(backlight_time_str), "%s",
864 _("IDS_COM_BODY_1_MINUTE"));
865 } else if (status > 60) {
866 snprintf(backlight_time_str, sizeof(backlight_time_str),
867 "%d %s", status / 60, (char *)(_("IDS_COM_BODY_MINUTES_LC")));
869 snprintf(backlight_time_str, sizeof(backlight_time_str),
870 "%d %s", status, (char *)(_("IDS_COM_BODY_SECONDS_LC")));
872 SETTING_TRACE("backlight_time_str:%s", backlight_time_str);
873 G_FREE(item_to_update->sub_desc);
874 item_to_update->sub_desc = (char *)g_strdup(backlight_time_str);
875 elm_object_item_data_set(item_to_update->item, item_to_update);
876 elm_genlist_item_update(item_to_update->item);
879 } else if (!safeStrCmp(vconf_name, VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE)) {
883 } else if (!safeStrCmp(vconf_name, VCONFKEY_SYSMAN_BATTERY_CAPACITY)) {
885 SETTING_TRACE_ERROR("vconf_name is bad[%s]", vconf_name);
893 * the event process when string VCONFS changes
895 static void setting_string_vconf_change_cb(keynode_t *key, void *data)
897 setting_main_appdata *ad = data;
898 retm_if(!data, "Invalid argument: data is NULL");
900 char *value = vconf_keynode_get_str(key);
901 char *vconf_name = vconf_keynode_get_name(key);
902 SETTING_TRACE("Enter %s(%s=%s)", __FUNCTION__, vconf_name, value);
904 if (!safeStrCmp(vconf_name, VCONFKEY_WIFI_CONNECTED_AP_NAME)) {
905 } // vconf_name == VCONFKEY_WIFI_CONNECTED_AP_NAME
906 else if (!safeStrCmp(vconf_name, VCONFKEY_SETAPPL_MOST_RECENTLY_SETTING))
909 else if (!safeStrCmp(vconf_name, VCONFKEY_SETAPPL_SCREENMODE_SELNAME))
912 for (i = VIEW_All_List; i < VIEW_Max; i++)
914 Setting_GenGroupItem_Data *item_to_update = ad->gl_data_item[i][GL_Screenmode];
917 char *tmp = item_to_update->sub_desc;
918 item_to_update->sub_desc = get_pa_screen_mode_str();
920 SETTING_TRACE("item_to_update->sub_desc:%s", item_to_update->sub_desc);
921 elm_object_item_data_set(item_to_update->item, item_to_update);
922 elm_genlist_item_update(item_to_update->item);
926 } else if (!safeStrCmp(vconf_name, VCONFKEY_BGSET)
927 || !safeStrCmp(vconf_name, VCONFKEY_IDLE_LOCK_BGSET)) {
931 bool ___account_subscribe_cb(const char* event_type, int account_id, void* user_data)
934 setting_main_appdata *ad = user_data;
936 SETTING_TRACE("event_type = %s\n", event_type);
938 SETTING_TRACE("account id = %d\n", account_id);
943 if (0 == safeStrCmp(event_type, ACCOUNT_NOTI_NAME_INSERT))
945 if (0 == safeStrCmp(event_type, ACCOUNT_NOTI_NAME_DELETE))
948 if ( !(is_insert|is_delete))
951 bool need_disconnect = FALSE;
952 char *package_name = NULL;
955 ret = account_connect();
956 if ( ret != ACCOUNT_ERROR_NONE ) break;
957 need_disconnect = TRUE;
959 account_h account = NULL;
960 if ( account_create(&account) != ACCOUNT_ERROR_NONE )
963 if ( account_query_account_by_account_id(account_id, &account) != ACCOUNT_ERROR_NONE )
966 if ( account_get_package_name(account, &package_name) == ACCOUNT_ERROR_NONE ) {
967 SETTING_TRACE("package_name : %s", package_name);
969 SETTING_TRACE("failed");
972 if ( account_destroy(account) != ACCOUNT_ERROR_NONE )
977 account_disconnect();
979 if (0 != safeStrCmp(package_name, "ims-service")) //must from joyn service
989 Setting_GenGroupItem_Data *item_to_update = NULL;
990 Setting_GenGroupItem_Data *item_parent = NULL;
991 for (i = VIEW_All_List; i < VIEW_Max; i += 3)//just for VIEW_All_List and VIEW_Common
993 item_to_update = ad->gl_data_item[i][GL_Joyn];
994 item_parent = ad->gl_data_item[i][GL_WiFi];
995 if(!item_parent) continue;
997 if (!safeStrCmp(event_type, ACCOUNT_NOTI_NAME_DELETE))
999 if (item_to_update && item_to_update->item)
1001 SETTING_TRACE("To remove joyn");
1002 elm_object_item_del(item_to_update->item);
1004 item_to_update = NULL;
1005 setting_genlist_item_groupstyle_set(item_parent, SETTING_GROUP_STYLE_TOP);
1007 else if (!safeStrCmp(event_type, ACCOUNT_NOTI_NAME_INSERT))
1009 if (!item_to_update || !item_to_update->item)
1011 SETTING_TRACE("To add joyn");
1012 item_to_update = (Setting_GenGroupItem_Data *) calloc(1, sizeof(Setting_GenGroupItem_Data));
1013 setting_retvm_if(item_to_update == NULL, TRUE, "calloc failed");
1014 item_to_update->keyStr = (char *)g_strdup(KeyStr_Joyn);
1015 item_to_update->swallow_type = SWALLOW_Type_INVALID;
1016 item_to_update->userdata = ad;
1017 item_to_update->l_swallow_path = (char *)g_strdup(IMG_Joyn);
1019 item_to_update->item = elm_genlist_item_insert_before(ad->sub_view[SETTING_TAB_VIEW_CONNECTION],
1020 &(ad->itc[GENDIAL_Type_1text_1icon_2]),
1021 item_to_update, NULL,
1022 item_parent->item, ELM_GENLIST_ITEM_NONE,
1023 setting_main_click_list_ex_ug_cb,
1024 "setting-joyn-efl");
1025 setting_genlist_item_groupstyle_set(item_to_update, SETTING_GROUP_STYLE_TOP);
1026 setting_genlist_item_groupstyle_set(item_parent, SETTING_GROUP_STYLE_CENTER);
1031 ad->data_joyn = item_to_update;
1032 __BACK_POINTER_SET(ad->data_joyn);
1036 ad->gl_data_item[VIEW_All_List][GL_Joyn] = item_to_update;
1037 __BACK_POINTER_SET(ad->gl_data_item[VIEW_All_List][GL_Joyn]);
1041 ad->gl_data_item[VIEW_Common][GL_Joyn] = item_to_update;
1042 __BACK_POINTER_SET(ad->gl_data_item[VIEW_All_List][GL_Joyn]);
1050 * The function is called to create Setting view widgets
1052 static bool setting_main_app_create(void *data)
1054 SETTING_TRACE_BEGIN;
1055 LAUNCH_SETTING_IN();
1056 SETTING_TRACE_DEBUG("[TIME] 3. it taked %d msec from main to setting_main_app_create ", appcore_measure_time());
1057 appcore_measure_start();
1059 //elm_config_preferred_engine_set("opengl_x11");
1060 ug_create_cb(setting_ug_create_cb, NULL);
1062 #ifdef TIZEN_BUILD_TARGET
1063 SETTING_TRACE_DEBUG(" ------------------------> TIZEN_BUILD_TARGET is ON");
1066 #ifdef TIZEN_BUILD_EMULATOR
1067 SETTING_TRACE_DEBUG(" ------------------------> TIZEN_BUILD_EMULATOR is ON");
1071 setenv("EVAS_DRI_SWAPBUF", "1", 1);
1074 setting_main_appdata *ad = data;
1075 // regitering sigterm
1076 if (signal(SIGTERM, termination_handler) == SIG_IGN) {
1077 signal(SIGTERM, SIG_IGN);
1083 app_control_create(&svc);
1084 //app_control_create_request(b, &svc);
1085 //ad->is_searchmode = setting_main_sfinder_handler(svc, ad, NULL);
1086 app_control_destroy(svc);
1089 //---------------------------------------------------------------------------------------------
1090 ad->data_roaming_popup = NULL;
1092 elm_app_base_scale_set(2.4);
1095 ad->win_main = setting_main_create_win(SETTING_PACKAGE);
1096 setting_retvm_if(ad->win_main == NULL, SETTING_RETURN_FAIL, "window is null");
1097 UG_INIT_EFL(ad->win_main, UG_OPT_INDICATOR_ENABLE);
1098 ad->evas = evas_object_evas_get(ad->win_main);
1099 ad->current_rotation = elm_win_rotation_get(ad->win_main);
1100 SETTING_TRACE_DEBUG("ad->current_rotation:%d",ad->current_rotation);
1101 if (elm_win_wm_rotation_supported_get(ad->win_main))
1103 int rots[4] = { 0, 90, 180, 270 }; // rotation value that app may want
1104 elm_win_wm_rotation_available_rotations_set(ad->win_main, rots, 4);
1106 evas_object_smart_callback_add(ad->win_main, "wm,rotation,changed", _rot_changed_cb, ad);
1108 /* load config file */
1109 int cfg_operation_ret = setting_cfg_init();
1111 //if ( ! ad->is_searchmode)
1113 elm_theme_extension_add(NULL, SETTING_THEME_EDJ_NAME);
1114 elm_theme_extension_add(NULL, SETTING_NEWUX_EDJ_NAME);
1115 elm_theme_extension_add(NULL, SETTING_GENLIST_EDJ_NAME);
1116 elm_theme_extension_add(NULL, SETTING_NEW_GENLIST_EDJ_NAME);
1117 elm_theme_extension_add(NULL, SETTING_SLIDER_EDJ_NAME);
1120 elm_win_indicator_mode_set(ad->win_main, ELM_WIN_INDICATOR_SHOW);
1121 elm_win_indicator_opacity_set(ad->win_main, ELM_WIN_INDICATOR_OPAQUE);
1123 evas_object_show(ad->win_main);
1126 setting_view_create(&setting_view_main, ad);
1128 /* error handling */
1129 if (Cfg_Error_Type_Sucess != cfg_operation_ret) {
1130 SETTING_TRACE_ERROR("cfg_operation_ret: %d", cfg_operation_ret);
1131 const char *notifyStr = NULL;
1132 switch (cfg_operation_ret) {
1134 case Cfg_Error_Type_CreateCfg_Failed:
1136 notifyStr = _("failed to create config file, <br>re-install org.tizen.setting please");
1139 case Cfg_Error_Type_Mkdir_Failed:
1141 notifyStr = _("file system missed<br>/opt/usr/data/setting, <br>re-install org.tizen.setting please");
1144 case Cfg_Error_Type_RemoveCfg_Failed:
1146 notifyStr = _("config file size 0 byte<br>and failed to re-create it.<br>try to startup the app again");
1149 case Cfg_Error_Type_ReadCfg_Failed:
1151 notifyStr = _("failed to read config file, <br>try to startup the app again");
1154 case Cfg_Error_Type_DirPermissionDenied:
1157 _("the dir of config file permission denied");
1160 case Cfg_Error_Type_FilePermissionDenied:
1162 notifyStr = _("config file permission denied");
1167 notifyStr = _("Invalid Result, try to startup the app again");
1171 setting_create_popup_without_btn(ad, ad->win_main, NULL, (char *)notifyStr, NULL, 10, FALSE, FALSE);
1172 return SETTING_RETURN_FAIL;
1176 ad->theme_table = _changeable_colors_set();
1178 SETTING_TRACE_DEBUG("[TIME] 4. setting_main_app_create taked %d msec ", appcore_measure_time());
1179 appcore_measure_start();
1180 LAUNCH_SETTING_OUT();
1185 * The function is called when Setting is terminated
1187 static void setting_main_app_terminate(void *data)
1189 SETTING_TRACE_BEGIN;
1190 setting_main_appdata *ad = data;
1191 if (ad->account_subscribe_handle)
1193 (void)account_unsubscribe_notification(ad->account_subscribe_handle);
1195 vconf_set_bool (VCONFKEY_SETAPPL_ROTATE_HOLD_BOOL, FALSE);
1196 evas_object_smart_callback_del(ad->win_main, "wm,rotation,changed", _rot_changed_cb);
1199 (void)preference_set_int(PREFKEY_VIEW_TYPE, ad->list_type);
1200 (void)preference_set_int(PREFKEY_TAB_VIEW_TAB, ad->view_type);
1203 _changeable_colors_free(ad->theme_table);
1207 clear_system_service_data();
1212 ug_create_cb(NULL , NULL);
1214 SETTING_TRACE_DEBUG("%s*** SETTING APPLICATION CLOSED ***%s", SETTING_FONT_BGREEN, SETTING_FONT_BLACK);
1215 DEREGISTER_VCONFS(ad->listened_list);
1218 #if SUPPORT_LCD_TIMEOUT_KEEPING
1219 /* once Setting is not running, LCD_TIMEOUT must be backuped */
1221 vconf_get_int(VCONFKEY_LCD_TIMEOUT_NORMAL_BACKUP, &back_value);
1222 vconf_set_int(VCONFKEY_SETAPPL_LCD_TIMEOUT_NORMAL, back_value);
1224 setting_view_destroy(&setting_view_main, ad);
1226 SETTING_TRACE_DEBUG("!!! After setting_view_destroy");
1228 evas_object_del(ad->win_main);
1229 ad->win_main = NULL;
1243 * The function is called when Setting begins run in background from forground
1245 static void setting_main_app_pause(void *data)
1247 SETTING_TRACE_BEGIN;
1248 setting_main_appdata *ad = data;
1254 #if SUPPORT_LCD_TIMEOUT_KEEPING
1255 /* once Setting is running in background, LCD_TIMEOUT must be backuped */
1257 vconf_get_int(VCONFKEY_LCD_TIMEOUT_NORMAL_BACKUP, &back_value);
1258 vconf_set_int(VCONFKEY_SETAPPL_LCD_TIMEOUT_NORMAL, back_value);
1264 * The function is called when Setting begins run in forground from background
1266 static void setting_main_app_resume(void *data)
1268 SETTING_TRACE_BEGIN;
1269 setting_main_appdata *ad = data;
1271 #if SUPPORT_LCD_TIMEOUT_KEEPING
1272 /* once Setting is running in foreground, LCD_TIMEOUT must be reset to 600 */
1273 vconf_set_int(VCONFKEY_SETAPPL_LCD_TIMEOUT_NORMAL, 600);
1275 _rot_changed_cb(ad, ad->win_main, NULL);//to fix P131121-02103
1277 if(ad->is_searchmode%10 == Cfg_Item_AppLauncher_Node) {
1278 // app-launching exit
1282 if(!(ad->isInUGMode && ad->ug)) { // top-level view is not on UG
1283 SETTING_TRACE("update main genlist in resuming app without UG");
1284 Eina_Bool is_freezed = evas_object_freeze_events_get(ad->navibar_main);
1285 SETTING_TRACE_DEBUG("is_freezed : %d", is_freezed);
1288 evas_object_freeze_events_set(ad->navibar_main, EINA_FALSE);
1291 // update personal mode toggle
1292 Setting_GenGroupItem_Data *item_to_update;
1294 vconf_get_bool(VCONFKEY_SETAPPL_PERSONAL_MODE_STATUS_BOOL, &status);
1296 for (i = VIEW_All_List; i < VIEW_Max; i++)
1298 item_to_update = ad->gl_data_item[i][GL_PersonalPage];
1299 setting_force_update_gl_item_chk_status(item_to_update, status);
1301 } else if (ad->ug) {
1306 static Cfg_Item_Type setting_main_sfinder_handler(app_control_h service, void* data, int (*func)(void* d1))
1308 SETTING_TRACE_BEGIN;
1309 setting_main_appdata *ad = data;
1310 Cfg_Item_Type ret_code = Cfg_Item_Node_Error;
1317 char* infostr = NULL;
1318 char* viewname = NULL;
1319 char* fieldname = NULL;
1321 char* check_value = NULL;
1323 //int ret_action = -1;
1324 int ret = app_control_get_uri (service, &uri);
1325 if (APP_CONTROL_ERROR_NONE == ret && uri && !safeStrCmp(uri, S_FINDER_SETTING_STR)) {
1327 app_control_get_extra_data(service, "type", &type);
1328 app_control_get_extra_data(service, "infostr", &infostr);
1329 app_control_get_extra_data(service, "viewname", &viewname);
1330 app_control_get_extra_data(service, "fieldname", &fieldname);
1331 app_control_get_extra_data(service, "title", &title);
1332 app_control_get_extra_data(service, "s_finder_setting_check_value_set", &check_value);
1334 SETTING_TRACE("-------------------------------------");
1335 SETTING_TRACE("S-finder launched org.tizen.setting : %s", uri);
1336 SETTING_TRACE("title %s", title);
1337 SETTING_TRACE("type %s", type);
1338 SETTING_TRACE("infostr %s", infostr);
1339 SETTING_TRACE("viewname %s", viewname);
1340 SETTING_TRACE("fieldname %s", fieldname);
1341 SETTING_TRACE("s_finder_setting_check_value_set %s", check_value);
1342 SETTING_TRACE("-------------------------------------");
1344 ret_code = setting_search_type(type);
1346 ListItemObject* plistitem = calloc(1, sizeof(ListItemObject));
1349 plistitem->title = strdup(title);
1350 plistitem->title2 = strdup(title);
1353 plistitem->type = strdup(type);
1355 plistitem->infostr = strdup(infostr);
1357 plistitem->viewname = strdup(viewname);
1359 plistitem->fieldname = strdup(fieldname);
1361 plistitem->check_value_set = strdup(check_value);
1363 plistitem->data = ad;
1370 int toggle_state = -1;
1371 if(!safeStrCmp(check_value, "1")) {
1373 } else if(!safeStrCmp(check_value, "0")) {
1376 if(toggle_state >= 0)
1378 Setting_Cfg_Node_T* pnode = get_cfg_node_by_keystr(_(plistitem->title2));
1379 if (pnode && pnode->tfunc && pnode->tfunc->set_item_state) {
1380 pnode->tfunc->set_item_state(toggle_state, plistitem, ad);
1381 SETTING_TRACE("OOOOOOOOOO CALL set_item_state from tfunc");
1382 } else if ( !pnode && plistitem->viewname) {
1383 // if get_cfg_node_by_keystr returns NULL, search for UG's keyword
1384 int ret = setting_search_set_module_item_state(plistitem->title2, plistitem->viewname, toggle_state, NULL);
1385 SETTING_TRACE("---------------------------------------");
1386 SETTING_TRACE(" >>> ret : %d, state : %d <<< ", ret, toggle_state);
1387 SETTING_TRACE("---------------------------------------");
1394 // if svc == 0, return the previous status
1395 ret_code = ad->is_searchmode;
1396 SETTING_TRACE(" HERE !!!! >>>> previous ad->is_searchmode = %d ", ad->is_searchmode);
1405 // if svc == 0, return the previous status
1406 ret_code = ad->is_searchmode;
1407 SETTING_TRACE(" >>>> previous ad->is_searchmode = %d ", ad->is_searchmode);
1414 * The function is called by app-fwk after app_create. It always do the process which cost much time.
1416 static void setting_main_app_reset(app_control_h service, void *data)
1418 SETTING_TRACE_BEGIN;
1419 setting_main_appdata *ad = data;
1421 if (is_searchmode_app(ad->is_searchmode))
1423 evas_object_hide(ad->view_layout);
1425 evas_object_show(ad->view_layout);
1427 vconf_callback_fn cb = NULL;
1429 cb = setting_int_vconf_change_cb;
1430 REGISTER_VCONF_NODE(ad->listened_list, VCONFKEY_BT_STATUS, cb, data);
1431 REGISTER_VCONF_NODE(ad->listened_list, VCONFKEY_WIFI_STATE, cb, ad);
1432 //REGISTER_VCONF_NODE(ad->listened_list, VCONFKEY_MOBILE_HOTSPOT_MODE, cb, ad);
1433 //REGISTER_VCONF_NODE(ad->listened_list, VCONFKEY_CALL_STATE, cb, ad);
1435 REGISTER_VCONF_NODE(ad->listened_list, VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT, cb, data);
1436 REGISTER_VCONF_NODE(ad->listened_list, VCONFKEY_SETAPPL_LCD_TIMEOUT_NORMAL, cb, data);
1437 REGISTER_VCONF_NODE(ad->listened_list, VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, cb, data);
1438 REGISTER_VCONF_NODE(ad->listened_list, VCONFKEY_SYSMAN_BATTERY_CAPACITY, cb, data);
1439 //REGISTER_VCONF_NODE(ad->listened_list, VCONFKEY_ALLSHARE_STATUS, cb, data);
1442 cb = setting_string_vconf_change_cb;
1443 REGISTER_VCONF_NODE(ad->listened_list, VCONFKEY_WIFI_CONNECTED_AP_NAME, cb, ad);
1444 REGISTER_VCONF_NODE(ad->listened_list, VCONFKEY_SETAPPL_MOST_RECENTLY_SETTING, cb, ad);
1445 REGISTER_VCONF_NODE(ad->listened_list, VCONFKEY_SETAPPL_SCREENMODE_SELNAME, cb, ad);
1446 REGISTER_VCONF_NODE(ad->listened_list, VCONFKEY_BGSET, cb, ad);
1447 REGISTER_VCONF_NODE(ad->listened_list, VCONFKEY_IDLE_LOCK_BGSET, cb, ad);
1449 cb = setting_other_vconf_change_cb;
1450 REGISTER_VCONF_NODE(ad->listened_list, VCONFKEY_SETAPPL_USB_MODE_INT, cb, ad);
1451 REGISTER_VCONF_NODE(ad->listened_list, VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL, cb, ad);
1452 REGISTER_VCONF_NODE(ad->listened_list, VCONFKEY_TELEPHONY_FLIGHT_MODE, cb, ad);
1453 #if SUPPORT_NETWORK_RESTRICTION
1454 REGISTER_VCONF_NODE(ad->listened_list, VCONFKEY_SETAPPL_NETWORK_RESTRICT_MODE, cb, ad);
1456 //REGISTER_VCONF_NODE(ad->listened_list, VCONFKEY_NFC_STATE, cb, ad);
1457 //REGISTER_VCONF_NODE(ad->listened_list, VCONFKEY_NFC_SBEAM, cb, ad);
1458 //REGISTER_VCONF_NODE(ad->listened_list, VCONFKEY_SETAPPL_DM_DRIVING_MODE, cb, ad);
1459 #if SUPPORT_POWERSAVING
1460 REGISTER_VCONF_NODE(ad->listened_list, VCONFKEY_SETAPPL_PWRSV_SYSMODE_STATUS, cb, ad);
1462 //REGISTER_VCONF_NODE(ad->listened_list, VCONFKEY_QUICKSETTING_MULTIWINDOW_ENABLED, cb, ad);
1464 REGISTER_VCONF_NODE(ad->listened_list, VCONFKEY_SETAPPL_WALLPAPER_APPLY_COLORTHEME_BOOL, cb, ad);
1466 #if SUPPORT_BLOCKINGMODE
1467 REGISTER_VCONF_NODE(ad->listened_list, VCONFKEY_SETAPPL_BLOCKINGMODE_BLOCKINGMODE, cb, ad);
1469 #if SUPPORT_GUESTMODE
1470 REGISTER_VCONF_NODE(ad->listened_list, VCONFKEY_SETAPPL_GM_GUEST_MODE, cb, ad);
1473 REGISTER_VCONF_NODE(ad->listened_list, VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, cb, ad);
1474 REGISTER_VCONF_NODE(ad->listened_list, VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, cb, ad);
1475 #if SUPPORT_PERSONALPAGE
1476 REGISTER_VCONF_NODE(ad->listened_list, VCONFKEY_SETAPPL_PERSONAL_MODE_STATUS_BOOL, cb, ad);
1477 REGISTER_VCONF_NODE(ad->listened_list, VCONFKEY_SETAPPL_PERSONAL_MODE_UNLOCK_METHOD_INT, cb, ad);
1479 REGISTER_VCONF_NODE(ad->listened_list, VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, cb, ad);
1480 #ifndef BINARY_RELEASE_TYPE_ENG
1481 REGISTER_VCONF_NODE(ad->listened_list, VCONFKEY_SETAPPL_DEVELOPER_OPTION_STATE, cb, ad);
1483 REGISTER_VCONF_NODE(ad->listened_list, VCONFKEY_SETAPPL_ENHANCED_TOUCH, cb, ad);
1484 //----------------------------------------------------------------------------------
1486 //----------------------------------------------------------------------------------
1489 elm_win_activate(ad->win_main);
1491 int flight_mode = 0;
1492 vconf_get_bool(VCONFKEY_TELEPHONY_FLIGHT_MODE, &flight_mode);
1495 if (ad->data_network) setting_disable_genlist_item(ad->data_network->item);
1496 if (ad->data_powersaving) setting_disable_genlist_item(ad->data_powersaving->item);
1501 //account_subscribe_h account_subscribe_handle = NULL;
1503 //ad->is_searchmode = setting_main_sfinder_handler(service, ad, setting_search_move_action);
1505 if (! is_searchmode_app(ad->is_searchmode))
1507 if (ACCOUNT_ERROR_NONE == account_subscribe_create(&(ad->account_subscribe_handle))
1508 && ad->account_subscribe_handle)
1510 (void)account_subscribe_notification(ad->account_subscribe_handle, ___account_subscribe_cb, ad);
1516 int main(int argc, char *argv[])
1519 setting_main_appdata ad;
1521 SETTING_TRACE_DEBUG("[TIME] 1. aul_launch -> main :: Setting main : %d msec ", appcore_measure_time_from("APP_START_TIME"));
1522 appcore_measure_start();
1525 app_event_callback_s ops = {
1526 .create = setting_main_app_create,
1527 .terminate = setting_main_app_terminate,
1528 .pause = setting_main_app_pause,
1529 .resume = setting_main_app_resume,
1530 .app_control = setting_main_app_reset,
1531 .low_battery = setting_main_low_battery_cb,
1532 .language_changed = setting_main_lang_changed_cb,
1533 .region_format_changed = setting_main_region_changed_cb,
1534 .device_orientation = NULL,
1538 memset(&ad, 0x00, sizeof(setting_main_appdata));
1541 b = bundle_import_from_argv(argc, argv);
1544 SETTING_TRACE_DEBUG("[TIME] 2. main : %d msec ", appcore_measure_time());
1545 appcore_measure_start();
1546 r = app_efl_main(&argc, &argv, &ops, &ad);
1547 retv_if(r == -1, -1);