From 2921cef2c344ab34863402671e681dff2493d522 Mon Sep 17 00:00:00 2001 From: Hyejin Kim Date: Thu, 6 Sep 2012 16:57:43 +0900 Subject: [PATCH] re-organize security patchset3. add missed files Change-Id: I61d140f2bd5728d3105f06bc44de30d70925221e --- CMakeLists.txt | 9 +- include/setting-debug.h | 2 - setting-livebox/CMakeLists.txt | 45 -- setting-livebox/include/setting-livebox-main.h | 27 -- setting-livebox/include/setting-livebox.h | 64 --- setting-livebox/src/setting-livebox-main.c | 421 ------------------ setting-livebox/src/setting-livebox.c | 169 -------- setting-security/CMakeLists.txt | 4 +- .../include/setting-security-encryption.h | 32 -- .../include/setting-security-screen-lock-type.h | 33 -- setting-security/include/setting-security.h | 85 +--- setting-security/src/setting-security-encryption.c | 128 ------ setting-security/src/setting-security-main.c | 451 +------------------ .../src/setting-security-screen-lock-type.c | 324 -------------- .../src/setting-security-sim-settings.c | 156 +++++-- setting-security/src/setting-security.c | 476 +-------------------- setting-shortcut/CMakeLists.txt | 44 -- setting-shortcut/include/setting-shortcut-main.h | 27 -- setting-shortcut/include/setting-shortcut.h | 62 --- setting-shortcut/src/setting-shortcut-main.c | 197 --------- setting-shortcut/src/setting-shortcut.c | 167 -------- 21 files changed, 141 insertions(+), 2782 deletions(-) delete mode 100755 setting-livebox/CMakeLists.txt delete mode 100755 setting-livebox/include/setting-livebox-main.h delete mode 100755 setting-livebox/include/setting-livebox.h delete mode 100755 setting-livebox/src/setting-livebox-main.c delete mode 100755 setting-livebox/src/setting-livebox.c delete mode 100755 setting-security/include/setting-security-encryption.h delete mode 100755 setting-security/include/setting-security-screen-lock-type.h delete mode 100755 setting-security/src/setting-security-encryption.c delete mode 100755 setting-security/src/setting-security-screen-lock-type.c delete mode 100755 setting-shortcut/CMakeLists.txt delete mode 100644 setting-shortcut/include/setting-shortcut-main.h delete mode 100755 setting-shortcut/include/setting-shortcut.h delete mode 100755 setting-shortcut/src/setting-shortcut-main.c delete mode 100755 setting-shortcut/src/setting-shortcut.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 680bfac..fa3fb0e 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,6 +21,7 @@ SET(SETTING_TIME setting-time) SET(SETTING_PHONE setting-phone) SET(SETTING_MEMORY setting-memory) SET(SETTING_RESET setting-reset) +SET(SETTING_SECURITY setting-security) SET(SETTING_PASSWORD setting-password) SET(SETTING_COMMON setting-common) SET(SETTING_NETWORK setting-network) @@ -33,8 +34,6 @@ SET(SETTING_POWERSAVING setting-powersaving) SET(SETTING_FONT setting-font) SET(SETTING_STORAGE setting-storage) SET(SETTING_FILEVIEW setting-fileview) -SET(SETTING_LIVEBOX setting-livebox) -SET(SETTING_SHORTCUT setting-shortcut) SET(SETTING_DATAUSAGE setting-datausage) #SET(SETTING_DRIVINGMODE setting-drivingmode) @@ -49,8 +48,6 @@ SET(SETTING_RESET_UG ug-setting-reset-efl) SET(SETTING_NETWORK_UG ug-setting-network-efl) SET(SETTING_ABOUT_UG ug-setting-about-efl) SET(SETTING_FILEVIEW_UG ug-setting-fileview-efl) -SET(SETTING_LIVEBOX_UG ug-setting-livebox-efl) -SET(SETTING_SHORTCUT_UG ug-setting-shortcut-efl) SET(SETTING_PASSWORD_UG ug-setting-password-efl) #SET(SETTING_VIEWTYPE_UG ug-setting-viewtype-efl) @@ -79,9 +76,9 @@ ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_MEMORY}) ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_NETWORK}) ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_PROFILE}) ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_RESET}) -ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_SECURITY}) ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_TIME}) ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_ABOUT}) +ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_SECURITY}) ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_PASSWORD}) #ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_VIEWTYPE}) #ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_MOTION}) @@ -90,8 +87,6 @@ ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_MENUSCREEN}) ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_POWERSAVING}) ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_FONT}) ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_FILEVIEW}) -ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_LIVEBOX}) -ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_SHORTCUT}) ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_DATAUSAGE}) #ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_DRIVINGMODE}) ADD_SUBDIRECTORY(src) diff --git a/include/setting-debug.h b/include/setting-debug.h index f83b404..8eccd76 100755 --- a/include/setting-debug.h +++ b/include/setting-debug.h @@ -100,8 +100,6 @@ #define SUPPORT_DATEFIELD_DATE_FORMAT_AUTOSET 0 #define SUPPORT_FDN 0 -#define SUPPORT_ENCRYPTION 0 -#define SUPPORT_SCREEN_SECURITY 1 #define SUPPORT_PARENTAL_MODE 0 #define SETTING_ENABLE_TRACE diff --git a/setting-livebox/CMakeLists.txt b/setting-livebox/CMakeLists.txt deleted file mode 100755 index e4e94d8..0000000 --- a/setting-livebox/CMakeLists.txt +++ /dev/null @@ -1,45 +0,0 @@ - -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include) -INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/${SETTING_COMMON}/include) - - -INCLUDE(FindPkgConfig) -pkg_check_modules(pkgs_livebox REQUIRED - evas ecore edje - elementary - appcore-common - appcore-efl - ecore-imf ui-gadget-1 - json-glib-1.0 - capi-appfw-application dlog) - -FOREACH(flag ${pkgs_livebox_CFLAGS}) - SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") -ENDFOREACH(flag) - -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC") -SET(CMAKE_C_FLAGS_DEBUG "-O0 -g") - -IF("${ARCH}" STREQUAL "arm") - ADD_DEFINITIONS("-DTARGET") - MESSAGE("add -DTARGET") -ENDIF("${ARCH}" STREQUAL "arm") - -ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"") -ADD_DEFINITIONS("-DSLP_DEBUG") - -SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl, --rpath=/usr/lib") - -ADD_LIBRARY(${SETTING_LIVEBOX_UG} SHARED - ./src/setting-livebox.c - ./src/setting-livebox-main.c -) - -TARGET_LINK_LIBRARIES(${SETTING_LIVEBOX_UG} -L${CMAKE_BINARY_DIR}/${SETTING_COMMON} -lsetting-common) -TARGET_LINK_LIBRARIES(${SETTING_LIVEBOX_UG} ${pkgs_livebox_LDFLAGS}) - -INSTALL(TARGETS ${SETTING_LIVEBOX_UG} DESTINATION /opt/ug/lib) - - - - diff --git a/setting-livebox/include/setting-livebox-main.h b/setting-livebox/include/setting-livebox-main.h deleted file mode 100755 index 4aa181c..0000000 --- a/setting-livebox/include/setting-livebox-main.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * setting - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. - * - * Contact: MyoungJune Park - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -#ifndef _SETTING_LIVEBOX_MAIN_H_ -#define _SETTING_LIVEBOX_MAIN_H_ - -#include - - -#endif diff --git a/setting-livebox/include/setting-livebox.h b/setting-livebox/include/setting-livebox.h deleted file mode 100755 index 76a2883..0000000 --- a/setting-livebox/include/setting-livebox.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * setting - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. - * - * Contact: MyoungJune Park - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -#ifndef _SETTING_LIVEBOX_H_ -#define _SETTING_LIVEBOX_H_ -#include - -#include -#include -#include - -#include - -#include -#include -#include - -#define MAX_MENU_NUM 100 -#define MAX_SELECTION_NUM 4 - -typedef struct _SettingLiveboxUG { - ui_gadget_h ug; - - /* add more variables here (move your appdata to here) */ - Evas *evas; - Evas_Object *win_main_layout; - Evas_Object *win_get; - Evas_Object *ly_main; - - Elm_Object_Item *navi_it; - Evas_Object *controllbar; - Evas_Object *navi_bar; - Evas_Object *sub_layout; - - Evas_Object *search_bar; - Evas_Object *scroller; - - unsigned int select_count; - unsigned int menu_count; - Setting_GenGroupItem_Data *item[MAX_MENU_NUM]; -} SettingLiveboxUG; - -extern setting_view setting_view_livebox_main; - - - -#endif diff --git a/setting-livebox/src/setting-livebox-main.c b/setting-livebox/src/setting-livebox-main.c deleted file mode 100755 index 61679b3..0000000 --- a/setting-livebox/src/setting-livebox-main.c +++ /dev/null @@ -1,421 +0,0 @@ -/* - * setting - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. - * - * Contact: MyoungJune Park - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -#include -#include -#include -#include - -static int setting_livebox_main_create(void *cb); -static int setting_livebox_main_destroy(void *cb); -static int setting_livebox_main_update(void *cb); -static int setting_livebox_main_cleanup(void *cb); - -setting_view setting_view_livebox_main = { - .create = setting_livebox_main_create, - .destroy = setting_livebox_main_destroy, - .update = setting_livebox_main_update, - .cleanup = setting_livebox_main_cleanup, -}; - -/* *************************************************** - * - *basic func - * - ***************************************************/ - -static void setting_livebox_main_sk_done_cb(void *data, Evas_Object *obj, void *event_info) -{ - SETTING_TRACE_BEGIN; - /* error check */ - ret_if(data == NULL); - - SettingLiveboxUG *ad = (SettingLiveboxUG *)data; - - /* send information of selected items to live-setting */ - if(ad->select_count > 0) - { - SETTING_TRACE_DEBUG("select_count : %u", ad->select_count); - int idx = 0; - int check_count = 0; - char *result_array[MAX_SELECTION_NUM*2]; - service_h svc; - - if (service_create(&svc)) { - return; - } - - for(; idx < ad->menu_count; idx++) - { - if(ad->item[idx]->chk_status) - { - if(check_count > ad->select_count) - { - SETTING_TRACE_DEBUG("exceed count: %u", check_count); - break; - } - SETTING_TRACE_DEBUG("item[%u] is checked", idx); - result_array[check_count*2] = setting_gettext(ad->item[idx]->keyStr); - result_array[check_count*2+1] = (char *)ad->item[idx]->r_swallow_path; - SETTING_TRACE_DEBUG("app_name : %s, icon_path : %s", result_array[check_count*2], result_array[check_count*2+1]); - check_count++; - } - } - service_add_extra_data_array(svc, "result", (const char**)result_array, ad->select_count*2); - ug_send_result(ad->ug, svc); - - service_destroy(svc); - } - /* Send destroy request */ - ug_destroy_me(ad->ug); -} - -static void setting_livebox_main_sk_cancel_cb(void *data, Evas_Object *obj, void *event_info) -{ - SETTING_TRACE_BEGIN; - /* error check */ - ret_if(data == NULL); - - SettingLiveboxUG *ad = (SettingLiveboxUG *)data; - /* Send destroy request */ - ug_destroy_me(ad->ug); -} - -static void __searchbar_changed_cb(void *data, Evas_Object *obj, void *event_info) -{ - SETTING_TRACE_BEGIN; - setting_retm_if(data == NULL, "Data parameter is NULL"); -#if DISABLED_CODE - SettingLiveboxUG *ad = (SettingLiveboxUG *)data; - - setting_searchbar_redraw(ad, ad->search_bar, NULL/*ad->search_text*/, - &(ad->search_idler), - NULL); //__region_genlist_update); -#endif -} - -static void __create_navibar(void *data, Evas_Object *content, Evas_Object *navibar, Evas_Object *controlbar) -{ - SETTING_TRACE_BEGIN; - ret_if(data == NULL || content == NULL || navibar == NULL); - - SettingLiveboxUG *ad = (SettingLiveboxUG *)data; - - setting_create_navi_bar_buttons("Customize setting Livebox", - "Done", "Cancel", NULL, - setting_livebox_main_sk_done_cb, - setting_livebox_main_sk_cancel_cb, - NULL, - ad, content, navibar, controlbar); -} - -static int __create_frame(void *data) -{ - SETTING_TRACE_BEGIN; - retv_if(data == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER); - - SettingLiveboxUG *ad = (SettingLiveboxUG *)data; - Evas_Object *navi_bar = NULL; - Evas_Object *control_bar = NULL; - - Evas_Object *content_list = elm_genlist_add(ad->win_main_layout); - elm_object_style_set(content_list, "dialogue"); - if(content_list == NULL) - return SETTING_RETURN_FAIL; - - elm_genlist_clear(content_list); /* first to clear list */ - elm_genlist_mode_set(content_list, ELM_LIST_COMPRESS); - - ad->ly_main = setting_create_win_layout(ad->win_main_layout, ad->win_get); - retv_if(!ad->ly_main, SETTING_RETURN_FAIL); - - navi_bar = setting_create_navi_bar(ad->ly_main); - retv_if(!navi_bar, SETTING_RETURN_FAIL); - Evas_Object *sub_layout = elm_layout_add(navi_bar); - elm_layout_theme_set(sub_layout, "layout", "application", "searchbar_base"); - elm_object_signal_emit(sub_layout, "elm,state,show,searchbar", "elm"); - elm_object_part_content_set(sub_layout, "elm.swallow.content", content_list); - - ad->search_bar = setting_create_searchbar(ad, sub_layout, __searchbar_changed_cb, NULL); - - control_bar = elm_toolbar_add(navi_bar); - setting_retvm_if(control_bar == NULL, -1, "controlbar == NULL"); - elm_toolbar_shrink_mode_set(control_bar, ELM_TOOLBAR_SHRINK_EXPAND); - - __create_navibar(ad, sub_layout, navi_bar, control_bar); - - ad->navi_bar = navi_bar; - ad->navi_it = elm_naviframe_top_item_get(ad->navi_bar); - ad->sub_layout = sub_layout; - ad->scroller = content_list; - - return SETTING_RETURN_SUCCESS; -} - -static void -setting_livebox_main_mouse_up_Gendial_list_cb(void *data, Evas_Object *obj, void *event_info) -{ - SETTING_TRACE_BEGIN; - - if(data == NULL) - return; - retm_if(event_info == NULL, "Invalid argument: event info is NULL"); - - SettingLiveboxUG *ad = (SettingLiveboxUG*)data; - Elm_Object_Item *item = (Elm_Object_Item *) event_info; - elm_genlist_item_selected_set(item, 0); - - Setting_GenGroupItem_Data *list_item = - (Setting_GenGroupItem_Data *) elm_object_item_data_get(item); - - SETTING_TRACE_DEBUG("%s selected", list_item->keyStr); - - int current_status = elm_check_state_get(list_item->eo_check); - - if((current_status == 0) && (ad->select_count < MAX_SELECTION_NUM)) - { - elm_check_state_set(list_item->eo_check, 1); - list_item->chk_status = 1; - ad->select_count++; - // show selection Info : "selected %u items" - } - else if(current_status == 0) - { - // show popup : "be over the count, 4" - } - else if((current_status == 1) && (ad->select_count > 0)) - { - elm_check_state_set(list_item->eo_check, 0); - list_item->chk_status = 0; - ad->select_count--; - } - else - { - // nothing to be selected. - } - SETTING_TRACE_DEBUG("select_count : %u", ad->select_count); -} - -static void -setting_livebox_main_chk_btn_cb(void *data, Evas_Object *obj, void *event_info) -{ - SETTING_TRACE_BEGIN; - - if(data == NULL) - return; - - Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *) data; - SettingLiveboxUG *ad = list_item->userdata; - - list_item->chk_status = elm_check_state_get(obj); /* for genlist update status */ - - if((list_item->chk_status == 1) && (ad->select_count < MAX_SELECTION_NUM)) - { - ad->select_count++; - // show selection Info : "selected %u items" - } - else if(list_item->chk_status == 1) - { - // recover status of checkbox - // And show popup : "be over the count, 4" - elm_check_state_set(obj, 0); - list_item->chk_status = elm_check_state_get(obj); - } - else if((list_item->chk_status == 0) && (ad->select_count > 0)) - { - ad->select_count--; - } - else - { - // nothing to be selected. - } - SETTING_TRACE_DEBUG("select_count : %u", ad->select_count); -} - -void setting_livebox_add_genlist_items(void *data) -{ - SETTING_TRACE_BEGIN; - if(data == NULL) - return; - - SettingLiveboxUG *ad = (SettingLiveboxUG*)data; - - int i = 0; - int j = 0; - int cnt = 0; - char *keyStr = NULL; - char *icon_path = NULL; - - // itc_sel_all - - for (i = 0; i < setting_cfg_get_category_length(); i++) - { - SETTING_TRACE_DEBUG("category name : %s", setting_cfg_get_category_name(i)); - if (safeStrCmp(setting_cfg_get_category_name(i), KeyStr_Connectivity) == 0) - { - (void)setting_create_Gendial_field_titleItem(ad->scroller, - &(itc_group_item), - KeyStr_Connectivity, NULL); - - for (j = 0; j < setting_cfg_get_menu_length(i); j++) - { - keyStr = setting_cfg_get_keyname_idx(i, j); - SETTING_TRACE_DEBUG("menu name : [%d] %s", j, keyStr); - icon_path = setting_cfg_get_icon_path_idx(i, j); - - ad->item[cnt] = setting_create_Gendial_field_def(ad->scroller, &(itc_1text_1icon_2), - setting_livebox_main_mouse_up_Gendial_list_cb, NULL, - SWALLOW_Type_1CHECKICON, - NULL, icon_path, 0, keyStr, NULL, - setting_livebox_main_chk_btn_cb); - if(ad->item[cnt]) - ad->item[cnt++]->userdata = ad; - } - continue; - } - else if (safeStrCmp(setting_cfg_get_category_name(i), KeyStr_System) == 0) - { - (void)setting_create_Gendial_field_titleItem(ad->scroller, - &(itc_group_item), - KeyStr_System, NULL); - for (j = 0; j < setting_cfg_get_menu_length(i); j++) - { - keyStr = setting_cfg_get_keyname_idx(i, j); - SETTING_TRACE_DEBUG("menu name : [%d] %s", j, keyStr); - icon_path = setting_cfg_get_icon_path_idx(i, j); - - ad->item[cnt] = setting_create_Gendial_field_def(ad->scroller, &(itc_1text_1icon_2), - setting_livebox_main_mouse_up_Gendial_list_cb, NULL, - SWALLOW_Type_1CHECKICON, - NULL, icon_path, 0, keyStr, NULL, - setting_livebox_main_chk_btn_cb); - ad->item[cnt++]->userdata = ad; - } - continue; - } - else if (safeStrCmp(setting_cfg_get_category_name(i), KeyStr_Applications) == 0) - { - (void)setting_create_Gendial_field_titleItem(ad->scroller, - &(itc_group_item), - KeyStr_Applications, NULL); - for (j = 0; j < setting_cfg_get_menu_length(i); j++) - { - keyStr = setting_cfg_get_keyname_idx(i, j); - SETTING_TRACE_DEBUG("menu name : [%d] %s", j, keyStr); - icon_path = setting_cfg_get_icon_path_idx(i, j); - - ad->item[cnt] = setting_create_Gendial_field_def(ad->scroller, &(itc_1text_1icon_2), - setting_livebox_main_mouse_up_Gendial_list_cb, NULL, - SWALLOW_Type_1CHECKICON, - NULL, icon_path, 0, keyStr, NULL, - setting_livebox_main_chk_btn_cb); - ad->item[cnt++]->userdata = ad; - } - continue; - } - else if (safeStrCmp(setting_cfg_get_category_name(i), KeyStr_DownloadedAPPs) == 0) - { - (void)setting_create_Gendial_field_titleItem(ad->scroller, - &(itc_group_item), - KeyStr_DownloadedAPPs, NULL); - for (j = 0; j < setting_cfg_get_menu_length(i); j++) - { - keyStr = setting_cfg_get_keyname_idx(i, j); - SETTING_TRACE_DEBUG("menu name : [%d] %s", j, keyStr); - icon_path = setting_cfg_get_icon_path_idx(i, j); - - ad->item[cnt] = setting_create_Gendial_field_def(ad->scroller, &(itc_1text_1icon_2), - setting_livebox_main_mouse_up_Gendial_list_cb, NULL, - SWALLOW_Type_1CHECKICON, - NULL, icon_path, 0, keyStr, NULL, - setting_livebox_main_chk_btn_cb); - ad->item[cnt++]->userdata = ad; - } - continue; - } - } - ad->menu_count = cnt; - SETTING_TRACE_DEBUG("total : %u menues ", ad->menu_count); -} - -static int -setting_livebox_main_create(void *cb) -{ - SETTING_TRACE_BEGIN; - /* error check */ - retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER); - - SettingLiveboxUG *ad = (SettingLiveboxUG *) cb; - int ret = 0; - - ret = __create_frame(ad); - - if(ret < 0) - return SETTING_RETURN_FAIL; - - setting_livebox_add_genlist_items(ad); - - setting_view_livebox_main.is_create = 1; - SETTING_TRACE_END; - return SETTING_RETURN_SUCCESS; -} - -static int setting_livebox_main_destroy(void *cb) -{ - /* error check */ - retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER); - - SettingLiveboxUG *ad = (SettingLiveboxUG *) cb; - - if (ad->ly_main != NULL) { - evas_object_del(ad->ly_main); - ad->ly_main = NULL; - setting_view_livebox_main.is_create = 0; - } - return SETTING_RETURN_SUCCESS; -} - -static int setting_livebox_main_update(void *cb) -{ - /* error check */ - retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER); - - SettingLiveboxUG *ad = (SettingLiveboxUG *) cb; - - if (ad->ly_main != NULL) { - evas_object_show(ad->ly_main); - } - - return SETTING_RETURN_SUCCESS; -} - -static int setting_livebox_main_cleanup(void *cb) -{ - /* error check */ - retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER); - - SettingLiveboxUG *ad = (SettingLiveboxUG *) cb; - - if (ad->ly_main != NULL) { - evas_object_hide(ad->ly_main); - } - - return SETTING_RETURN_SUCCESS; -} diff --git a/setting-livebox/src/setting-livebox.c b/setting-livebox/src/setting-livebox.c deleted file mode 100755 index f060ce8..0000000 --- a/setting-livebox/src/setting-livebox.c +++ /dev/null @@ -1,169 +0,0 @@ -/* - * setting - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. - * - * Contact: MyoungJune Park - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -#include - -#ifndef UG_MODULE_API -#define UG_MODULE_API __attribute__ ((visibility("default"))) -#endif - - -static void setting_livebox_ug_cb_resize(void *data, Evas *e, Evas_Object *obj, void *event_info) -{ - SettingLiveboxUG *ad = (SettingLiveboxUG *) data; - setting_view_update(&setting_view_livebox_main, ad); -} - -static void *setting_livebox_ug_on_create(ui_gadget_h ug, - enum ug_mode mode, service_h service, - void *priv) -{ - SETTING_TRACE_BEGIN; - setting_retvm_if((!priv), NULL, "!priv"); - - SettingLiveboxUG *liveboxUG = (SettingLiveboxUG *)priv; - liveboxUG->ug = ug; - liveboxUG->win_main_layout = (Evas_Object *) ug_get_parent_layout(ug); - liveboxUG->win_get = (Evas_Object *) ug_get_window(); - evas_object_show(liveboxUG->win_main_layout); - liveboxUG->evas = evas_object_evas_get(liveboxUG->win_main_layout); - - setting_retvm_if(liveboxUG->win_main_layout == NULL, NULL, - "cannot get main window "); - - /* --------------------------------------------------------- */ - /* set launguage */ - appcore_set_i18n(SETTING_PACKAGE, SETTING_LOCALEDIR); - /* --------------------------------------------------------- */ - int ret = setting_cfg_init(); - if(ret != 0) - SETTING_TRACE_DEBUG("cfg_init failed. %d", ret); - - /* creating a view. */ - setting_view_create(&setting_view_livebox_main,(void *)liveboxUG); - evas_object_event_callback_add(liveboxUG->win_main_layout, - EVAS_CALLBACK_RESIZE, - setting_livebox_ug_cb_resize, - liveboxUG); - return liveboxUG->ly_main; -} - -static void setting_livebox_ug_on_start(ui_gadget_h ug, service_h service, void *priv) -{ -} - -static void setting_livebox_ug_on_pause(ui_gadget_h ug, service_h service, void *priv) -{ -} - -static void setting_livebox_ug_on_resume(ui_gadget_h ug, service_h service, void *priv) -{ -} - -static void setting_livebox_ug_on_destroy(ui_gadget_h ug, service_h service, void *priv) -{ - SettingLiveboxUG *liveboxUG = (SettingLiveboxUG *)priv; - - evas_object_event_callback_del(liveboxUG->win_main_layout, EVAS_CALLBACK_RESIZE, setting_livebox_ug_cb_resize); /* fix flash issue for gallery */ - liveboxUG->ug = ug; - - /* delete the allocated objects. */ - setting_view_destroy(&setting_view_livebox_main, liveboxUG); - if (NULL != ug_get_layout(liveboxUG->ug)) { - evas_object_hide((Evas_Object *) ug_get_layout(liveboxUG->ug)); - evas_object_del((Evas_Object *) ug_get_layout(liveboxUG->ug)); - } -} - -static void setting_livebox_ug_on_message(ui_gadget_h ug, service_h msg, service_h service, void *priv) -{ - -} - -static void setting_livebox_ug_on_event(ui_gadget_h ug, - enum ug_event event, service_h service, - void *priv) -{ - switch (event) { - case UG_EVENT_LOW_MEMORY: - break; - case UG_EVENT_LOW_BATTERY: - break; - case UG_EVENT_LANG_CHANGE: - break; - case UG_EVENT_ROTATE_PORTRAIT: - break; - case UG_EVENT_ROTATE_PORTRAIT_UPSIDEDOWN: - break; - case UG_EVENT_ROTATE_LANDSCAPE: - break; - case UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN: - break; - case UG_EVENT_REGION_CHANGE: - break; - default: - break; - } -} - -static void setting_livebox_ug_on_key_event(ui_gadget_h ug, - enum ug_key_event event, - service_h service, void *priv) -{ - if (!ug || !priv) - return; - - switch (event) { - case UG_KEY_EVENT_END: - ug_destroy_me(ug); - break; - default: - break; - } -} - -UG_MODULE_API int UG_MODULE_INIT(struct ug_module_ops *ops) -{ - SettingLiveboxUG *liveboxUG = calloc(1, sizeof(SettingLiveboxUG)); - setting_retvm_if(!liveboxUG, -1, "Create SettingPasswordUG obj failed"); - - ops->create = setting_livebox_ug_on_create; - ops->start = setting_livebox_ug_on_start; - ops->pause = setting_livebox_ug_on_pause; - ops->resume = setting_livebox_ug_on_resume; - ops->destroy = setting_livebox_ug_on_destroy; - ops->message = setting_livebox_ug_on_message; - ops->event = setting_livebox_ug_on_event; - ops->key_event = setting_livebox_ug_on_key_event; - ops->priv = liveboxUG; - ops->opt = UG_OPT_INDICATOR_ENABLE; - - return 0; -} - -UG_MODULE_API void UG_MODULE_EXIT(struct ug_module_ops *ops) -{ - struct SettingLiveboxUG *liveboxUG; - setting_retm_if(!ops, "ops == NULL"); - - liveboxUG = ops->priv; - if (liveboxUG) - FREE(liveboxUG); -} diff --git a/setting-security/CMakeLists.txt b/setting-security/CMakeLists.txt index c96ecf5..5d8c5f4 100755 --- a/setting-security/CMakeLists.txt +++ b/setting-security/CMakeLists.txt @@ -4,7 +4,7 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/${SETTING_COMMON}/include) INCLUDE(FindPkgConfig) pkg_check_modules(pkgs_security REQUIRED ecore evas elementary tapi dlog -ui-gadget-1 capi-appfw-application appcore-common security-server) +ui-gadget-1 capi-appfw-application appcore-common) FOREACH(flag ${pkgs_security_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") @@ -26,8 +26,6 @@ SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib") ADD_LIBRARY(${SETTING_SECURITY_UG} SHARED ./src/setting-security.c ./src/setting-security-main.c - ./src/setting-security-encryption.c - ./src/setting-security-screen-lock-type.c ./src/setting-security-sim-settings.c ) diff --git a/setting-security/include/setting-security-encryption.h b/setting-security/include/setting-security-encryption.h deleted file mode 100755 index 5cd074c..0000000 --- a/setting-security/include/setting-security-encryption.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * setting - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. - * - * Contact: MyoungJune Park - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -#ifndef __SETTING_SECURITY_ENCRYPTION_H__ -#define __SETTING_SECURITY_ENCRYPTION_H__ - -#include - - -#define Keystr_DeviceEncryption "IDS_ASEML_BODY_DEVICE_ENCRYPTION" - -static void -setting_security_encryption_click_softkey_back_cb(void *data, Evas_Object *obj, - void *event_info); -#endif diff --git a/setting-security/include/setting-security-screen-lock-type.h b/setting-security/include/setting-security-screen-lock-type.h deleted file mode 100755 index 4ddb7b5..0000000 --- a/setting-security/include/setting-security-screen-lock-type.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * setting - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. - * - * Contact: MyoungJune Park - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -#ifndef __SETTING_SECURITY_SCREEN_LOCK_TYPE_H__ -#define __SETTING_SECURITY_SCREEN_LOCK_TYPE_H__ - -#include - -static int setting_security_screen_lock_type_create(void *cb); - -static void -setting_security_screen_lock_type_click_softkey_back_cb(void *data, Evas_Object *obj, void *event_info); -static void -setting_security_screen_lock_type_mouse_up_Gendial_list_cb(void *data, Evas_Object *obj, void *event_info); - -#endif diff --git a/setting-security/include/setting-security.h b/setting-security/include/setting-security.h index aa0e1c7..a33f7da 100755 --- a/setting-security/include/setting-security.h +++ b/setting-security/include/setting-security.h @@ -37,30 +37,9 @@ #include #include #include -#ifdef SUPPORT_MDM -#include -#endif - -#define Keystr_FDN "IDS_ST_BODY_FIXED_DIALLING_MODE" - -#if SUPPORT_ENCRYPTION -#define keystr_DeviceDecryption "Device decryption" -#define DEVICE_ENCRYPTION_DESC "IDS_ST_BODY_PASSWORD_REQUIRED_TO_DECRYPT_DEVICE_EACH_TIME_YOU_TURN_IT_ON" -#define DEVICE_DECRYPTION_DESC "IDS_ST_BODY_DEVICE_ENCRYPTED" - -#define Keystr_ConfirmEncryption "Confirm encryption" -#define Keystr_ConfirmDecryption "Confirm decryption" -#endif #define USELESS_SIM_CARD "Not useful SIM card" -#if SUPPORT_SCREEN_SECURITY -#define Keystr_ScreenLockType "IDS_ST_BODY_SCREEN_LOCK_TYPE" -#define Keystr_LockScreenOptions "IDS_ST_BODY_LOCK_SCREEN_OPTIONS" -#define Keystr_Swipe "IDS_ST_MBODY_SWIPE" -#define Keystr_FaceAndVoice "IDS_ST_BODY_FACE_AND_VOICE" -#endif - #if SUPPORT_PARENTAL_MODE #define Keystr_ParentalMode "Parental mode" #endif @@ -68,24 +47,17 @@ typedef struct _SettingSecurityUG SettingSecurityUG; typedef enum { - SETTING_SEC_PW_PASSWORD, - SETTING_SEC_PW_SIMPLE_PASSWD, - SETTING_SEC_PW_CHANGE_PASSWD, - SETTING_SEC_PW_CHANGE_SIMPLE_PASSWD, - SETTING_SEC_PW_ENTER_LOCK_TYPE, SETTING_SEC_PW_SIM_LOCK_ON, SETTING_SEC_PW_SIM_LOCK_OFF, SETTING_SEC_PW_SIM_LOCK_DISABLED, SETTING_SEC_PW_PIN_LOCK_ON, SETTING_SEC_PW_PIN_LOCK_OFF, SETTING_SEC_PW_CHANGE_PIN1, -#if SUPPORT_FDN - SETTING_SEC_PW_FDN_MODE_ON, - SETTING_SEC_PW_FDN_MODE_OFF, -#endif SETTING_SEC_PW_CHANGE_PIN2, SETTING_SEC_PW_PIN1_BLOCKED, SETTING_SEC_PW_PIN2_BLOCKED, + SETTING_SEC_PW_PIN1_UNBLOCKED, + SETTING_SEC_PW_PIN2_UNBLOCKED, SETTING_SEC_PW_MAX } setting_sec_pw_type; @@ -116,53 +88,19 @@ struct _SettingSecurityUG { Evas_Object *ly_main; Evas_Object *navi_bar; ui_gadget_h ug_passwd; - ui_gadget_h ug_mt; - Setting_GenGroupItem_Data *data_phone_lk; - Setting_GenGroupItem_Data *data_mb; Setting_GenGroupItem_Data *data_sim_lk; Setting_GenGroupItem_Data *data_pin_lk; - Setting_GenGroupItem_Data *data_parental_md; - Setting_GenGroupItem_Data *data_simple_pw; Setting_GenGroupItem_Data *data_change_pin1; /* for simple password */ - Setting_GenGroupItem_Data *data_cng_pw; -#if SUPPORT_ENCRYPTION - Setting_GenGroupItem_Data *data_device_enc; - Setting_GenGroupItem_Data *data_mmc_enc; -#endif Elm_Genlist_Item_Class itc_1text; Elm_Genlist_Item_Class itc_1text_1icon; Elm_Genlist_Item_Class itc_seperator; Elm_Genlist_Item_Class itc_2text_2; - -#if SUPPORT_FDN - Setting_GenGroupItem_Data *data_fdn; - Evas_Object *chk_fdn; -#endif - setting_sec_pw_type pw_type; -#ifdef SUPPORT_MDM - mdm_data_t *mdm_data; - mdm_password_policy_t *mdm_policy; - mdm_result_t mdm_status; - policy_receiver_handle mdm_handle; - - Ecore_Pipe *pipe; - pid_t child_pid; -#endif - -#if SUPPORT_SCREEN_SECURITY - Setting_GenGroupItem_Data *data_screen_lock_type; - Evas_Object *lock_type_rd; - Setting_GenGroupItem_Data *data_sl_simple_pw; - Setting_GenGroupItem_Data *data_sl_pw; - ui_gadget_h ug_lockscreen; -#endif - char *input_pwd; int sel_item; /**< It's used to check PIN1, PIN2 _BLOCKED. 0:click pin lock, 1:change pin1 code, 2:fdn, 3: change pin2 code */ @@ -170,34 +108,15 @@ struct _SettingSecurityUG { }; extern setting_view setting_view_security_main; -extern setting_view setting_view_security_encryption; -extern setting_view setting_view_security_screen_lock_type; extern setting_view setting_view_security_sim_settings; SettingSecurityUG *g_ad; /* for tapi callback */ -char *get_screen_lock_type_str(void * priv); char *get_find_my_mobile_on_off_str(void *priv); void setting_security_result_password_ug_cb(ui_gadget_h ug, service_h service, void *priv); void setting_security_sim_get_facility_cb(TapiHandle *handle, int result, void *data, void *user_data); gboolean setting_security_create_password_sg(void *data); -void setting_security_create_find_my_mobile_sg(void *cb, int argc, char **argv); -void setting_security_destroy_find_my_mobile_ug_cb(ui_gadget_h ug, - void *priv); - -#ifdef TEST_MDM -void setting_security_destroy_password_ug_cb(ui_gadget_h ug, - void *priv); -void setting_security_layout_passwd_ug_cb(ui_gadget_h ug, - enum ug_mode mode, void *priv); -#endif - -#ifdef SUPPORT_MDM -void setting_security_disable_items_for_mdm(void *data); -#endif - -gboolean setting_security_create_lockscreen_options_sg(void *data); #endif diff --git a/setting-security/src/setting-security-encryption.c b/setting-security/src/setting-security-encryption.c deleted file mode 100755 index adcdedc..0000000 --- a/setting-security/src/setting-security-encryption.c +++ /dev/null @@ -1,128 +0,0 @@ -/* - * setting - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. - * - * Contact: MyoungJune Park - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -#include -#include -#include - -#include -#include - -static int setting_security_encryption_create(void *cb); -static int setting_security_encryption_destroy(void *cb); -static int setting_security_encryption_update(void *cb); -static int setting_security_encryption_cleanup(void *cb); - -setting_view setting_view_security_encryption = { - .create = setting_security_encryption_create, - .destroy = setting_security_encryption_destroy, - .update = setting_security_encryption_update, - .cleanup = setting_security_encryption_cleanup, -}; - -/* *************************************************** - ** - **basic func - ** - ****************************************************/ - -static int setting_security_encryption_create(void *cb) -{ - retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER); - - SettingSecurityUG *ad = (SettingSecurityUG *) cb; - - Evas_Object *scroller; - - /* add basic layout */ - char setBtnStr[MAX_DISPLAY_NAME_LEN_ON_UI]; - snprintf(setBtnStr, sizeof(setBtnStr), "%s", - (char *)dgettext("sys_string", "IDS_COM_BODY_BACK")); - - /* there are 2 titles, Device encryption or Device decryption */ - setting_push_layout_navi_bar_genlist(ad->win_main_layout, - ad->win_get, - Keystr_DeviceEncryption, - setBtnStr, NULL, - setting_security_encryption_click_softkey_back_cb, - NULL, ad, &scroller, - ad->navi_bar); - - (void)setting_create_Gendial_field_titleItem(scroller, - &itc_group_item, - "IDS_ST_HEADER_SCREEN_SECURITY", NULL); - /* To do : Fill this view */ - - /* update info */ - - setting_view_security_encryption.is_create = 1; - - return SETTING_RETURN_SUCCESS; - -} - -static int setting_security_encryption_destroy(void *cb) -{ - /* error check */ - retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER); - - SettingSecurityUG *ad = (SettingSecurityUG *) cb; - - elm_naviframe_item_pop(ad->navi_bar); - - setting_view_security_encryption.is_create = 0; - - return SETTING_RETURN_SUCCESS; -} - -static int setting_security_encryption_update(void *cb) -{ - /* error check */ - retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER); - - return SETTING_RETURN_SUCCESS; -} - -static int setting_security_encryption_cleanup(void *cb) -{ - /* error check */ - retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER); - - setting_security_encryption_destroy(cb); - - return SETTING_RETURN_SUCCESS; -} - -/* *************************************************** - ** - **call back func - ** - ****************************************************/ -static void -setting_security_encryption_click_softkey_back_cb(void *data, Evas_Object *obj, - void *event_info) -{ - /* error check */ - retm_if(data == NULL, "[Setting > Security] Data parameter is NULL"); - - SettingSecurityUG *ad = (SettingSecurityUG *) data; - - setting_view_change(&setting_view_security_encryption, &setting_view_security_main, ad); -} diff --git a/setting-security/src/setting-security-main.c b/setting-security/src/setting-security-main.c index 94609d9..bd33522 100755 --- a/setting-security/src/setting-security-main.c +++ b/setting-security/src/setting-security-main.c @@ -94,111 +94,6 @@ static int setting_security_main_create(void *cb) Elm_Object_Item *item = NULL; - (void)setting_create_Gendial_field_titleItem(scroller, - &itc_group_item, - "IDS_ST_HEADER_SCREEN_SECURITY", NULL); - -#if SUPPORT_SCREEN_SECURITY - /* a. screen lock type */ - ad->data_screen_lock_type = setting_create_Gendial_field_def(scroller, &(ad->itc_2text_2), - setting_security_main_mouse_up_Gendial_list_cb,ad, - SWALLOW_Type_INVALID, - NULL, NULL, - 0, Keystr_ScreenLockType, get_screen_lock_type_str(ad), NULL); - if(ad->data_screen_lock_type) - ad->data_screen_lock_type->userdata = ad; - - /* b. lock screen options */ - setting_create_Gendial_field_def(scroller, &(ad->itc_1text), - setting_security_main_mouse_up_Gendial_list_cb,ad, - SWALLOW_Type_INVALID, - NULL, NULL, - 0, Keystr_LockScreenOptions, NULL, NULL); -#else - setting_get_bool_slp_key(BOOL_SLP_SETTING_POWER_ON_LOCK, &value, &err); - - /* a. phone lock */ - ad->data_phone_lk = setting_create_Gendial_field_def(scroller, &(ad->itc_1text_1icon), - setting_security_main_mouse_up_Gendial_list_cb, ad, - SWALLOW_Type_1TOGGLE, - NULL, NULL, - value,"IDS_ST_BODY_PHONE_LOCK", NULL, setting_security_main_chk_btn_cb); - if(ad->data_phone_lk) - ad->data_phone_lk->userdata = ad; - else { - SETTING_TRACE_ERROR("ad->data_phone_lk is null"); - return SETTING_RETURN_FAIL; - } - setting_security_main_update_view(ad, "IDS_ST_BODY_PHONE_LOCK"); - - /* c. change password */ - ad->data_cng_pw = setting_create_Gendial_field_def(scroller, &(ad->itc_1text), - setting_security_main_mouse_up_Gendial_list_cb,ad, - SWALLOW_Type_INVALID, - NULL, NULL, - 0,"IDS_COM_POP_CHANGE_PASSWORD", NULL, NULL); - - setting_get_bool_slp_key(BOOL_SLP_SETTING_SIMPLE_PASSWORD, &value, &err); - /* d. simple password */ - ad->data_simple_pw= setting_create_Gendial_field_def(scroller, &(ad->itc_1text_1icon), - setting_security_main_mouse_up_Gendial_list_cb, ad, - SWALLOW_Type_1TOGGLE, - NULL, NULL, - value, "IDS_ST_BODY_SIMPLE_PASSWORD", NULL, setting_security_main_chk_btn_cb); - if(ad->data_simple_pw) - ad->data_simple_pw->userdata = ad; - else { - SETTING_TRACE_ERROR("ad->data_simple_pw is null"); - return SETTING_RETURN_FAIL; - } -#ifdef SUPPORT_MDM - /* @ for MDM test @ */ -#ifdef TEST_MDM - setting_create_Gendial_field_def(scroller, &(ad->itc_1text), - setting_security_main_mouse_up_Gendial_list_cb,ad, - SWALLOW_Type_INVALID, - NULL, NULL, - 0,"MDM test", NULL, NULL); -#endif - setting_security_disable_items_for_mdm(ad); -#endif -#endif - - (void)setting_create_Gendial_field_titleItem(scroller, - &itc_group_item, - "Phone security", NULL); - -#if SUPPORT_PARENTAL_MODE /* TBD */ - /* b. parental mode */ - ad->data_parental_md = setting_create_Gendial_field_def(scroller, &(ad->itc_2text_2), - setting_security_main_mouse_up_Gendial_list_cb, ad, - SWALLOW_Type_INVALID, - NULL, NULL, - 0,Keystr_ParentalMode, "Off"/*get_parental_mode_on_off_str(ad)*/, NULL); - ad->data_parental_md->userdata = ad; - - /* separator */ - item = elm_genlist_item_append(scroller, &(ad->itc_seperator), NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL); - elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY); -#endif - - /* check whether binary is slp or not, for mobile tracker */ - if(! is_slp_binary()) - { - /* e. find my mobile */ - ad->data_mb = setting_create_Gendial_field_def(scroller, &(ad->itc_2text_2), - setting_security_main_mouse_up_Gendial_list_cb, ad, - SWALLOW_Type_INVALID, - NULL, NULL, - 0,"IDS_ST_HEADER2_FIND_MY_MOBILE", get_find_my_mobile_on_off_str(ad), NULL); - if(ad->data_mb) - ad->data_mb->userdata = ad; - else { - SETTING_TRACE_ERROR("ad->data_mb is null"); - return SETTING_RETURN_FAIL; - } - } - /* SIM settings */ if(ad->handle && !isEmulBin()) { @@ -220,34 +115,6 @@ static int setting_security_main_create(void *cb) } } -#if SUPPORT_ENCRYPTION - /* separator */ - item = elm_genlist_item_append(scroller, &(ad->itc_seperator), NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL); - elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY); - - /* device encryption */ - ad->data_device_enc = setting_create_Gendial_field_def(scroller, &(ad->itc_1text_1icon), - setting_security_main_mouse_up_Gendial_list_cb, ad, - SWALLOW_Type_INVALID, - NULL, NULL, - value,"IDS_ASEML_BODY_DEVICE_ENCRYPTION", NULL, NULL); - - /* To do : add description of device encryption */ - setting_create_Gendial_field_def(scroller, &(itc_multiline_text), - NULL, ad, - SWALLOW_Type_LAYOUT_SPECIALIZTION_X, - NULL, NULL, 0, DEVICE_ENCRYPTION_DESC, NULL, NULL); - elm_genlist_item_select_mode_set(elm_genlist_item_append(scroller, &(itc_seperator), NULL, NULL,ELM_GENLIST_ITEM_NONE, NULL, NULL), - ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY); -#if DISABLED_CODE - /* mmc encryption */ - ad->data_mmc_enc = setting_create_Gendial_field_def(scroller, &(ad->itc_1text_1icon), - setting_security_main_mouse_up_Gendial_list_cb, ad, - SWALLOW_Type_1TOGGLE, - NULL, NULL, - value,"IDS_ASEML_BODY_MMC_ENCRYPTION", NULL, setting_security_main_chk_btn_cb); -#endif -#endif /* update info */ setting_view_security_main.is_create = 1; @@ -256,12 +123,6 @@ static int setting_security_main_create(void *cb) retv_if(!g_ad, -1); memcpy(g_ad, ad, sizeof(SettingSecurityUG)); - vconf_notify_key_changed(VCONFKEY_SETAPPL_PHONE_LOCK_ATTEMPTS_LEFT_INT, - setting_security_main_vconf_change_cb, ad); - vconf_notify_key_changed(VCONFKEY_SETAPPL_SCREEN_LOCK_TYPE_INT, - setting_security_main_vconf_change_cb, ad); - - setting_security_main_check_vconf_value(ad); SETTING_TRACE_END; return SETTING_RETURN_SUCCESS; } @@ -279,10 +140,6 @@ static int setting_security_main_destroy(void *cb) ad->update_view_timer = NULL; } - vconf_ignore_key_changed(VCONFKEY_SETAPPL_PHONE_LOCK_ATTEMPTS_LEFT_INT, - setting_security_main_vconf_change_cb); - vconf_ignore_key_changed(VCONFKEY_SETAPPL_SCREEN_LOCK_TYPE_INT, - setting_security_main_vconf_change_cb); if (ad->ly_main != NULL) { evas_object_del(ad->ly_main); @@ -375,117 +232,6 @@ int _handle_sim_exception(void *data, int sim_status) return SETTING_RETURN_SUCCESS; } -#if SUPPORT_FDN -void _draw_fdn_onoff_status(void *data, Evas_Object *check) -{ - SETTING_TRACE_BEGIN; //("Fixed Dialing Number"); - - ret_if(data == NULL); - - SettingSecurityUG *ad = (SettingSecurityUG *) data; - int value = 0; - int err = 0; - int ret = 0; - - ad->sel_item = 2; - - ret = setting_get_int_slp_key(INT_SLP_SETTING_SIM_SLOT, &value, &err); - - ret = _handle_sim_exception(ad, value); - if(ret == SETTING_RETURN_FAIL) - return; - - int old_state = elm_check_state_get(check); - if (old_state) { - SETTING_TRACE("Current status of SIM Lock is ON"); - ad->pw_type = SETTING_SEC_PW_FDN_MODE_OFF; - setting_security_create_password_sg(ad); - } else { - SETTING_TRACE("Current status of SIM Lock is OFF"); - ad->pw_type = SETTING_SEC_PW_FDN_MODE_ON; - setting_security_create_password_sg(ad); - } -} -#endif - -#if DISABLED_CODE -/* Check Btn Call Back : Phone Lock, SIm Lock, PIN Lock, FDN, */ -static void -setting_security_main_chk_btn_cb(void *data, Evas_Object *obj, - void *event_info) -{ - SETTING_TRACE_BEGIN; - /* error check */ - retm_if(data == NULL, "[Setting > Reset] Data parameter is NULL"); - Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *) data; - SettingSecurityUG *ad = list_item->userdata; - - list_item->chk_status = elm_check_state_get(obj); /* for genlist update status */ - - // create password-ug - //setting_security_main_draw_onoff_status(ad, obj); - if (!safeStrCmp("IDS_ST_BODY_PHONE_LOCK", list_item->keyStr)) { - #if !SUPPORT_SCREEN_SECURITY - setting_check_onoff_status(list_item->eo_check, BOOL_SLP_SETTING_POWER_ON_LOCK); /* reset check state */ - ad->pw_type = SETTING_SEC_PW_PHONE_LOCK; - setting_security_create_password_sg(ad); - #endif - }else if (!safeStrCmp("IDS_ST_BODY_SIMPLE_PASSWORD", list_item->keyStr)) { - setting_check_onoff_status(list_item->eo_check, BOOL_SLP_SETTING_SIMPLE_PASSWORD); /* reset check state */ - ad->pw_type = SETTING_SEC_PW_SIMPLE_PASSWD; - setting_security_create_password_sg(ad); - - } -} -#endif - -#ifdef TEST_MDM -#define SETTING_MDM_TEST_MENU_NAME_STR 65 -/* @ for MDM test @ */ -gboolean setting_security_create_password_sg_for_mdm(void *data) -{ - /* error check */ - retv_if(data == NULL, FALSE); - - SettingSecurityUG *ad = (SettingSecurityUG *) data; /* ad is point to data */ - - if (ad->ug_passwd) { - SETTING_TRACE("Password UG is already loaded."); - return FALSE; - } - - char str[SETTING_MDM_TEST_MENU_NAME_STR] = { 0, }; - safeCopyStr(str, "SETTING_PW_TYPE_MDM_CHANGE_PASSWORD", SETTING_MDM_TEST_MENU_NAME_STR-1); - - struct ug_cbs *cbs = (struct ug_cbs *)calloc(1, sizeof(struct ug_cbs)); - - if (!cbs) - return FALSE; - cbs->layout_cb = setting_security_layout_passwd_ug_cb; - cbs->result_cb = setting_security_result_password_ug_cb; - cbs->destroy_cb = setting_security_destroy_password_ug_cb; - cbs->priv = (void *)ad; - - service_h svc; - if (service_create(&svc)) { - FREE(cbs); - return FALSE; - } - - service_add_extra_data(svc, "viewtype", str); - - ad->ug_passwd = ug_create(ad->ug, "setting-password-efl", UG_MODE_FULLVIEW, svc, cbs); - if (NULL == ad->ug_passwd) { /* error handling */ - evas_object_show(ad->ly_main); - } - - service_destroy(svc); - FREE(cbs); - - return TRUE; -} -#endif - static void setting_security_main_mouse_up_Gendial_list_cb(void *data, Evas_Object *obj, void *event_info) @@ -504,200 +250,7 @@ setting_security_main_mouse_up_Gendial_list_cb(void *data, Evas_Object *obj, SETTING_TRACE("clicking item[%s]", _(list_item->keyStr)); - if (!safeStrCmp("IDS_ST_HEADER2_FIND_MY_MOBILE", list_item->keyStr)) { - setting_security_create_find_my_mobile_sg(ad, 0, NULL); - } -#ifdef TEST_MDM - /* @ for MDM test @ */ - else if(!safeStrCmp("MDM test", list_item->keyStr)) { - setting_security_create_password_sg_for_mdm(ad); - } -#endif -#if SUPPORT_ENCRYPTION - else if(!safeStrCmp("IDS_ASEML_BODY_DEVICE_ENCRYPTION", list_item->keyStr)) - { - /* To do : create device encryption view */ - setting_create_simple_popup(NULL, ad->win_get, - NULL, "NOT IMPLEMENTED YET"); - } -#endif -#if SUPPORT_SCREEN_SECURITY - else if(!safeStrCmp(Keystr_ScreenLockType, list_item->keyStr)) { - /* To do : check current password, if spw or pw set. */ - int lock_type = SETTING_SCREEN_LOCK_TYPE_SWIPE; //elm_radio_value_get(ad->lock_type_rd); - vconf_get_int(VCONFKEY_SETAPPL_SCREEN_LOCK_TYPE_INT, &lock_type); - - if(lock_type == SETTING_SCREEN_LOCK_TYPE_PASSWORD - || lock_type == SETTING_SCREEN_LOCK_TYPE_SIMPLE_PASSWORD) - { - ad->pw_type = SETTING_SEC_PW_ENTER_LOCK_TYPE; - setting_security_create_password_sg(ad); - } - else - { - setting_view_change(&setting_view_security_main, &setting_view_security_screen_lock_type, ad); - } - } - else if(!safeStrCmp(Keystr_LockScreenOptions, list_item->keyStr)) { - setting_security_create_lockscreen_options_sg(ad); - } -#endif -#if SUPPORT_PARENTAL_MODE - else if(!safeStrCmp(Keystr_ParentalMode, list_item->keyStr)) { - /* to do : call parental mode ug */ - setting_create_simple_popup(NULL, ad->win_get, - NULL, "NOT IMPLEMENTED YET"); - } -#endif - else if(!safeStrCmp("SIM settings", list_item->keyStr)) { - setting_view_change(&setting_view_security_main, &setting_view_security_sim_settings, ad); - } -} - -#if DISABLED_CODE -static void setting_security_main_update_view(void *data, char *keyStr) -{ - SETTING_TRACE_BEGIN; - ret_if(!data); - SettingSecurityUG *ad = (SettingSecurityUG *) data; - - Elm_Object_Item *list_item = NULL; - setting_int_slp_list vconf_type_int; - setting_str_slp_list vconf_type_str; - int attemps_max = 5; - int block_seconds = 30; - - if (!safeStrCmp(keyStr, "IDS_ST_BODY_PHONE_LOCK")) { - vconf_type_int = INT_SLP_SETTING_PHONE_LOCK_ATTEMPTS_LEFT; - vconf_type_str = STR_SLP_SETTING_PHONE_LOCK_TIMESTAMP; - attemps_max = PHONE_LOCK_ATTEMPS_MAX; - block_seconds = PHONE_LOCK_BLOCK_SECONDS; - ret_if(!ad->data_phone_lk); - list_item = ad->data_phone_lk->item; - } else if (!safeStrCmp(keyStr, "IDS_ST_BODY_SIM_LOCK")) { - vconf_type_int = INT_SLP_SETTING_SIM_LOCK_ATTEMPTS_LEFT; - vconf_type_str = STR_SLP_SETTING_SIM_LOCK_TIMESTAMP; - attemps_max = SIM_LOCK_ATTEMPS_MAX; - block_seconds = SIM_LOCK_BLOCK_SECONDS; - ret_if(!ad->data_sim_lk); - list_item = ad->data_sim_lk->item; - } else { - return; - } - - int value = -1; - int err = SETTING_RETURN_SUCCESS; - setting_get_int_slp_key(vconf_type_int, &value, &err); - setting_retm_if(err == SETTING_RETURN_FAIL, - "[Error] get the value of vconf fail."); - - if (value == 0) { - char last_lock_timestamp[LOCK_TIMESTAMP_LEN] = { 0, }; - setting_get_string_slp_key(vconf_type_str, last_lock_timestamp, - &err); - setting_retm_if(err == SETTING_RETURN_FAIL, - "[Error] get the value of vconf fail."); - - if (!isEmptyStr(last_lock_timestamp)) { - time_t cur_time = time(NULL); - time_t last_lock_time; - errno = 0; - char* endptr = NULL; - last_lock_time = strtol(last_lock_timestamp, &endptr, 10); - setting_retm_if(errno == ERANGE, "strtol fail"); - - if ((cur_time - last_lock_time) < block_seconds) { - ret_if(elm_object_item_disabled_get(list_item)); - setting_disable_genlist_item(list_item); - } else { - setting_set_int_slp_key(vconf_type_int, - attemps_max, &err); - setting_retm_if(err == SETTING_RETURN_FAIL, - "[Error] set the value of vconf fail."); - - ret_if(!elm_object_item_disabled_get(list_item)); - setting_enable_genlist_item(list_item); - } - } - } -} - -static void setting_security_main_create_timer(void *data) -{ - SETTING_TRACE_BEGIN; - ret_if(!data); - SettingSecurityUG *ad = (SettingSecurityUG *) data; - - if (ad->update_view_timer) { - return; - } - ad->update_view_timer = ecore_timer_add(2, (Ecore_Task_Cb) - setting_security_main_timer_update_cb, - ad); -} - -static Eina_Bool setting_security_main_timer_update_cb(void *data) -{ - retv_if(!data, EINA_TRUE); - SettingSecurityUG *ad = (SettingSecurityUG *) data; - - //setting_security_main_update_view(ad, "IDS_ST_BODY_PHONE_LOCK"); - setting_security_main_update_view(ad, "IDS_ST_BODY_SIM_LOCK"); - - return EINA_TRUE; -} -#endif -void setting_security_main_vconf_change_cb(keynode_t *key, void *data) -{ - SETTING_TRACE_BEGIN; - ret_if(NULL == data); - SettingSecurityUG *ad = (SettingSecurityUG *) data; - char *str = NULL; - if(ad->data_screen_lock_type) - { - str = (char*)g_strdup(get_screen_lock_type_str(ad)); - if(!str) - str = g_strdup("err"); - - ad->data_screen_lock_type->sub_desc = str; - elm_genlist_item_update(ad->data_screen_lock_type->item); - } - - setting_security_main_check_vconf_value(ad); -} - -static void setting_security_main_check_vconf_value(void *data) -{ - SETTING_TRACE_BEGIN; - ret_if(NULL == data); - //SettingSecurityUG *ad = (SettingSecurityUG *) data; - - setting_int_slp_list phone_lock_attemps_left = - INT_SLP_SETTING_PHONE_LOCK_ATTEMPTS_LEFT; - setting_int_slp_list sim_lock_attemps_left = - INT_SLP_SETTING_SIM_LOCK_ATTEMPTS_LEFT; - - int phone_lock_value = -1; - int sim_lock_value = -1; - int err = SETTING_RETURN_SUCCESS; - - setting_get_int_slp_key(phone_lock_attemps_left, &phone_lock_value, - &err); - setting_retm_if(err == SETTING_RETURN_FAIL, - "[Error] get the value of vconf fail."); - - setting_get_int_slp_key(sim_lock_attemps_left, &sim_lock_value, &err); - setting_retm_if(err == SETTING_RETURN_FAIL, - "[Error] get the value of vconf fail."); -/* - if (phone_lock_value == 0 || sim_lock_value == 0) { - setting_security_main_create_timer(ad); - } else { - SETTING_TRACE("don't need create timer"); - if (ad->update_view_timer) { - ecore_timer_del(ad->update_view_timer); - ad->update_view_timer = NULL; - } + if(!safeStrCmp("SIM settings", list_item->keyStr)) { + setting_view_change(&setting_view_security_main, &setting_view_security_sim_settings, ad); } -*/ } diff --git a/setting-security/src/setting-security-screen-lock-type.c b/setting-security/src/setting-security-screen-lock-type.c deleted file mode 100755 index 1d75bff..0000000 --- a/setting-security/src/setting-security-screen-lock-type.c +++ /dev/null @@ -1,324 +0,0 @@ -/* - * setting - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. - * - * Contact: MyoungJune Park - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -#include -#include -#include -#include - -#include -#include -#include -#include - -static int setting_security_screen_lock_type_create(void *cb); -static int setting_security_screen_lock_type_destroy(void *cb); -static int setting_security_screen_lock_type_update(void *cb); -static int setting_security_screen_lock_type_cleanup(void *cb); - -setting_view setting_view_security_screen_lock_type = { - .create = setting_security_screen_lock_type_create, - .destroy = setting_security_screen_lock_type_destroy, - .update = setting_security_screen_lock_type_update, - .cleanup = setting_security_screen_lock_type_cleanup, -}; - -/* *************************************************** - ** - **basic func - ** - ****************************************************/ - -static int setting_security_screen_lock_type_create(void *cb) -{ - SETTING_TRACE_BEGIN; - retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER); - - SettingSecurityUG *ad = (SettingSecurityUG *) cb; - - Evas_Object *scroller; - Elm_Object_Item *item = NULL; - Evas_Object *radio; - Setting_GenGroupItem_Data *item_data = NULL; - - /* add basic layout */ - char setBtnStr[MAX_DISPLAY_NAME_LEN_ON_UI]; - snprintf(setBtnStr, sizeof(setBtnStr), "%s", - (char *)dgettext("sys_string", "IDS_COM_BODY_BACK")); - - - setting_push_layout_navi_bar_genlist(ad->win_main_layout, - ad->win_get, - _(Keystr_ScreenLockType), - setBtnStr, NULL, - setting_security_screen_lock_type_click_softkey_back_cb, - NULL, ad, &scroller, ad->navi_bar); - - radio = elm_radio_add(scroller); - elm_radio_state_value_set(radio, -1); - ad->lock_type_rd = radio; - - /* separator */ - item = elm_genlist_item_append(scroller, &(ad->itc_seperator), NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL); - elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY); - - /* to do : radio menu */ - /* 1) swipe */ - item_data = - setting_create_Gendial_field_1radio(scroller, - &(itc_1text_1icon_2), - setting_security_screen_lock_type_mouse_up_Gendial_list_cb, /*add to sel_cb */ - ad, /* sel data */ - SWALLOW_Type_1RADIO, - radio, SETTING_SCREEN_LOCK_TYPE_SWIPE, - Keystr_Swipe, - NULL); - if (item_data) { - item_data->userdata = ad; - } else { - SETTING_TRACE_ERROR("item_data is NULL"); - } -#if DISABLED_CODE - /* 2) Motion */ - item_data = - setting_create_Gendial_field_1radio(scroller, - &(itc_1text_1icon_2), - setting_security_screen_lock_type_mouse_up_Gendial_list_cb, /*add to sel_cb */ - ad, /* sel data */ - SWALLOW_Type_1RADIO, - radio, SETTING_SCREEN_LOCK_TYPE_MOTION, - KeyStr_Motions, - NULL); - if (item_data) { - item_data->userdata = ad; - } else { - SETTING_TRACE_ERROR("item_data is NULL"); - } - - /* 3) Face and voice */ - item_data = - setting_create_Gendial_field_1radio(scroller, - &(itc_1text_1icon_2), - setting_security_screen_lock_type_mouse_up_Gendial_list_cb, /*add to sel_cb */ - ad, /* sel data */ - SWALLOW_Type_1RADIO, - radio, SETTING_SCREEN_LOCK_TYPE_FACE_AND_VOICE, - Keystr_FaceAndVoice, - NULL); - if (item_data) { - item_data->userdata = ad; - } else { - SETTING_TRACE_ERROR("item_data is NULL"); - } -#endif - /* 4) simple password */ - //item_data = - ad->data_simple_pw = - setting_create_Gendial_field_1radio(scroller, - &(itc_1text_1icon_2), - setting_security_screen_lock_type_mouse_up_Gendial_list_cb, /*add to sel_cb */ - ad, /* sel data */ - SWALLOW_Type_1RADIO, - radio, SETTING_SCREEN_LOCK_TYPE_SIMPLE_PASSWORD, - "IDS_ST_BODY_SIMPLE_PASSWORD", - NULL); - if (ad->data_simple_pw) { - ad->data_simple_pw->userdata = ad; - } else { - SETTING_TRACE_ERROR("item_data is NULL"); - } - - /* 5) password */ - //item_data = - ad->data_phone_lk = - setting_create_Gendial_field_1radio(scroller, - &(itc_1text_1icon_2), - setting_security_screen_lock_type_mouse_up_Gendial_list_cb, /*add to sel_cb */ - ad, /* sel data */ - SWALLOW_Type_1RADIO, - radio, SETTING_SCREEN_LOCK_TYPE_PASSWORD, - "IDS_ST_BODY_PASSWORD", - NULL); - if (ad->data_phone_lk) { - ad->data_phone_lk->userdata = ad; - } else { - SETTING_TRACE_ERROR("item_data is NULL"); - } - - /* update info */ - int screen_lock_type = 0; - vconf_get_int(VCONFKEY_SETAPPL_SCREEN_LOCK_TYPE_INT, &screen_lock_type); - elm_radio_value_set(radio, screen_lock_type); - - setting_view_security_screen_lock_type.is_create = 1; - - return SETTING_RETURN_SUCCESS; - -} - -static int setting_security_screen_lock_type_destroy(void *cb) -{ - SETTING_TRACE_BEGIN; - /* error check */ - retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER); - - SettingSecurityUG *ad = (SettingSecurityUG *) cb; - - elm_naviframe_item_pop(ad->navi_bar); - - setting_view_security_screen_lock_type.is_create = 0; - - return SETTING_RETURN_SUCCESS; -} - -static int setting_security_screen_lock_type_update(void *cb) -{ - SETTING_TRACE_BEGIN; - /* error check */ - retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER); - - return SETTING_RETURN_SUCCESS; -} - -static int setting_security_screen_lock_type_cleanup(void *cb) -{ - SETTING_TRACE_BEGIN; - /* error check */ - retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER); - - SettingSecurityUG *ad = (SettingSecurityUG *) cb; - return setting_security_screen_lock_type_destroy(ad); -} - -/* *************************************************** - ** - **call back func - ** - ****************************************************/ - -static void -setting_security_screen_lock_type_mouse_up_Gendial_list_cb(void *data, Evas_Object *obj, - void *event_info) -{ - SETTING_TRACE_BEGIN; - /* error check */ - setting_retm_if(data == NULL, "Data parameter is NULL"); - - retm_if(event_info == NULL, "Invalid argument: event info is NULL"); - Elm_Object_Item *item = (Elm_Object_Item *) event_info; - elm_genlist_item_selected_set(item, 0); - Setting_GenGroupItem_Data *list_item = - (Setting_GenGroupItem_Data *) elm_object_item_data_get(item); - - int lock_type = SETTING_SCREEN_LOCK_TYPE_SWIPE; - - SettingSecurityUG *ad = (SettingSecurityUG *) data; - - SETTING_TRACE("clicking item[%s]", _(list_item->keyStr)); - - if(!safeStrCmp("IDS_ST_BODY_SIMPLE_PASSWORD", list_item->keyStr)) - { - lock_type = SETTING_SCREEN_LOCK_TYPE_SIMPLE_PASSWORD; - } - else if(!safeStrCmp("IDS_ST_BODY_PASSWORD", list_item->keyStr)) - { - lock_type = SETTING_SCREEN_LOCK_TYPE_PASSWORD; - } - /* To do : Add other cases */ - else if(!safeStrCmp(Keystr_Swipe, list_item->keyStr)) - { - lock_type = SETTING_SCREEN_LOCK_TYPE_SWIPE; - } - else if(!safeStrCmp(KeyStr_Motions, list_item->keyStr)) - { - lock_type = SETTING_SCREEN_LOCK_TYPE_MOTION; - } - else if(!safeStrCmp(Keystr_FaceAndVoice, list_item->keyStr)) - { - lock_type = SETTING_SCREEN_LOCK_TYPE_FACE_AND_VOICE; - } - - int old_type = elm_radio_value_get(list_item->eo_check); - - /* If lock_type is same with old_lock_type, return. */ - if(lock_type == old_type) - { - SETTING_TRACE_DEBUG("[Screen Lock Type] Selected same type"); - return; - } - - switch(lock_type) - { - case SETTING_SCREEN_LOCK_TYPE_SWIPE: - case SETTING_SCREEN_LOCK_TYPE_MOTION: - /* To do : Call security-server API. pw : 0000 */ - if(old_type == SETTING_SCREEN_LOCK_TYPE_PASSWORD - || old_type == SETTING_SCREEN_LOCK_TYPE_SIMPLE_PASSWORD) - SETTING_TRACE_DEBUG("set_pwd result : %d", security_server_set_pwd(ad->input_pwd, "0000", 0, 30)); - if(vconf_set_int(VCONFKEY_SETAPPL_SCREEN_LOCK_TYPE_INT, lock_type) == 0) - { - /* set radio */ - elm_radio_value_set(list_item->eo_check, lock_type); - } - break; - case SETTING_SCREEN_LOCK_TYPE_FACE_AND_VOICE: - /* To do : Call security-server API. pw : 0000 */ - if(old_type == SETTING_SCREEN_LOCK_TYPE_PASSWORD - || old_type == SETTING_SCREEN_LOCK_TYPE_SIMPLE_PASSWORD) - SETTING_TRACE_DEBUG("set_pwd result : %d", security_server_set_pwd(ad->input_pwd, "0000", 0, 30)); - setting_create_simple_popup(NULL, ad->win_get, NULL, "NOT SUPPORT YET"); - if(vconf_set_int(VCONFKEY_SETAPPL_SCREEN_LOCK_TYPE_INT, lock_type) == 0) - { - /* set radio */ - elm_radio_value_set(list_item->eo_check, lock_type); - } - break; - case SETTING_SCREEN_LOCK_TYPE_SIMPLE_PASSWORD: - ad->pw_type = SETTING_SEC_PW_SIMPLE_PASSWD; - if(old_type != SETTING_SCREEN_LOCK_TYPE_PASSWORD) - ad->input_pwd = (char*)strdup("0000"); - setting_security_create_password_sg(ad); - break; - case SETTING_SCREEN_LOCK_TYPE_PASSWORD: - ad->pw_type = SETTING_SEC_PW_PASSWORD; - if(old_type != SETTING_SCREEN_LOCK_TYPE_SIMPLE_PASSWORD) - ad->input_pwd = (char*)strdup("0000"); - setting_security_create_password_sg(ad); - break; - default: - break; - } -} - - - -static void -setting_security_screen_lock_type_click_softkey_back_cb(void *data, Evas_Object *obj, - void *event_info) -{ - SETTING_TRACE_BEGIN; - /* error check */ - retm_if(data == NULL, "[Setting > Security] Data parameter is NULL"); - - SettingSecurityUG *ad = (SettingSecurityUG *) data; - - setting_view_change(&setting_view_security_screen_lock_type, &setting_view_security_main, ad); - SETTING_TRACE_END; -} diff --git a/setting-security/src/setting-security-sim-settings.c b/setting-security/src/setting-security-sim-settings.c index d852080..862c206 100755 --- a/setting-security/src/setting-security-sim-settings.c +++ b/setting-security/src/setting-security-sim-settings.c @@ -162,6 +162,26 @@ static int setting_security_sim_settings_update(void *cb) /* error check */ retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER); + SettingSecurityUG *ad = (SettingSecurityUG *) cb; + + SETTING_TRACE("Update SIM menu"); + if (ad->data_sim_lk)//it indicates TAPI is not responsed in time + { + ad->data_sim_lk->chk_status = ad->sim_status; + elm_check_state_set(ad->data_sim_lk->eo_check, ad->sim_status); + } + + SETTING_TRACE("Update PIN menu"); + if (ad->data_pin_lk)//it indicates TAPI is not responsed in time + { + ad->data_pin_lk->chk_status = ad->pin1_status; + elm_check_state_set(ad->data_pin_lk->eo_check, ad->pin1_status); + if(ad->data_pin_lk->chk_status == 0) + setting_disable_genlist_item(ad->data_change_pin1->item); + else + setting_enable_genlist_item(ad->data_change_pin1->item); + } + return SETTING_RETURN_SUCCESS; } @@ -180,6 +200,41 @@ static int setting_security_sim_settings_cleanup(void *cb) **call back func ** ****************************************************/ + +static void get_pin_lock_info_cb(TapiHandle *handle, int result, void *data, void *user_data) +{ + SETTING_TRACE_BEGIN; + + TelSimPinOperationResult_t sec_rt = result; + TelSimLockInfo_t *lock = data; + + SettingSecurityUG *ad = (SettingSecurityUG *)user_data; + + int old_state = elm_check_state_get(ad->data_pin_lk->eo_check); + if (old_state) { + SETTING_TRACE("Current status of PIN Lock is ON"); + ad->pw_type = SETTING_SEC_PW_PIN_LOCK_OFF; + } else { + SETTING_TRACE("Current status of PIN Lock is OFF"); + ad->pw_type = SETTING_SEC_PW_PIN_LOCK_ON; + } + + SETTING_TRACE_DEBUG("sec_ret[%d], lock_type[%d], lock_status[%d], retry_count[%d]", sec_rt, lock->lock_type, lock->lock_status, lock->retry_count); + if(lock->lock_status == 2) /* PUK */ + { + SETTING_TRACE("Current status of PIN Lock is Blocked"); + ad->pw_type = SETTING_SEC_PW_PIN1_BLOCKED; + } + else if(lock->lock_status == 5) /* Blocked */ + { + setting_create_simple_popup(NULL, ad->win_get, + NULL, _("PUK is blocked. Can't use PIN Lock")); + return; + } + + setting_security_create_password_sg(ad); +} + void _draw_pin_onoff_status(void *data, Evas_Object *check) { SETTING_TRACE("PIN Lock"); @@ -214,16 +269,40 @@ static int setting_security_sim_settings_cleanup(void *cb) return; } - int old_state = elm_check_state_get(check); + if(tel_get_sim_lock_info(ad->handle, TAPI_SIM_LOCK_SC, get_pin_lock_info_cb, ad) != 0) + { + SETTING_TRACE_ERROR("failed to call tel_get_sim_lock_info()"); + } +} + +static void get_sim_lock_info_cb(TapiHandle *handle, int result, void *data, void *user_data) +{ + SETTING_TRACE_BEGIN; + + TelSimPinOperationResult_t sec_rt = result; + TelSimLockInfo_t *lock = data; + + SettingSecurityUG *ad = (SettingSecurityUG *)user_data; + + int old_state = elm_check_state_get(ad->data_sim_lk->eo_check); if (old_state) { SETTING_TRACE("Current status of SIM Lock is ON"); - ad->pw_type = SETTING_SEC_PW_PIN_LOCK_OFF; - setting_security_create_password_sg(ad); + ad->pw_type = SETTING_SEC_PW_SIM_LOCK_OFF; } else { SETTING_TRACE("Current status of SIM Lock is OFF"); - ad->pw_type = SETTING_SEC_PW_PIN_LOCK_ON; - setting_security_create_password_sg(ad); + ad->pw_type = SETTING_SEC_PW_SIM_LOCK_ON; } + + SETTING_TRACE_DEBUG("sec_ret[%d], lock_type[%d], lock_status[%d], retry_count[%d]", sec_rt, lock->lock_type, lock->lock_status, lock->retry_count); + + if(lock->lock_status == 5) /* Blocked */ + { + setting_create_simple_popup(NULL, ad->win_get, + NULL, _("SIM is blocked. Can't use SIM Lock")); + return; + } + + setting_security_create_password_sg(ad); } void _draw_sim_onoff_status(void *data, Evas_Object *check) @@ -240,16 +319,37 @@ void _draw_sim_onoff_status(void *data, Evas_Object *check) if(ret == SETTING_RETURN_FAIL) return; - int old_state = elm_check_state_get(check); - if (old_state) { - SETTING_TRACE("Current status of SIM Lock is ON"); - ad->pw_type = SETTING_SEC_PW_SIM_LOCK_OFF; - setting_security_create_password_sg(ad); - } else { - SETTING_TRACE("Current status of SIM Lock is OFF"); - ad->pw_type = SETTING_SEC_PW_SIM_LOCK_ON; - setting_security_create_password_sg(ad); + if(tel_get_sim_lock_info(ad->handle, TAPI_SIM_LOCK_PS, get_sim_lock_info_cb, ad) != 0) + { + SETTING_TRACE_ERROR("failed to call tel_get_sim_lock_info()"); + } +} + +static void get_change_pin_info_cb(TapiHandle *handle, int result, void *data, void *user_data) +{ + SETTING_TRACE_BEGIN; + + TelSimPinOperationResult_t sec_rt = result; + TelSimLockInfo_t *lock = data; + + SettingSecurityUG *ad = (SettingSecurityUG *)user_data; + + ad->pw_type = SETTING_SEC_PW_CHANGE_PIN1; + + SETTING_TRACE_DEBUG("sec_ret[%d], lock_type[%d], lock_status[%d], retry_count[%d]", sec_rt, lock->lock_type, lock->lock_status, lock->retry_count); + if(lock->lock_status == 2) /* PUK */ + { + SETTING_TRACE("Current status of PIN Lock is Blocked"); + ad->pw_type = SETTING_SEC_PW_PIN1_BLOCKED; + } + else if(lock->lock_status == 5) /* Blocked */ + { + setting_create_simple_popup(NULL, ad->win_get, + NULL, _("PUK is blocked. Can't use PIN Lock")); + return; } + + setting_security_create_password_sg(ad); } void _mouse_up_change_pin(void *data, int sel_item) @@ -303,33 +403,17 @@ void _mouse_up_change_pin(void *data, int sel_item) NULL, _("IDS_COM_BODY_INVALID_SIM_CARD")); return; } - if(sel_item == 1) + if(sel_item == 1 && (ad->pin1_status == TAPI_SIM_FACILITY_ENABLED)) { - //pin_type = TAPI_SIM_PTYPE_PIN1; - if (TAPI_SIM_FACILITY_ENABLED == ad->pin1_status) + if(tel_get_sim_lock_info(ad->handle, TAPI_SIM_LOCK_SC, get_change_pin_info_cb, ad) != 0) { - ad->pw_type = SETTING_SEC_PW_CHANGE_PIN1; - setting_security_create_password_sg(ad); - } - else - { - ad->pw_type = SETTING_SEC_PW_PIN1_BLOCKED; - setting_security_create_password_sg(ad); + SETTING_TRACE_ERROR("failed to call tel_get_sim_lock_info()"); } } - else if(sel_item == 3) + else if(sel_item == 3 && (ad->pin2_status == TAPI_SIM_FACILITY_ENABLED)) { - //pin_type = TAPI_SIM_PTYPE_PIN2; - if (TAPI_SIM_FACILITY_ENABLED == ad->pin2_status) - { - ad->pw_type = SETTING_SEC_PW_CHANGE_PIN2; - setting_security_create_password_sg(ad); - } - else - { - ad->pw_type = SETTING_SEC_PW_PIN2_BLOCKED; - setting_security_create_password_sg(ad); - } + ad->pw_type = SETTING_SEC_PW_CHANGE_PIN2; + setting_security_create_password_sg(ad); } } diff --git a/setting-security/src/setting-security.c b/setting-security/src/setting-security.c index 17d76b5..0d8baad 100755 --- a/setting-security/src/setting-security.c +++ b/setting-security/src/setting-security.c @@ -39,41 +39,6 @@ int pwd_handler_do_nothing(SettingSecurityUG *data, void* arg) return 0; } - -int pwd_handler_sec_pw_passwd(SettingSecurityUG *data, void* arg) -{ - SETTING_TRACE_BEGIN; - SettingSecurityUG *ad = (SettingSecurityUG *)data; - - if(vconf_set_int(VCONFKEY_SETAPPL_SCREEN_LOCK_TYPE_INT, SETTING_SCREEN_LOCK_TYPE_PASSWORD) == 0) - { - /* set radio */ - elm_radio_value_set(ad->lock_type_rd, SETTING_SCREEN_LOCK_TYPE_PASSWORD); - } - else - { - SETTING_TRACE_ERROR("setting vconf value failed : screen_lock_type"); - } - return 0; -} - -int pwd_handler_sec_pw_simple_passwd (SettingSecurityUG *data, void* arg) -{ - SETTING_TRACE_BEGIN; - SettingSecurityUG *ad = (SettingSecurityUG *)data; - - if(vconf_set_int(VCONFKEY_SETAPPL_SCREEN_LOCK_TYPE_INT, SETTING_SCREEN_LOCK_TYPE_SIMPLE_PASSWORD) == 0) - { - /* set radio */ - elm_radio_value_set(ad->lock_type_rd, SETTING_SCREEN_LOCK_TYPE_SIMPLE_PASSWORD); - } - else - { - SETTING_TRACE_ERROR("setting vconf value failed : screen_lock_type"); - } - return 0; -} - int pwd_handler_sec_pw_sim_lock_on(SettingSecurityUG *data, void* arg) { SETTING_TRACE_BEGIN; @@ -145,42 +110,15 @@ int pwd_handler_sec_pw_change_pin1(SettingSecurityUG *data, void* arg) return 0; } -#if SUPPORT_FDN -int pwd_handler_sec_pw_fdn_mode_on(SettingSecurityUG *data, void* arg) -{ - SETTING_TRACE_BEGIN; - SettingSecurityUG *ad = (SettingSecurityUG *)data; - if (tel_get_sim_facility(ad->handle, TAPI_SIM_LOCK_FD, setting_security_sim_get_facility_cb, ad) != TAPI_API_SUCCESS) - { - SETTING_TRACE_ERROR("tel_get_sim_facility(TAPI_SIM_LOCK_PS) failed"); - } - return 0; -} - - -int pwd_handler_sec_pw_fdn_mode_off(SettingSecurityUG *data, void* arg) -{ - SETTING_TRACE_BEGIN; - SettingSecurityUG *ad = (SettingSecurityUG *)data; - if (tel_get_sim_facility(ad->handle, TAPI_SIM_LOCK_FD, setting_security_sim_get_facility_cb, ad) != TAPI_API_SUCCESS) - { - SETTING_TRACE_ERROR("tel_get_sim_facility(TAPI_SIM_LOCK_PS) failed"); - } - return 0; -} -#endif - int pwd_handler_sec_pw_change_pin2(SettingSecurityUG *data, void* arg) { SETTING_TRACE_BEGIN; -#if SUPPORT_FDN SettingSecurityUG *ad = (SettingSecurityUG *)data; if (tel_get_sim_facility(ad->handle, TAPI_SIM_LOCK_FD, setting_security_sim_get_facility_cb, ad) != TAPI_API_SUCCESS) { SETTING_TRACE_ERROR("tel_get_sim_facility(TAPI_SIM_LOCK_PS) failed"); } -#endif return 0; } @@ -189,11 +127,6 @@ int pwd_handler_sec_pw_pin1_blocked(SettingSecurityUG *data, void* arg) { SETTING_TRACE_BEGIN; SettingSecurityUG *ad = (SettingSecurityUG *)data; - if (tel_get_sim_facility(ad->handle, TAPI_SIM_LOCK_SC, setting_security_sim_get_facility_cb, ad) != TAPI_API_SUCCESS) - { - SETTING_TRACE_ERROR("tel_get_sim_facility(TAPI_SIM_LOCK_PS) failed"); - } - return 0; } @@ -201,144 +134,26 @@ int pwd_handler_sec_pw_pin1_blocked(SettingSecurityUG *data, void* arg) int pwd_handler_sec_pw_pin2_blocked(SettingSecurityUG *data, void* arg) { SETTING_TRACE_BEGIN; -#if SUPPORT_FDN SettingSecurityUG *ad = (SettingSecurityUG *)data; - - if (tel_get_sim_facility(ad->handle, TAPI_SIM_LOCK_FD, setting_security_sim_get_facility_cb, ad) != TAPI_API_SUCCESS) - { - SETTING_TRACE_ERROR("tel_get_sim_facility(TAPI_SIM_LOCK_PS) failed"); - } -#endif return 0; } static struct _security_item security_table[] = { - { SETTING_SEC_PW_PASSWORD, "SETTING_PW_TYPE_PASSWORD", pwd_handler_sec_pw_passwd }, - { SETTING_SEC_PW_SIMPLE_PASSWD, "SETTING_PW_TYPE_SIMPLE_PASSWORD", pwd_handler_sec_pw_simple_passwd }, - { SETTING_SEC_PW_CHANGE_PASSWD, "SETTING_PW_TYPE_CHANGE_PASSWORD", pwd_handler_do_nothing }, - { SETTING_SEC_PW_CHANGE_SIMPLE_PASSWD, "SETTING_PW_TYPE_CHANGE_SIMPLE_PASSWORD", pwd_handler_do_nothing }, - { SETTING_SEC_PW_ENTER_LOCK_TYPE, "SETTING_PW_TYPE_ENTER_LOCK_TYPE", pwd_handler_do_nothing}, { SETTING_SEC_PW_SIM_LOCK_ON, "SETTING_PW_TYPE_SIM_LOCK_ON", pwd_handler_sec_pw_sim_lock_on }, { SETTING_SEC_PW_SIM_LOCK_OFF, "SETTING_PW_TYPE_SIM_LOCK_OFF", pwd_handler_sec_pw_sim_lock_off }, { SETTING_SEC_PW_SIM_LOCK_DISABLED, "SETTING_PW_TYPE_SIM_LOCK_DISABLE", pwd_handler_sec_pw_sim_lock_disabled}, { SETTING_SEC_PW_PIN_LOCK_ON, "SETTING_PW_TYPE_PIN_LOCK_ON", pwd_handler_sec_pw_pin_lock_on }, { SETTING_SEC_PW_PIN_LOCK_OFF, "SETTING_PW_TYPE_PIN_LOCK_OFF", pwd_handler_sec_pw_pin_lock_off }, { SETTING_SEC_PW_CHANGE_PIN1, "SETTING_PW_TYPE_CHANGE_PIN1", pwd_handler_sec_pw_change_pin1}, -#if SUPPORT_FDN - { SETTING_SEC_PW_FDN_MODE_ON, "SETTING_PW_TYPE_FDN_MODE_ON", pwd_handler_sec_pw_fdn_mode_on}, - { SETTING_SEC_PW_FDN_MODE_OFF, "SETTING_PW_TYPE_FDN_MODE_OFF", pwd_handler_sec_pw_fdn_mode_off}, -#endif { SETTING_SEC_PW_CHANGE_PIN2, "SETTING_PW_TYPE_CHANGE_PIN2", pwd_handler_sec_pw_change_pin2}, { SETTING_SEC_PW_PIN1_BLOCKED, "SETTING_PW_TYPE_PIN1_BLOCKED", pwd_handler_sec_pw_pin1_blocked}, { SETTING_SEC_PW_PIN2_BLOCKED, "SETTING_PW_TYPE_PIN2_BLOCKED", pwd_handler_sec_pw_pin2_blocked}, + { SETTING_SEC_PW_PIN1_BLOCKED, "SETTING_PW_TYPE_PIN1_UNBLOCKED", pwd_handler_sec_pw_pin_lock_on}, + { SETTING_SEC_PW_PIN2_BLOCKED, "SETTING_PW_TYPE_PIN2_UNBLOCKED", pwd_handler_do_nothing}, /*------------------------------------------------------------------------------------------------------------*/ { SETTING_SEC_PW_MAX, NULL, pwd_handler_do_nothing} }; - -#ifdef SUPPORT_MDM -void setting_security_disable_items_for_mdm(void *data) -{ - SETTING_TRACE_BEGIN; - ret_if(data == NULL); - - SettingSecurityUG *ad = (SettingSecurityUG *)data; - - if(ad->mdm_status != MDM_RESULT_SUCCESS) - { - SETTING_TRACE_DEBUG("[ERROR] status of mdm server is not good"); - return; - } - - ad->mdm_data = mdm_get_password_policy(); - if(ad->mdm_data == NULL) - { - ad->mdm_status = mdm_get_service(); - if(ad->mdm_status == MDM_RESULT_SUCCESS) - { - ad->mdm_data = mdm_get_password_policy(); - if(ad->mdm_data == NULL) - { - SETTING_TRACE_DEBUG("[ERROR] failed to get password policy, too"); - return; - } - } - else - { - SETTING_TRACE_DEBUG("[ERROR] status of mdm server is not good, too"); - return; - } - } - - SETTING_TRACE_DEBUG("[SUCCESS] mdm_get_password_policy() "); - ad->mdm_policy = (mdm_password_policy_t*)(ad->mdm_data->data); - - if(ad->mdm_policy->quality == MDM_PASSWORD_QUALITY_UNSPECIFIED) - { - SETTING_TRACE_DEBUG(" enable simple password, enable phone lock"); - // enable simple password, enable phone lock - setting_enable_genlist_item(ad->data_simple_pw->item); - setting_enable_genlist_item(ad->data_phone_lk->item); - } - else if((ad->mdm_policy->quality == MDM_PASSWORD_QUALITY_SOMETHING) - || (ad->mdm_policy->quality == MDM_PASSWORD_QUALITY_NUMERIC)) - { - // enable simple password, disable phone lock - if(ad->mdm_policy->min_length > 4) - { - SETTING_TRACE_DEBUG(" disable simple password, disable phone lock"); - if(vconf_set_bool(VCONFKEY_SETAPPL_STATE_SIMPLE_PASSWORD_BOOL, 0) == 0) - { - elm_check_state_set(ad->data_simple_pw->eo_check, 0); - setting_disable_genlist_item(ad->data_simple_pw->item); - } - } - else - { - SETTING_TRACE_DEBUG(" enable simple password, disable phone lock"); - setting_enable_genlist_item(ad->data_simple_pw->item); - } - setting_disable_genlist_item(ad->data_phone_lk->item); - } - else - { - SETTING_TRACE_DEBUG(" disable simple password, disable phone lock"); - // disable simple password, disable phone lock - if(vconf_set_bool(VCONFKEY_SETAPPL_STATE_SIMPLE_PASSWORD_BOOL, 0) == 0) - { - elm_check_state_set(ad->data_simple_pw->eo_check, 0); - setting_disable_genlist_item(ad->data_simple_pw->item); - } - setting_disable_genlist_item(ad->data_phone_lk->item); - } - - SETTING_TRACE_END; -} - - -void _mdm_password_receiver_cb(int status, void *data) -{ - SETTING_TRACE_BEGIN; - ret_if(data == NULL); - SettingSecurityUG *ad = (SettingSecurityUG *) data; - - if((status == MDM_PASSWORD_QUALITY_CHANGED) - ||(status == MDM_PASSWORD_MIN_LENGTH_CHANGED)) - { - ecore_pipe_write(ad->pipe, NULL, 0); - } -} - -static void pipe_handler(void *data, void *buf, unsigned int len) -{ - SETTING_TRACE_BEGIN; - ret_if(data == NULL); - SettingSecurityUG *ad = (SettingSecurityUG *) data; - - setting_security_disable_items_for_mdm(ad); -} -#endif - static void setting_security_ug_cb_resize(void *data, Evas *e, Evas_Object *obj, void *event_info) { @@ -368,8 +183,6 @@ static void *setting_security_ug_on_create(ui_gadget_h ug, /* register view node table */ setting_view_node_table_intialize(); setting_view_node_table_register(&setting_view_security_main, NULL); - setting_view_node_table_register(&setting_view_security_encryption, &setting_view_security_main); - setting_view_node_table_register(&setting_view_security_screen_lock_type, &setting_view_security_main); setting_view_node_table_register(&setting_view_security_sim_settings, &setting_view_security_main); setting_create_Gendial_itc("dialogue/1text", &(securityUG->itc_1text)); @@ -397,36 +210,7 @@ static void *setting_security_ug_on_create(ui_gadget_h ug, if (TAPI_API_SUCCESS != tel_get_sim_facility(securityUG->handle, TAPI_SIM_LOCK_SC, setting_security_sim_get_facility_cb, securityUG)) { SETTING_TRACE_ERROR("*** [ERR] tel_get_sim_facility(pin1). ***"); } - - if (TAPI_API_SUCCESS != tel_get_sim_facility(securityUG->handle, TAPI_SIM_LOCK_FD, setting_security_sim_get_facility_cb, securityUG)) { - SETTING_TRACE_ERROR("*** [ERR] tel_get_sim_facility(pin2(/fdn)). ***"); - } - } - -#ifdef SUPPORT_MDM - securityUG->pipe = ecore_pipe_add(pipe_handler, securityUG); - - securityUG->mdm_status = mdm_get_service(); - if(securityUG->mdm_status != MDM_RESULT_SUCCESS) - { - SETTING_TRACE_DEBUG("[ERROR] failed to connect mdm server"); - } - else - { - SETTING_TRACE_DEBUG("[SUCCESS] connect mdm server"); - securityUG->mdm_handle = mdm_register_policy_receiver(MDM_POLICY_ON_PASSWORD, securityUG, _mdm_password_receiver_cb); - - if(securityUG->mdm_handle == -1) - { - SETTING_TRACE_DEBUG("[ERROR] failed to register receiver"); - ecore_pipe_del(securityUG->pipe); - } - else - { - SETTING_TRACE_DEBUG("[SUCCESS] register receiver"); - } } -#endif setting_view_node_set_cur_view(&setting_view_security_main); setting_view_create(&setting_view_security_main, (void *)securityUG); @@ -471,9 +255,6 @@ static void setting_security_ug_on_destroy(ui_gadget_h ug, service_h service, if (TRUE == setting_view_security_sim_settings.is_create) { setting_view_destroy(&setting_view_security_sim_settings, securityUG); } - if (TRUE == setting_view_security_screen_lock_type.is_create) { - setting_view_destroy(&setting_view_security_screen_lock_type, securityUG); - } if (TRUE == setting_view_security_main.is_create) { setting_view_destroy(&setting_view_security_main, securityUG); } @@ -482,17 +263,6 @@ static void setting_security_ug_on_destroy(ui_gadget_h ug, service_h service, evas_object_hide((Evas_Object *) ug_get_layout(securityUG->ug)); evas_object_del((Evas_Object *) ug_get_layout(securityUG->ug)); } -#ifdef SUPPORT_MDM - if(securityUG->mdm_status == MDM_RESULT_SUCCESS) - { - if(securityUG->mdm_handle != -1) - mdm_deregister_policy_receiver(securityUG->mdm_handle); - mdm_release_service(); - } - - if(securityUG->pipe) - ecore_pipe_del(securityUG->pipe); -#endif } static void setting_security_ug_on_message(ui_gadget_h ug, service_h msg, @@ -600,76 +370,34 @@ void setting_security_sim_get_facility_cb(TapiHandle *handle, int result, void * SETTING_TRACE("fi->f_status[%d]", fi->f_status); if (sec_rt == TAPI_SIM_PIN_OPERATION_SUCCESS) { + SETTING_TRACE_DEBUG("PIN_OPERATION_SUCCESS"); switch (fi->type) { case TAPI_SIM_LOCK_PS://sim status ad->sim_status = fi->f_status; - SETTING_TRACE("Trying to Set sim status"); - if (ad->data_sim_lk)//it indicates TAPI is not responsed in time - { - ad->data_sim_lk->chk_status = fi->f_status; - elm_check_state_set(ad->data_sim_lk->eo_check, fi->f_status); - - } break; case TAPI_SIM_LOCK_SC://pin1 status ad->pin1_status = fi->f_status; - SETTING_TRACE("Trying to Set Pin1 status"); - if (ad->data_pin_lk)//it indicates TAPI is not responsed in time - { - ad->data_pin_lk->chk_status = fi->f_status; - elm_check_state_set(ad->data_pin_lk->eo_check, fi->f_status); - if(ad->data_pin_lk->chk_status == 0) - setting_disable_genlist_item(ad->data_change_pin1->item); - } break; case TAPI_SIM_LOCK_FD://pin2/fdn status ad->pin2_status = fi->f_status; - SETTING_TRACE("Trying to Set pin2/fdn status"); -#if SUPPORT_FDN - if (ad->data_fdn)//it indicates TAPI is not responsed in time - { - ad->data_fdn->chk_status = fi->f_status; - elm_check_state_set(ad->data_fdn->eo_check, fi->f_status); - } -#endif break; default: - return; + break; } } else { //if failed, do nothing.. } - SETTING_TRACE_END; -} - -static void setting_security_layout_find_my_mobile_ug_cb(ui_gadget_h ug, - enum ug_mode mode, - void *priv) -{ - SETTING_TRACE_BEGIN; - if (!priv) - return; - - SettingSecurityUG *ad = (SettingSecurityUG *) priv; /* ad is point to data */ - Evas_Object *base = ug_get_layout(ug); - if (!base) - return; - - switch (mode) { - case UG_MODE_FULLVIEW: - evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, - EVAS_HINT_EXPAND); - elm_win_resize_object_add(ad->win_get, base); - evas_object_show(base); - break; - default: - break; + /* Update SIM Settings view if created. */ + if(setting_view_security_sim_settings.is_create == 1) + { + SETTING_TRACE_DEBUG("SIM settings view is already created. [%d]", setting_view_security_sim_settings.is_create); + setting_view_update(&setting_view_security_sim_settings, ad); } - return; + SETTING_TRACE_END; } void setting_security_layout_passwd_ug_cb(ui_gadget_h ug, @@ -700,6 +428,7 @@ void setting_security_layout_passwd_ug_cb(ui_gadget_h ug, void setting_security_destroy_password_ug_cb(ui_gadget_h ug, void *priv) { + SETTING_TRACE_BEGIN; ret_if(priv == NULL); SettingSecurityUG *ad = (SettingSecurityUG *) priv; if (ug) { @@ -710,6 +439,7 @@ void setting_security_destroy_password_ug_cb(ui_gadget_h ug, gboolean setting_security_create_password_sg(void *data) { + SETTING_TRACE_BEGIN; /* error check */ retv_if(data == NULL, FALSE); @@ -760,129 +490,6 @@ gboolean setting_security_create_password_sg(void *data) return TRUE; } -void setting_security_create_find_my_mobile_sg(void *cb, int argc, char **argv) -{ - SETTING_TRACE_BEGIN; - ret_if(cb == NULL); - - SettingSecurityUG *ad = (SettingSecurityUG *) cb; /* ad is point to cb */ - - if (ad->ug_mt) { - SETTING_TRACE("Mobile tracker UG is already loaded."); - return; - } - - - service_h svc_mt_ug = NULL; - - struct ug_cbs *cbs = (struct ug_cbs *)calloc(1, sizeof(struct ug_cbs)); - setting_retm_if(!cbs, "calloc failed"); - cbs->layout_cb = setting_security_layout_find_my_mobile_ug_cb; - cbs->result_cb = NULL; - cbs->destroy_cb = setting_security_destroy_find_my_mobile_ug_cb; - cbs->priv = (void *)ad; - - if(!service_create(&svc_mt_ug)) - service_add_extra_data(svc_mt_ug, "viewtype", "MTUG_TYPE_DETAIL_SETTING"); - - ad->ug_mt = ug_create(ad->ug, "find-my-mobile-efl", UG_MODE_FULLVIEW, svc_mt_ug, cbs); - if (NULL == ad->ug_mt) { /* error handling */ - } - - FREE(cbs); - service_destroy(svc_mt_ug); - return; -} - -void setting_security_destroy_find_my_mobile_ug_cb(ui_gadget_h ug, - void *priv) -{ - SETTING_TRACE_BEGIN; - ret_if(!priv); - - SettingSecurityUG *ad = (SettingSecurityUG *) priv; /* ad is point to priv */ - - if (ug) { - ug_destroy(ug); - ad->ug_mt = NULL; - } - - if (ad->data_mb) { - ad->data_mb->sub_desc = - (char *)g_strdup(get_find_my_mobile_on_off_str(priv)); - elm_object_item_data_set(ad->data_mb->item, ad->data_mb); - elm_genlist_item_update(ad->data_mb->item); - } - //evas_object_show((Evas_Object *) ug_get_layout(ad->ug)); -} - -void setting_security_layout_lockscreen_options_ug_cb(ui_gadget_h ug, - enum ug_mode mode, void *priv) -{ - if (!priv) - return; - - SettingSecurityUG *ad = (SettingSecurityUG *) priv; - Evas_Object *base = ug_get_layout(ug); - if (!base) - return; - - switch (mode) { - case UG_MODE_FULLVIEW: - evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, - EVAS_HINT_EXPAND); - elm_win_resize_object_add(ad->win_get, base); - evas_object_show(base); - break; - default: - break; - } - - return; -} - -void setting_security_destroy_lockscreen_options_ug_cb(ui_gadget_h ug, - void *priv) -{ - ret_if(priv == NULL); - SettingSecurityUG *ad = (SettingSecurityUG *) priv; - if (ug) { - ug_destroy(ug); - ad->ug_lockscreen = NULL; - } -} - -gboolean setting_security_create_lockscreen_options_sg(void *data) -{ - /* error check */ - retv_if(data == NULL, FALSE); - - SettingSecurityUG *ad = (SettingSecurityUG *) data; /* ad is point to data */ - - if (ad->ug_lockscreen) { - SETTING_TRACE("Password UG is already loaded."); - return FALSE; - } - struct ug_cbs *cbs = (struct ug_cbs *)calloc(1, sizeof(struct ug_cbs)); - - if (!cbs) - return FALSE; - cbs->layout_cb = setting_security_layout_lockscreen_options_ug_cb; - cbs->result_cb = NULL; - cbs->destroy_cb = setting_security_destroy_lockscreen_options_ug_cb; - cbs->priv = (void *)ad; - - ad->ug_lockscreen = ug_create(ad->ug, "lockscreen-options", UG_MODE_FULLVIEW, NULL, cbs); - if (NULL == ad->ug_lockscreen) { /* error handling */ - SETTING_TRACE_ERROR("NULL == ad->ug_lockscreen"); - evas_object_show(ad->ly_main); - } - - FREE(cbs); - - return TRUE; -} - /* *************************************************** * *call back func @@ -906,6 +513,7 @@ void setting_security_result_password_ug_cb(ui_gadget_h ug, service_h service, void *priv) { + SETTING_TRACE_BEGIN; /* error check */ retm_if(priv == NULL, "Data paremeter is NULL"); @@ -925,12 +533,6 @@ setting_security_result_password_ug_cb(ui_gadget_h ug, service_h service, { /* To do : rollback previouse status. */ } - else if(safeStrCmp(result, "SETTING_PW_TYPE_ENTER_LOCK_TYPE") == 0) - { - ug_destroy(ug); - ad->ug_passwd = NULL; - setting_view_change(&setting_view_security_main, &setting_view_security_screen_lock_type, ad); - } else { int index = _get_security_table_index(result); @@ -945,58 +547,14 @@ setting_security_result_password_ug_cb(ui_gadget_h ug, service_h service, FREE(ad->input_pwd); } - if(current) - { - SETTING_TRACE_DEBUG("current : %s", current); - ad->input_pwd = (char*)strdup(current); - } - evas_object_show(ad->ly_main); + SETTING_TRACE_END; } #ifdef Status #undef Status #endif -char *get_screen_lock_type_str(void *priv) -{ - int lock_type = 0; - - vconf_get_int(VCONFKEY_SETAPPL_SCREEN_LOCK_TYPE_INT, &lock_type); - - switch(lock_type) - { - case SETTING_SCREEN_LOCK_TYPE_SWIPE: - return setting_gettext(Keystr_Swipe); - case SETTING_SCREEN_LOCK_TYPE_MOTION: - return setting_gettext(KeyStr_Motions); - case SETTING_SCREEN_LOCK_TYPE_FACE_AND_VOICE: - return setting_gettext(Keystr_FaceAndVoice); - case SETTING_SCREEN_LOCK_TYPE_SIMPLE_PASSWORD: - return setting_gettext("IDS_ST_BODY_SIMPLE_PASSWORD"); - case SETTING_SCREEN_LOCK_TYPE_PASSWORD: - return setting_gettext("IDS_ST_BODY_PASSWORD"); - default: - return NULL; - } -} - - - -char *get_find_my_mobile_on_off_str(void *priv) -{ - int value1 = 0; - int value2 = 0; - - vconf_get_bool(VCONFKEY_SETAPPL_FIND_MY_MOBILE_SIM_CHANGE_ALERT_BOOL, &value1); - vconf_get_bool(VCONFKEY_SETAPPL_FIND_MY_MOBILE_REMOTE_CONTROL_BOOL, &value2); - - if (value1 || value2) { - return setting_gettext("IDS_COM_BODY_ON_M_STATUS"); - } else { - return setting_gettext("IDS_COM_BODY_OFF_M_STATUS"); - } -} /*****/ UG_MODULE_API int setting_plugin_reset(service_h service, void *priv) @@ -1019,12 +577,6 @@ UG_MODULE_API int setting_plugin_reset(service_h service, void *priv) ret += -1; } } - ret += vconf_set_bool(VCONFKEY_SETAPPL_STATE_POWER_ON_LOCK_BOOL, FALSE); - ret += vconf_set_bool(VCONFKEY_SETAPPL_STATE_SIMPLE_PASSWORD_BOOL, TRUE); - ret += vconf_set_bool(VCONFKEY_SETAPPL_FIND_MY_MOBILE_SIM_CHANGE_ALERT_BOOL, FALSE); - ret += vconf_set_str(VCONFKEY_SETAPPL_FIND_MY_MOBILE_RECIPIENTS_STR, ""); - ret += vconf_set_str(VCONFKEY_SETAPPL_FIND_MY_MOBILE_SENDER_STR, ""); - ret += vconf_set_str(VCONFKEY_SETAPPL_FIND_MY_MOBILE_MESSAGE_STR, ""); #if SUPPORT_RCS_FOR_DEMO ret += vconf_set_bool("db/setting/rcs", FALSE); diff --git a/setting-shortcut/CMakeLists.txt b/setting-shortcut/CMakeLists.txt deleted file mode 100755 index 0bed848..0000000 --- a/setting-shortcut/CMakeLists.txt +++ /dev/null @@ -1,44 +0,0 @@ - -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include) -INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/${SETTING_COMMON}/include) - - -INCLUDE(FindPkgConfig) -pkg_check_modules(pkgs_shortcut REQUIRED - evas ecore edje - elementary - appcore-common - appcore-efl - ecore-imf ui-gadget-1 - capi-appfw-application dlog) - -FOREACH(flag ${pkgs_shortcut_CFLAGS}) - SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") -ENDFOREACH(flag) - -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC") -SET(CMAKE_C_FLAGS_DEBUG "-O0 -g") - -IF("${ARCH}" STREQUAL "arm") - ADD_DEFINITIONS("-DTARGET") - MESSAGE("add -DTARGET") -ENDIF("${ARCH}" STREQUAL "arm") - -ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"") -ADD_DEFINITIONS("-DSLP_DEBUG") - -SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl, --rpath=/usr/lib") - -ADD_LIBRARY(${SETTING_SHORTCUT_UG} SHARED - ./src/setting-shortcut.c - ./src/setting-shortcut-main.c -) - -TARGET_LINK_LIBRARIES(${SETTING_SHORTCUT_UG} -L${CMAKE_BINARY_DIR}/${SETTING_COMMON} -lsetting-common) -TARGET_LINK_LIBRARIES(${SETTING_SHORTCUT_UG} ${pkgs_shortcut_LDFLAGS}) - -INSTALL(TARGETS ${SETTING_SHORTCUT_UG} DESTINATION /opt/ug/lib) - - - - diff --git a/setting-shortcut/include/setting-shortcut-main.h b/setting-shortcut/include/setting-shortcut-main.h deleted file mode 100644 index eb0e8d9..0000000 --- a/setting-shortcut/include/setting-shortcut-main.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * setting - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. - * - * Contact: MyoungJune Park - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -#ifndef _SETTING_SHORTCUT_MAIN_H_ -#define _SETTING_SHORTCUT_MAIN_H_ - -#include - - -#endif diff --git a/setting-shortcut/include/setting-shortcut.h b/setting-shortcut/include/setting-shortcut.h deleted file mode 100755 index bb149d8..0000000 --- a/setting-shortcut/include/setting-shortcut.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * setting - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. - * - * Contact: MyoungJune Park - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -#ifndef _SETTING_SHORTCUT_H_ -#define _SETTING_SHORTCUT_H_ - -#include -#include -#include - -#include - -#include -#include -#include - -typedef struct _SettingShortcutUG { - ui_gadget_h ug; - - /* add more variables here (move your appdata to here) */ - Evas *evas; - Evas_Object *win_main_layout; - Evas_Object *win_get; - Evas_Object *ly_main; - - Elm_Object_Item *navi_it; - Evas_Object *controllbar; - Evas_Object *navi_bar; - Evas_Object *sub_layout; - - Evas_Object *scroller; - - Setting_GenGroupItem_Data *acc_negative_color; - Setting_GenGroupItem_Data *acc_screen_reader; - Setting_GenGroupItem_Data *acc_zoom; - Setting_GenGroupItem_Data *acc_led_notification; - Setting_GenGroupItem_Data *acc_mono_audio; - Setting_GenGroupItem_Data *acc_assistive_light; -} SettingShortcutUG; - -extern setting_view setting_view_shortcut_main; - - - -#endif diff --git a/setting-shortcut/src/setting-shortcut-main.c b/setting-shortcut/src/setting-shortcut-main.c deleted file mode 100755 index 3e042fc..0000000 --- a/setting-shortcut/src/setting-shortcut-main.c +++ /dev/null @@ -1,197 +0,0 @@ -/* - * setting - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. - * - * Contact: MyoungJune Park - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -#include -#include -#include - -static int setting_shortcut_main_create(void *cb); -static int setting_shortcut_main_destroy(void *cb); -static int setting_shortcut_main_update(void *cb); -static int setting_shortcut_main_cleanup(void *cb); - -setting_view setting_view_shortcut_main = { - .create = setting_shortcut_main_create, - .destroy = setting_shortcut_main_destroy, - .update = setting_shortcut_main_update, - .cleanup = setting_shortcut_main_cleanup, -}; - -/* *************************************************** - * - *basic func - * - ***************************************************/ - -static void setting_shortcut_main_sk_cancel_cb(void *data, Evas_Object *obj, void *event_info) -{ - SETTING_TRACE_BEGIN; - /* error check */ - ret_if(data == NULL); - - SettingShortcutUG *ad = (SettingShortcutUG *)data; - /* Send destroy request */ - ug_destroy_me(ad->ug); -} - -static void -setting_shortcut_main_mouse_up_Gendial_list_cb(void *data, Evas_Object *obj, void *event_info) -{ - SETTING_TRACE_BEGIN; - - if(data == NULL) - return; - retm_if(event_info == NULL, "Invalid argument: event info is NULL"); - - //SettingShortcutUG *ad = (SettingShortcutUG*)data; - Elm_Object_Item *item = (Elm_Object_Item *) event_info; - elm_genlist_item_selected_set(item, 0); - - Setting_GenGroupItem_Data *list_item = - (Setting_GenGroupItem_Data *) elm_object_item_data_get(item); - - SETTING_TRACE_DEBUG("%s selected", list_item->keyStr); - -} - -void setting_shortcut_add_genlist_items(void *data) -{ - SETTING_TRACE_BEGIN; - if(data == NULL) - return; - - SettingShortcutUG *ad = (SettingShortcutUG*)data; - - /* separator */ - Elm_Object_Item *item = elm_genlist_item_append(ad->scroller, &itc_seperator, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL); - elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY); - - /* To do : Add 6 items */ - ad->acc_assistive_light = setting_create_Gendial_field_def(ad->scroller, &itc_1text, - setting_shortcut_main_mouse_up_Gendial_list_cb,ad, - SWALLOW_Type_INVALID, - NULL, NULL, - 0, _("IDS_ST_MBODY_ASSISTIVE_LIGHT"), NULL, NULL); - - ad->acc_led_notification = setting_create_Gendial_field_def(ad->scroller, &itc_1text, - setting_shortcut_main_mouse_up_Gendial_list_cb,ad, - SWALLOW_Type_INVALID, - NULL, NULL, - 0, _("LED notification"), NULL, NULL); - - ad->acc_mono_audio = setting_create_Gendial_field_def(ad->scroller, &itc_1text, - setting_shortcut_main_mouse_up_Gendial_list_cb,ad, - SWALLOW_Type_INVALID, - NULL, NULL, - 0, _("IDS_ST_MBODY_MONO_AUDIO"), NULL, NULL); - - ad->acc_negative_color = setting_create_Gendial_field_def(ad->scroller, &itc_1text, - setting_shortcut_main_mouse_up_Gendial_list_cb,ad, - SWALLOW_Type_INVALID, - NULL, NULL, - 0, _("IDS_ST_BODY_NEGATIVE_COLOURS"), NULL, NULL); - - ad->acc_screen_reader = setting_create_Gendial_field_def(ad->scroller, &itc_1text, - setting_shortcut_main_mouse_up_Gendial_list_cb,ad, - SWALLOW_Type_INVALID, - NULL, NULL, - 0, _("IDS_ST_MBODY_SCREEN_READER_HTTS"), NULL, NULL); - - ad->acc_zoom = setting_create_Gendial_field_def(ad->scroller, &itc_1text, - setting_shortcut_main_mouse_up_Gendial_list_cb,ad, - SWALLOW_Type_INVALID, - NULL, NULL, - 0, _("IDS_ST_MBODY_ZOOM"), NULL, NULL); -} - -static int -setting_shortcut_main_create(void *cb) -{ - SETTING_TRACE_BEGIN; - /* error check */ - retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER); - - SettingShortcutUG *ad = (SettingShortcutUG *) cb; - - char setBtnStr[MAX_DISPLAY_NAME_LEN_ON_UI]; - snprintf(setBtnStr, sizeof(setBtnStr), "%s", - (char *)dgettext("sys_string", "IDS_COM_BODY_BACK")); - - ad->ly_main = - setting_create_layout_navi_bar_genlist(ad->win_main_layout, - ad->win_get, - "Accessibility shortcut list", - setBtnStr, NULL, - setting_shortcut_main_sk_cancel_cb, - NULL, ad, &(ad->scroller), - &(ad->navi_bar)); - - if(ad->ly_main == NULL) - return SETTING_RETURN_FAIL; - - setting_shortcut_add_genlist_items(ad); - - setting_view_shortcut_main.is_create = 1; - SETTING_TRACE_END; - return SETTING_RETURN_SUCCESS; -} - -static int setting_shortcut_main_destroy(void *cb) -{ - /* error check */ - retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER); - - SettingShortcutUG *ad = (SettingShortcutUG *) cb; - - if (ad->ly_main != NULL) { - evas_object_del(ad->ly_main); - ad->ly_main = NULL; - setting_view_shortcut_main.is_create = 0; - } - return SETTING_RETURN_SUCCESS; -} - -static int setting_shortcut_main_update(void *cb) -{ - /* error check */ - retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER); - - SettingShortcutUG *ad = (SettingShortcutUG *) cb; - - if (ad->ly_main != NULL) { - evas_object_show(ad->ly_main); - } - - return SETTING_RETURN_SUCCESS; -} - -static int setting_shortcut_main_cleanup(void *cb) -{ - /* error check */ - retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER); - - SettingShortcutUG *ad = (SettingShortcutUG *) cb; - - if (ad->ly_main != NULL) { - evas_object_hide(ad->ly_main); - } - - return SETTING_RETURN_SUCCESS; -} diff --git a/setting-shortcut/src/setting-shortcut.c b/setting-shortcut/src/setting-shortcut.c deleted file mode 100755 index eabb853..0000000 --- a/setting-shortcut/src/setting-shortcut.c +++ /dev/null @@ -1,167 +0,0 @@ -/* - * setting - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. - * - * Contact: MyoungJune Park - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include - -#ifndef UG_MODULE_API -#define UG_MODULE_API __attribute__ ((visibility("default"))) -#endif - - -static void setting_shortcut_ug_cb_resize(void *data, Evas *e, Evas_Object *obj, void *event_info) -{ - SettingShortcutUG *ad = (SettingShortcutUG *) data; - setting_view_update(&setting_view_shortcut_main, ad); -} - -static void *setting_shortcut_ug_on_create(ui_gadget_h ug, - enum ug_mode mode, service_h service, - void *priv) -{ - SETTING_TRACE_BEGIN; - setting_retvm_if((!priv), NULL, "!priv"); - - SettingShortcutUG *shortcutUG = (SettingShortcutUG *)priv; - shortcutUG->ug = ug; - shortcutUG->win_main_layout = (Evas_Object *) ug_get_parent_layout(ug); - shortcutUG->win_get = (Evas_Object *) ug_get_window(); - evas_object_show(shortcutUG->win_main_layout); - shortcutUG->evas = evas_object_evas_get(shortcutUG->win_main_layout); - - setting_retvm_if(shortcutUG->win_main_layout == NULL, NULL, - "cannot get main window "); - - /* --------------------------------------------------------- */ - /* set launguage */ - appcore_set_i18n(SETTING_PACKAGE, SETTING_LOCALEDIR); - /* --------------------------------------------------------- */ - - /* creating a view. */ - setting_view_create(&setting_view_shortcut_main,(void *)shortcutUG); - evas_object_event_callback_add(shortcutUG->win_main_layout, - EVAS_CALLBACK_RESIZE, - setting_shortcut_ug_cb_resize, - shortcutUG); - return shortcutUG->ly_main; -} - -static void setting_shortcut_ug_on_start(ui_gadget_h ug, service_h service, void *priv) -{ -} - -static void setting_shortcut_ug_on_pause(ui_gadget_h ug, service_h service, void *priv) -{ -} - -static void setting_shortcut_ug_on_resume(ui_gadget_h ug, service_h service, void *priv) -{ -} - -static void setting_shortcut_ug_on_destroy(ui_gadget_h ug, service_h service, void *priv) -{ - SettingShortcutUG *shortcutUG = (SettingShortcutUG *)priv; - - evas_object_event_callback_del(shortcutUG->win_main_layout, EVAS_CALLBACK_RESIZE, setting_shortcut_ug_cb_resize); /* fix flash issue for gallery */ - shortcutUG->ug = ug; - - /* delete the allocated objects. */ - setting_view_destroy(&setting_view_shortcut_main, shortcutUG); - if (NULL != ug_get_layout(shortcutUG->ug)) { - evas_object_hide((Evas_Object *) ug_get_layout(shortcutUG->ug)); - evas_object_del((Evas_Object *) ug_get_layout(shortcutUG->ug)); - } -} - -static void setting_shortcut_ug_on_message(ui_gadget_h ug, service_h msg, service_h service, void *priv) -{ - -} - -static void setting_shortcut_ug_on_event(ui_gadget_h ug, - enum ug_event event, service_h service, - void *priv) -{ - switch (event) { - case UG_EVENT_LOW_MEMORY: - break; - case UG_EVENT_LOW_BATTERY: - break; - case UG_EVENT_LANG_CHANGE: - break; - case UG_EVENT_ROTATE_PORTRAIT: - break; - case UG_EVENT_ROTATE_PORTRAIT_UPSIDEDOWN: - break; - case UG_EVENT_ROTATE_LANDSCAPE: - break; - case UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN: - break; - case UG_EVENT_REGION_CHANGE: - break; - default: - break; - } -} - -static void setting_shortcut_ug_on_key_event(ui_gadget_h ug, - enum ug_key_event event, - service_h service, void *priv) -{ - if (!ug || !priv) - return; - - switch (event) { - case UG_KEY_EVENT_END: - ug_destroy_me(ug); - break; - default: - break; - } -} - -UG_MODULE_API int UG_MODULE_INIT(struct ug_module_ops *ops) -{ - SettingShortcutUG *shortcutUG = calloc(1, sizeof(SettingShortcutUG)); - setting_retvm_if(!shortcutUG, -1, "Create SettingShortcutUG obj failed"); - - ops->create = setting_shortcut_ug_on_create; - ops->start = setting_shortcut_ug_on_start; - ops->pause = setting_shortcut_ug_on_pause; - ops->resume = setting_shortcut_ug_on_resume; - ops->destroy = setting_shortcut_ug_on_destroy; - ops->message = setting_shortcut_ug_on_message; - ops->event = setting_shortcut_ug_on_event; - ops->key_event = setting_shortcut_ug_on_key_event; - ops->priv = shortcutUG; - ops->opt = UG_OPT_INDICATOR_ENABLE; - - return 0; -} - -UG_MODULE_API void UG_MODULE_EXIT(struct ug_module_ops *ops) -{ - struct SettingShortcutUG *shortcutUG; - setting_retm_if(!ops, "ops == NULL"); - - shortcutUG = ops->priv; - if (shortcutUG) - FREE(shortcutUG); -} -- 2.7.4