From: Kim Kibum Date: Fri, 27 Apr 2012 04:25:46 +0000 (+0900) Subject: Tizen souce update X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=168f652fdf3b75ee10ee9edd42ff689d89664f10;p=apps%2Fhome%2Fcall.git Tizen souce update --- diff --git a/call-engine/voice-call-device.c b/call-engine/voice-call-device.c index e4a268a..1eb297e 100755 --- a/call-engine/voice-call-device.c +++ b/call-engine/voice-call-device.c @@ -36,7 +36,8 @@ static int g_proximity_sensor_handle = -1; static int g_proximity_sensor_state = -1; - static void __voicecall_dvc_proximity_sensor_callback_func(unsigned int type, sensor_event_data_t *event, void *data); +static gboolean __voicecall_dvc_proximity_sensor_is_request(unsigned int type, sensor_event_data_t *event, void *data); +static void __voicecall_dvc_proximity_sensor_callback_func(unsigned int type, sensor_event_data_t *event, void *data); static gboolean __voicecall_dvc_earjack_status_cb(keynode_t *node, call_vc_core_state_t *pcall_core); static gboolean __voicecall_dvc_earjackkey_status_cb(keynode_t *node, call_vc_core_state_t *pcall_core); @@ -230,6 +231,7 @@ gboolean _voicecall_dvc_proximity_sensor_init(void *data) event_condition_t my_cond; #endif call_vc_core_state_t *pcall_core = (call_vc_core_state_t *)data; + sensor_data_t cur_sensor_data; if (g_proximity_sensor_handle >= 0) { CALL_ENG_DEBUG(ENG_WARN, "already initialized"); @@ -259,10 +261,61 @@ gboolean _voicecall_dvc_proximity_sensor_init(void *data) CALL_ENG_DEBUG(ENG_ERR, "sensor_start fail"); return FALSE; } + + ret = sf_get_data(handle, PROXIMITY_BASE_DATA_SET, &cur_sensor_data); + if (ret < 0) { + CALL_ENG_DEBUG(ENG_ERR, "sf_get_data fail"); + return FALSE; + } + + CALL_ENG_DEBUG(ENG_DEBUG, "proximity_state:[%d]\n", cur_sensor_data.values[0]); + if (cur_sensor_data.values[0] == PROXIMITY_STATE_NEAR) { + if (__voicecall_dvc_proximity_sensor_is_required(pcall_core)) { + CALL_ENG_DEBUG(ENG_DEBUG, "PROXIMITY_STATE_NEAR"); + g_proximity_sensor_state = VCALL_SENSOR_NEAR; + _voicecall_dvc_control_lcd_state(VC_LCD_OFF); + } + } + g_proximity_sensor_handle = handle; CALL_ENG_DEBUG(ENG_DEBUG, "_voicecall_dvc_proximity_sensor_init done"); } +gboolean __voicecall_dvc_proximity_sensor_is_required(call_vc_core_state_t *pcall_core) +{ + voicecall_engine_t *pcall_engine = NULL; + CALL_ENG_DEBUG(ENG_DEBUG, ""); + + if (pcall_core == NULL) { + CALL_ENG_DEBUG(ENG_ERR, "Wrong pointer for pcall_core"); + return FALSE; + } + + pcall_engine = pcall_core->pcall_engine; + if (pcall_engine == NULL) { + CALL_ENG_DEBUG(ENG_ERR, "Wrong pointer for pcall_engine"); + return FALSE; + } + + if (_vc_core_cm_isexists_incoming_call(&(pcall_engine->call_manager)) == TRUE) { + CALL_ENG_DEBUG(ENG_DEBUG, "we'll not excute sensor in case of incoming call"); + return FALSE; + } + + if ((_vc_core_cm_isexists_connected_call(&(pcall_engine->call_manager)) == FALSE) && + (_vc_core_cm_isexits_outgoing_call(&(pcall_engine->call_manager)) == FALSE)) { + CALL_ENG_DEBUG(ENG_DEBUG, "we'll not excute sensor in case of NO call"); + return FALSE; + } + + if (voicecall_snd_get_path_status(pcall_core->papp_snd) == VOICE_CALL_SND_PATH_SPEAKER) { + CALL_ENG_DEBUG(ENG_DEBUG, "we'll not excute sensor in case of speaker mode"); + return FALSE; + } + + return TRUE; +} + gboolean _voicecall_dvc_proximity_sensor_deinit(void) { CALL_ENG_DEBUG(ENG_DEBUG, ".."); @@ -294,16 +347,11 @@ static void __voicecall_dvc_proximity_sensor_callback_func(unsigned int type, se { int *proxi_state; call_vc_core_state_t *pcall_core = (call_vc_core_state_t *)data; - voicecall_engine_t *pcall_engine = pcall_core->pcall_engine; + voicecall_engine_t *pcall_engine = NULL; CALL_ENG_DEBUG(ENG_DEBUG, ""); - if (pcall_core == NULL) { - CALL_ENG_DEBUG(ENG_ERR, "Wrong pointer for pcall_core"); - return; - } - - if (pcall_core->pcall_engine == NULL) { - CALL_ENG_DEBUG(ENG_ERR, "Wrong pointer for pcall_core->pcall_engine"); + if (__voicecall_dvc_proximity_sensor_is_required(pcall_core) == FALSE) { + CALL_ENG_DEBUG(ENG_DEBUG, "Proximity sensor update is not required"); return; } @@ -311,21 +359,6 @@ static void __voicecall_dvc_proximity_sensor_callback_func(unsigned int type, se return; } - if (_vc_core_cm_isexists_incoming_call(&(pcall_engine->call_manager)) == TRUE) { - CALL_ENG_DEBUG(ENG_DEBUG, "we'll not excute sensor in case of incoming call"); - return; - } - - if (_vc_core_cm_isexists_connected_call(&(pcall_engine->call_manager)) == FALSE) { - CALL_ENG_DEBUG(ENG_DEBUG, "we'll not excute sensor in case of NO call"); - return; - } - - if (voicecall_snd_get_path_status(pcall_core->papp_snd) == VOICE_CALL_SND_PATH_SPEAKER) { - CALL_ENG_DEBUG(ENG_DEBUG, "we'll not excute sensor in case of speaker mode"); - return; - } - proxi_state = (int *)(event->event_data); switch (*proxi_state) { case PROXIMITY_STATE_FAR: diff --git a/call-engine/voice-call-sound.c b/call-engine/voice-call-sound.c index df2c751..8482f35 100755 --- a/call-engine/voice-call-sound.c +++ b/call-engine/voice-call-sound.c @@ -160,15 +160,6 @@ static gboolean __voicecall_snd_increasing_melody_cb(void *data); */ static gboolean __voicecall_snd_play_melody(voicecall_snd_mgr_t *papp_snd, gboolean bis_increasing); -/** -* This function sets the mm player volume according to the settings volume level -* -* @return void -* @param[in] papp_snd Handle to the Sound Manager -* @param[in] bis_increasing TRUE if incremntal melody type, FALSE otherwise -*/ -static void __voicecall_snd_set_mm_volume(voicecall_snd_mgr_t *papp_snd, int bis_increasing); - /** * This function retreives the tapi sound path to be used according to the current status * @@ -463,19 +454,9 @@ gboolean voicecall_snd_mute_alert(voicecall_snd_mgr_t *papp_snd) CALL_ENG_DEBUG(ENG_DEBUG, "..\n"); if (papp_snd->pmm_player != VOICE_CALL_SND_INVALID_PLAYER_HANDLE) { int ret_value = 0; - int volume_val; ret_value = mm_player_set_mute(papp_snd->pmm_player, TRUE); CALL_ENG_DEBUG(ENG_DEBUG, "MM Set Mute Error code: [0x%x] \n", ret_value); - - /*This is a patch as set_mute function is not working */ - CALL_ENG_DEBUG(ENG_DEBUG, "Setting Volume Level to 0:\n"); - volume_val = 0; - - ret_value = mm_sound_volume_set_value(VOLUME_TYPE_RINGTONE, volume_val); - if (MM_ERROR_NONE != ret_value) { - CALL_ENG_DEBUG(ENG_ERR, "Set Volume Error: [0x%x]\n", ret_value); - } } if (TRUE == papp_snd->bvibration) { @@ -1247,9 +1228,6 @@ static gboolean __voicecall_snd_start_melody(voicecall_snd_mgr_t *papp_snd, gboo papp_snd->pmm_player = VOICE_CALL_SND_INVALID_PLAYER_HANDLE; __voicecall_snd_create_player(papp_snd, &papp_snd->pmm_player, VOICE_CALL_PLAY_TYPE_RINGTONE); - /*Set Volume */ - __voicecall_snd_set_mm_volume(papp_snd, bis_increasing); - papp_snd->ringtone_sound_status = VOICE_CALL_SND_STATUS_READY; return TRUE; @@ -1304,46 +1282,6 @@ static gboolean __voicecall_snd_create_player(voicecall_snd_mgr_t *papp_snd, MMH return TRUE; } -static void __voicecall_snd_set_mm_volume(voicecall_snd_mgr_t *papp_snd, int bis_increasing) -{ - int ret_value = 0; - int set_volume_level = VOICE_CALL_VOL_LEVEL_1; - int volume_val; - - CALL_ENG_DEBUG(ENG_DEBUG, "..\n"); - - /*Get the settings current ringtone volume level and set to media player */ - if (FALSE == vconf_get_int(VCONFKEY_SETAPPL_CALL_RINGTONE_SOUND_VOLUME_INT, &set_volume_level)) { - CALL_ENG_DEBUG(ENG_ERR, "settings read failed Error: %d\n", ret_value); - } - CALL_ENG_DEBUG(ENG_DEBUG, "Settings Volume Level = %d\n", set_volume_level); - - if (set_volume_level > 0) { - if (TRUE == bis_increasing) { - papp_snd->increment_melody_value = set_volume_level = 1; - } - } else { - CALL_ENG_DEBUG(ENG_DEBUG, "Increasing melody not set to VOICE_CALL_VOL_LEVEL_1 \n"); - } - -#ifdef VOICE_CALL_RINGTONE_ELEVATOR - if (set_volume_level > VOICE_CALL_SND_INITIAL_VOL_LEVEL) { - volume_val = VOICE_CALL_SND_INITIAL_VOL_LEVEL; - } else { - volume_val = set_volume_level; - } -#else - volume_val = set_volume_level; -#endif - ret_value = mm_sound_volume_set_value(VOLUME_TYPE_RINGTONE, volume_val); - if (MM_ERROR_NONE != ret_value) { - CALL_ENG_DEBUG(ENG_ERR, "Set Volume Error: [0x%x]\n", ret_value); - } else { - CALL_ENG_DEBUG(ENG_DEBUG, "Final Volume Set to [%d]\n", volume_val); - } - -} - static gboolean __voicecall_snd_play_melody(voicecall_snd_mgr_t *papp_snd, gboolean bis_increasing) { CALL_ENG_DEBUG(ENG_DEBUG, "..\n"); diff --git a/ui/vcui-view-elements.c b/ui/vcui-view-elements.c index d445a98..ecf8792 100755 --- a/ui/vcui-view-elements.c +++ b/ui/vcui-view-elements.c @@ -959,34 +959,7 @@ Evas_Object *_vcui_create_button_second_incoming_end_all_and_accept(void *data, Evas_Object *_vcui_show_wallpaper_image(Evas_Object *contents) { - Evas_Object *d_image; - Evas_Object *sw; - - char *path = NULL; - if (!path) { - path = vconf_get_str(VCONFKEY_BGSET); - if (!path) { - CALL_UI_DEBUG("BG vconf is NULL"); - path = BG_DEFAULT_PATH; - } - } - CALL_UI_DEBUG("path:[%s]", path); - - sw = edje_object_part_swallow_get(_EDJ(contents), "swl_cid_background"); - if (sw) { - edje_object_part_unswallow(_EDJ(contents), sw); - evas_object_del(sw); - } - - d_image = elm_image_add(contents); - if (path) { - elm_image_file_set(d_image, path, NULL); - free(path); - path = NULL; - } - elm_object_part_content_set(contents, "swl_cid_background", d_image); - - return d_image; + return NULL; } Evas_Object *_vcui_show_calling_name_bg(Evas_Object *contents)