From 0eb0f5110babfb9b55b97823cabb1dc7bae2b18f Mon Sep 17 00:00:00 2001 From: "jinwang.an" Date: Mon, 9 Dec 2019 16:05:17 +0900 Subject: Remove unuse source code Change-Id: I9a5d3890cd84cca15d863d93191b55cc204abdfd Signed-off-by: jinwang.an --- CMakeLists.txt | 1 - include/setting_control_haptic.h | 36 ----- src/setting-device.c | 3 - src/setting-sound.c | 285 --------------------------------------- src/setting-vibration.c | 16 +-- src/setting-volume-page.c | 1 - src/setting_control_haptic.c | 107 --------------- 7 files changed, 1 insertion(+), 448 deletions(-) delete mode 100644 include/setting_control_haptic.h delete mode 100644 src/setting_control_haptic.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ec57aa..fdd8564 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,6 @@ SET(SRCS src/setting-common-sound.c src/util.c src/setting_data_vconf.c - src/setting_control_haptic.c src/setting_view_toast.c src/setting-datausage.c src/setting-mobile-networks.c diff --git a/include/setting_control_haptic.h b/include/setting_control_haptic.h deleted file mode 100644 index eebefea..0000000 --- a/include/setting_control_haptic.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2010 Samsung Electronics, Inc. - * All rights reserved. - * - * This software is a confidential and proprietary information - * of Samsung Electronics, Inc. ("Confidential Information"). You - * shall not disclose such Confidential Information and shall use - * it only in accordance with the terms of the license agreement - * you entered into with Samsung Electronics. - */ -#ifndef _SETTING_CONTROL_HAPTIC_ -#define _SETTING_CONTROL_HAPTIC_ - -#include - -#define SETTING_DEFAULT_HAPTIC_PREVIEW_VIB TZ_SYS_GLOBALUSER_DATA_D"/settings/Vibrations/B2_System_Vibration_Preview_140221.ivt" -#define SETTING_DEFAULT_SYSTEM_HAPTIC_PREVIEW_VIB TZ_SYS_GLOBALUSER_DATA_D"/settings/Vibrations/B2_System_Long_v2_140221.ivt" -#define SETTING_DEFAULT_NOTIFICATION_GENERAL_PREVIEW_VIB TZ_SYS_GLOBALUSER_DATA_D"/settings/Vibrations/B2_Notification_General_v5_140306.ivt" -#define SETTING_VIB_FEEDBACK_RATE 20 - -#define SETTING_VIB_STRONG_RATE 49 /* 70 */ -#define SETTING_VIB_MEDIUM_RATE 49 -#define SETTING_VIB_WEAK_RATE 20 /* 30 */ - -struct _haptic_data { - int is_haptic_opened; -}; - -int _haptic_open(); -int _is_haptic_open(); -int _haptic_close(); - -Eina_Bool __vibration_timeout(void *data); -void _start_vibration(int level, int feedback_rate, char *res_path); - -#endif diff --git a/src/setting-device.c b/src/setting-device.c index 857abc8..df0cd80 100644 --- a/src/setting-device.c +++ b/src/setting-device.c @@ -23,7 +23,6 @@ #include "setting-device.h" #include "util.h" -#include "setting_control_haptic.h" #include "setting_view_toast.h" #include "setting_data_vconf.h" #include "setting-language.h" @@ -183,8 +182,6 @@ void _clear_device_action_resource() device_action_timer = NULL; } - _haptic_close(); - g_app_context = NULL; device_action_type = 0; diff --git a/src/setting-sound.c b/src/setting-sound.c index 6c9a694..39ea718 100644 --- a/src/setting-sound.c +++ b/src/setting-sound.c @@ -18,7 +18,6 @@ #include "setting-sound.h" #include "setting-vibration.h" #include "setting-common-sound.h" -#include "setting_control_haptic.h" #include "setting_view_toast.h" #include "setting_data_vconf.h" #include "setting-volume.h" @@ -95,7 +94,6 @@ static Evas_Object *g_touch_check = NULL; static void sound_vconf_changed_cb(system_settings_key_e key, void *data); static void vibrate_vconf_changed_cb(system_settings_key_e key, void *data); static void pm_state_vconf_changed_cb(keynode_t *key, void *data); -static void _vibration_gl_cb(void *data, Evas_Object *obj, void *event_info); static void _ringtone_type_gl_cb(void *data, Evas_Object *obj, void *event_info); static void stop_wav(); @@ -157,8 +155,6 @@ void _clear_sound_resource() vibration_timer = NULL; } - _haptic_close(); - g_app_context = NULL; g_sound_genlist = NULL; g_sound_mode_genlist = NULL; @@ -296,29 +292,6 @@ static void get_sound_file_list(char *dir, int type) closedir(dp); } -#if 0 -static int get_vibration_level() -{ - int mode = 1; - int level = 0; - - vconf_get_int(VCONFKEY_SETAPPL_NOTI_VIBRATION_LEVEL_INT, &level); - - switch (level) { - case VIBRATION_LEVEL_LOW_INT: - mode = VIBRATION_LEVEL_LOW; - break; - /* case VIBRATION_LEVEL_MID_INT : */ - /* mode = VIBRATION_LEVEL_MID; */ - /* break; */ - case VIBRATION_LEVEL_HIGH_INT: - mode = VIBRATION_LEVEL_HIGH; - break; - } - return mode; -} -#endif - void _show_volume_list(void *data) { appdata *ad = data; @@ -384,7 +357,6 @@ void _vibrate_cb(void *data, Evas_Object *obj, void *event_info) return; } - _initialize(); genlist = _create_vibration_list(data); @@ -402,14 +374,6 @@ void _vibrate_cb(void *data, Evas_Object *obj, void *event_info) ad->MENU_TYPE = SETTING_SOUND; } - -/*void _vibrate_cb(void *data, Evas_Object *obj, void *event_info) */ -/*{ */ -/* elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE); */ -/* */ -/* _show_vibration_popup_cb(data, obj, event_info); */ -/*} */ - static char *_get_sound_file_name(char *full_name) { char *token = NULL; @@ -746,7 +710,6 @@ static void _sound_mode_gl_cb(void *data, Evas_Object *obj, void *event_info) vconf_set_int(SETTING_RINGTONE_VOLUME_BACKUP, ringtone_level); /*sound_manager_set_muteall(TRUE); // mute!! */ } - _start_vibration(5, SETTING_VIB_STRONG_RATE, SETTING_DEFAULT_SYSTEM_HAPTIC_PREVIEW_VIB); break; case SOUND_MODE_MUTE: if (prev_sound_mode != SOUND_MODE_MUTE) { @@ -1370,254 +1333,6 @@ void _show_notification_popup_cb(void *data, Evas_Object *obj, void *event_info) register_vconf_changing(VCONFKEY_PM_STATE, pm_state_vconf_changed_cb, NULL); } -static void _response_vibration_ok_cb(void *data, Evas_Object *obj, void *event_info) -{ - /* save a vibration level */ - int level = 0; - - _haptic_close(); - - switch (vibrate_type) { - case VIBRATION_LEVEL_LOW: - vconf_set_int(VCONFKEY_SETAPPL_NOTI_VIBRATION_LEVEL_INT, VIBRATION_LEVEL_LOW_INT); - vconf_set_int(VCONFKEY_SETAPPL_TOUCH_FEEDBACK_VIBRATION_LEVEL_INT, VIBRATION_LEVEL_LOW_INT); - break; - case VIBRATION_LEVEL_HIGH: - vconf_set_int(VCONFKEY_SETAPPL_NOTI_VIBRATION_LEVEL_INT, VIBRATION_LEVEL_HIGH_INT); - vconf_set_int(VCONFKEY_SETAPPL_TOUCH_FEEDBACK_VIBRATION_LEVEL_INT, VIBRATION_LEVEL_HIGH_INT); - break; - default: - break; - } - - vconf_get_int(VCONFKEY_SETAPPL_NOTI_VIBRATION_LEVEL_INT, &level); - DBG("Setting - vibration level : %d", level); - - if (g_vibration_type_genlist != NULL) { - evas_object_del(g_vibration_type_genlist); - g_vibration_type_genlist = NULL; - } - - if (g_app_context->vibration_rdg != NULL) { - evas_object_del(g_app_context->vibration_rdg); - g_app_context->vibration_rdg = NULL; - } - - appdata *ad = (appdata *)data; - if (ad != NULL) { - elm_naviframe_item_pop(ad->nf); - } - -} - -static void _response_vibration_cancel_cb(void *data, Evas_Object *obj, void *event_info) -{ - _haptic_close(); - - vconf_get_int(VCONFKEY_SETAPPL_NOTI_VIBRATION_LEVEL_INT, &vibrate_type); - - DBG("Setting - vibrate type have backed : %d", vibrate_type); - - if (g_vibration_type_genlist != NULL) { - evas_object_del(g_vibration_type_genlist); - g_vibration_type_genlist = NULL; - } - - appdata *ad = (appdata *)data; - if (ad != NULL) { - elm_naviframe_item_pop(ad->nf); - } -} - -static char *_gl_vibration_text_get(void *data, Evas_Object *obj, const char *part) -{ - Item_Data *item = data; - if (item == NULL) - return NULL; - - return strdup(_(vibration_str[item->index % 2])); -} - -static Evas_Object *_gl_vibration_radio_get(void *data, Evas_Object *obj, const char *part) -{ - Evas_Object *radio = NULL; - Evas_Object *radio_main = evas_object_data_get(obj, "radio_main"); - Item_Data *id = data; - int index = id->index; - - if (!strcmp(part, "elm.icon")) { - radio = elm_radio_add(obj); - elm_object_style_set(radio, "list"); - elm_radio_state_value_set(radio, id->index); - evas_object_size_hint_align_set(radio, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_size_hint_weight_set(radio, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_radio_group_add(radio, radio_main); - evas_object_smart_callback_add(radio, "changed", _vibration_gl_cb, (void *)(uintptr_t)id->index); - evas_object_propagate_events_set(radio, EINA_FALSE); - - if (vibrate_type == id->index) { - elm_radio_value_set(radio_main, vibrate_type); - } - index++; - - elm_atspi_accessible_relationship_append(id->item, ELM_ATSPI_RELATION_DESCRIBED_BY, radio); - elm_atspi_accessible_relationship_append(id->item, ELM_ATSPI_RELATION_CONTROLLER_FOR, radio); - elm_atspi_accessible_relationship_append(radio, ELM_ATSPI_RELATION_CONTROLLED_BY, id->item); - } - return radio; -} - -static void _vibration_gl_cb(void *data, Evas_Object *obj, void *event_info) -{ - elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE); - - vconf_get_int(VCONFKEY_SETAPPL_NOTI_VIBRATION_LEVEL_INT, &origin_vibration_level); - - vibrate_type = (uintptr_t)data; - - int level = VIBRATION_LEVEL_LOW_INT; - int feedback_rate = SETTING_VIB_MEDIUM_RATE; - switch (vibrate_type) { - /* case 2: */ - /* level = VIBRATION_LEVEL_LOW_INT; */ - /* feedback_rate = SETTING_VIB_WEAK_RATE; */ - /* break; */ - case 1: - level = VIBRATION_LEVEL_LOW_INT; - feedback_rate = SETTING_VIB_WEAK_RATE; - break; - case 0: - level = VIBRATION_LEVEL_HIGH_INT; - feedback_rate = SETTING_VIB_STRONG_RATE; - break; - } - - DBG("Setting - feedback level: %d, rate: %d", level, feedback_rate); - - _start_vibration(level, feedback_rate, SETTING_DEFAULT_NOTIFICATION_GENERAL_PREVIEW_VIB); - - elm_genlist_realized_items_update(g_vibration_type_genlist); -} - -static void _vibration_layout_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) -{ - DBG("Setting - _vibration_layout_del_cb() is called!"); - - _haptic_close(); - -} - -static int get_vibration_type() -{ - int type = 1; - - vconf_get_int(VCONFKEY_SETAPPL_NOTI_VIBRATION_LEVEL_INT, &origin_vibration_level); - switch (origin_vibration_level) { - case VIBRATION_LEVEL_LOW_INT: - type = 1; - break; - /* case VIBRATION_LEVEL_MID_INT: */ - /* type = 1; */ - /* break; */ - case VIBRATION_LEVEL_HIGH_INT: - type = 0; - break; - } - - return type; -} - -void _show_vibration_popup_cb(void *data, Evas_Object *obj, void *event_info) -{ - Evas_Object *popup, *btn; - unsigned int index; - appdata *ad = data; - - vibrate_type = get_vibration_type(); - - popup = elm_layout_add(ad->win_main); - elm_layout_file_set(popup, EDJE_PATH, "setting/genlist/2button-layout"); - evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(popup, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_event_callback_add(popup, EVAS_CALLBACK_DEL, _vibration_layout_del_cb, ad); - - Elm_Genlist_Item_Class *itc = NULL; - itc = elm_genlist_item_class_new(); - itc->item_style = "1text.1icon.1"; - itc->func.text_get = _gl_vibration_text_get; - itc->func.content_get = _gl_vibration_radio_get; - - Evas_Object *genlist; - genlist = elm_genlist_add(popup); - elm_object_style_set(genlist, "popup"); - elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS); - elm_genlist_homogeneous_set(genlist, EINA_TRUE); - connect_to_wheel_with_genlist(genlist, ad); - - Elm_Genlist_Item_Class *title_item = elm_genlist_item_class_new(); - title_item->func.text_get = _gl_menu_title_text_get; - title_item->item_style = "title"; - title_item->func.del = NULL; - - elm_genlist_item_append(genlist, title_item, (void *)SOUND_TITLE_VIBRATION, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL); - - elm_genlist_item_class_free(title_item); - int count = sizeof(vibration_str) / sizeof(vibration_str[0]); - - for (index = 0; index < count; index++) { - Item_Data *item = (Item_Data *)calloc(sizeof(Item_Data), 1); - if (item) { - item->index = index; - item->item = elm_genlist_item_append(genlist, - itc, - item, - NULL, - ELM_GENLIST_ITEM_NONE, - _vibration_gl_cb, - (void *)(uintptr_t)index); - } - } - - ad->vibration_rdg = elm_radio_add(genlist); - elm_radio_state_value_set(ad->vibration_rdg, 3); - elm_radio_value_set(ad->vibration_rdg, notification_type); - - evas_object_data_set(genlist, "radio_main", ad->vibration_rdg); - - g_vibration_type_genlist = genlist; - - Elm_Genlist_Item_Class *padding = elm_genlist_item_class_new(); - padding->item_style = "padding"; - padding->func.del = _sound_gl_del; - - Elm_Object_Item *padding_item; - padding_item = elm_genlist_item_append(genlist, padding, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL); - elm_atspi_accessible_role_set(padding_item, ELM_ATSPI_ROLE_REDUNDANT_OBJECT); - - elm_genlist_item_class_free(padding); - elm_object_part_content_set(popup, "elm.genlist", genlist); - evas_object_show(genlist); - elm_genlist_item_class_free(itc); - - btn = elm_button_add(popup); - elm_object_style_set(btn, "default"); - evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_object_text_set(btn, _("IDS_ST_BUTTON_CANCEL_ABB2")); - elm_object_part_content_set(popup, "btn.left", btn); - evas_object_smart_callback_add(btn, "clicked", _response_vibration_cancel_cb, ad); - - btn = elm_button_add(popup); - elm_object_style_set(btn, "default"); - evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_object_text_set(btn, _("IDS_WNOTI_BUTTON_OK_ABB2")); - elm_object_part_content_set(popup, "btn.right", btn); - evas_object_smart_callback_add(btn, "clicked", _response_vibration_ok_cb, ad); - - elm_naviframe_item_push(ad->nf, NULL, NULL, NULL, popup, "empty"); - back_button_cb_push(&_response_vibration_cancel_cb, data, obj, g_sound_genlist, "g_sound_genlist"); - eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, _hw_back_key_cb, NULL); -} - static char *_gl_pref_arm_title_get(void *data, Evas_Object *obj, const char *part) { char buf[__SETTING_BUF_SIZE__] = {0,}; diff --git a/src/setting-vibration.c b/src/setting-vibration.c index 191b182..0bd6bdf 100644 --- a/src/setting-vibration.c +++ b/src/setting-vibration.c @@ -25,7 +25,6 @@ #include "setting-vibration.h" #include "util.h" #include "setting-common-sound.h" -#include "setting_control_haptic.h" #include "setting_view_toast.h" #include "setting_data_vconf.h" #include "setting-volume.h" @@ -92,11 +91,8 @@ void _clear_vibration_resource(void *data, Evas_Object *obj, void *event_info) vibration_timer = NULL; } - _haptic_close(); - back_key_generic_cb(g_app_context, obj, event_info); - g_app_context = NULL; g_vibration_genlist = NULL; g_vibration_type_genlist = NULL; @@ -360,37 +356,29 @@ static void _vibration_gl_cb(void *data, Evas_Object *obj, void *event_info) vibrate_type = (uintptr_t)data; int level = VIBRATION_LEVEL_LOW_INT; - int feedback_rate = SETTING_VIB_MEDIUM_RATE; int vib_type = 0; switch (vibrate_type) { case VIBRATION_LEVEL_NONE: level = VIBRATION_LEVEL_NONE_INT; - feedback_rate = 0; break; case VIBRATION_LEVEL_LOW: level = VIBRATION_LEVEL_LOW_INT; - feedback_rate = SETTING_VIB_WEAK_RATE; vib_type = FEEDBACK_PATTERN_SIP; break; case VIBRATION_LEVEL_HIGH: level = VIBRATION_LEVEL_HIGH_INT; - feedback_rate = SETTING_VIB_STRONG_RATE; vib_type = FEEDBACK_PATTERN_TIMER; break; } vconf_set_int(VCONFKEY_SETAPPL_NOTI_VIBRATION_LEVEL_INT, level); vconf_set_int(VCONFKEY_SETAPPL_TOUCH_FEEDBACK_VIBRATION_LEVEL_INT, level); - DBG("Setting - feedback level: %d, rate: %d", level, feedback_rate); - - _start_vibration(level, feedback_rate, SETTING_DEFAULT_NOTIFICATION_GENERAL_PREVIEW_VIB); + DBG("Setting - feedback level: %d", level); feedback_play_type(FEEDBACK_TYPE_VIBRATION, vib_type); elm_genlist_realized_items_update(g_vibration_type_genlist); - _haptic_close(); - DBG("Setting - vibration level : %d", level); if (g_vibration_type_genlist != NULL) { @@ -415,8 +403,6 @@ static void _vibration_layout_del_cb(void *data, Evas *e, Evas_Object *obj, void { DBG("Setting - _vibration_layout_del_cb() is called!"); - _haptic_close(); - if (g_vib_item) { elm_genlist_item_update(g_vib_item); } diff --git a/src/setting-volume-page.c b/src/setting-volume-page.c index 40c4385..caac88f 100644 --- a/src/setting-volume-page.c +++ b/src/setting-volume-page.c @@ -12,7 +12,6 @@ #include #include "setting-volume.h" -#include "setting_control_haptic.h" #include "setting-common-sound.h" #include "setting_data_vconf.h" diff --git a/src/setting_control_haptic.c b/src/setting_control_haptic.c deleted file mode 100644 index ce11286..0000000 --- a/src/setting_control_haptic.c +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (c) 2010 Samsung Electronics, Inc. - * All rights reserved. - * - * This software is a confidential and proprietary information - * of Samsung Electronics, Inc. ("Confidential Information"). You - * shall not disclose such Confidential Information and shall use - * it only in accordance with the terms of the license agreement - * you entered into with Samsung Electronics. - */ -#include "setting_control_haptic.h" -#include "util.h" - -static struct _haptic_data h_data; -static Ecore_Timer *vibration_timer = NULL; - -/* static haptic_device_h hnd_hpt; */ - -int _haptic_open() -{ -#if 0 - int haptic_return = 0; - haptic_return = haptic_open(HAPTIC_DEVICE_0, &hnd_hpt); - if (haptic_return < 0) { - DBG("Setting - Failed haptic_open"); - return 0; - } - - h_data.is_haptic_opened = 1; -#endif - return 1; -} - -int _is_haptic_open() -{ - return h_data.is_haptic_opened; -} - -Eina_Bool __vibration_timeout(void *data) -{ - if (_is_haptic_open()) { - _haptic_close(); - } - - vibration_timer = NULL; - - return ECORE_CALLBACK_CANCEL; -} - -void _start_vibration(int level, int feedback_rate, char *res_path) -{ -#if 0 - if (_is_haptic_open()) { - _haptic_close(); - } - - if (_haptic_open()) { - int duration = 0; - int err = -1; - - err = haptic_get_file_duration(hnd_hpt, res_path, &duration); - if (err != 0) { - DBG("Setting - haptic_get_file_duration() failed"); - duration = 1000; - } - - DBG("Setting - duration : %d", duration); - - err = haptic_vibrate_file_with_detail(hnd_hpt, res_path, - HAPTIC_ITERATION_ONCE, feedback_rate, HAPTIC_PRIORITY_HIGH, NULL); - if (err != 0) - DBG("Setting - haptic_vibrate_file_with_detail() failed"); - - double real_duration = (double)(duration / 1000.0); - - DBG("Setting - duration2 : %f", real_duration); - - if (vibration_timer) { - ecore_timer_del(vibration_timer); - vibration_timer = NULL; - } - vibration_timer = ecore_timer_add(real_duration, (Ecore_Task_Cb)__vibration_timeout, NULL); - } -#endif -} - -int _haptic_close() -{ -#if 0 - if (h_data.is_haptic_opened) { - int ret = haptic_close(hnd_hpt); - if (ret != 0) { - DBG("Setting - Failed haptic_deinitialize"); - return 0; - } - } - - if (vibration_timer) { - ecore_timer_del(vibration_timer); - vibration_timer = NULL; - } - - h_data.is_haptic_opened = 0; -#endif - - return 1; -} -- cgit v1.2.3