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);
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");
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, "..");
{
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;
}
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:
*/
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
*
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) {
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;
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");
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)