res = _callui_sdm_set_speaker_state(ad->sound_manager, !speaker_status);
if (res != CALLUI_RESULT_OK) {
- err("_callui_sdm_set_speaker_state() failed. res[%d]", res);
+ err("Set speaker state [%s] failed. res[%d]", ((!speaker_status)?"ON":"OFF"), res);
}
}
callui_app_data_t *ad = (callui_app_data_t *)data;
- callui_result_e res = _callui_sdm_set_mute_state(ad->sound_manager,
- !_callui_sdm_get_mute_state(ad->sound_manager));
+ bool mute_state = _callui_sdm_get_mute_state(ad->sound_manager);
+ callui_result_e res = _callui_sdm_set_mute_state(ad->sound_manager, !mute_state);
if (res != CALLUI_RESULT_OK) {
- err("_callui_sdm_set_mute_state() failed. res[%d]", res);
+ err("Set mute state [%s] failed. res[%d]", ((!mute_state)?"ON":"OFF"), res);
}
}
static callui_result_e __callui_plm_init_sensor_listener(_callui_proximity_lock_manager_h plm_h);
static void __callui_plm_deinit_sensor_listener(_callui_proximity_lock_manager_h plm_h);
static bool __callui_plm_check_need_to_turn_off_display(_callui_proximity_lock_manager_h plm_h, const callui_display_state_e *display_state);
-static bool __callui_plm_check_need_to_turn_on_display(_callui_proximity_lock_manager_h plm_h, const callui_display_state_e *display_state);
static void __callui_plm_audio_state_changed_cb(void *user_data, callui_audio_state_type_e audio_state)
{
dbg("Ignore. Initial callback");
break;
}
-
dbg("Handsfree mode [OFF]");
plm_h->running_flags &= ~CALLUI_PLM_STATE_HANDSFREE_MODE;
- dbg("Proximity sensor current proximity_distance [%.1f]", plm_h->proximity_distance);
-
- callui_display_state_e display_state = CALLUI_DISPLAY_NORMAL;
- _callui_display_get_state(plm_h->base.ad->display, &display_state);
-
- /* XXX: This logic will work when Call UI is as in foreground and in background.
- * Need API to detect top window for understand whether it is Call UI or not
- * to operate this mechanism only when Call UI is in foreground
- */
- if (__callui_plm_check_need_to_turn_on_display(plm_h, &display_state)) {
- __callui_plm_set_lcd_state(plm_h, CALLUI_PLM_LCD_ON);
- } else if (__callui_plm_check_need_to_turn_off_display(plm_h, &display_state) && _callui_common_is_app_foreground()) {
+ if (__callui_plm_check_need_to_turn_off_display(plm_h, NULL) && _callui_common_is_app_foreground()) {
__callui_plm_set_lcd_state(plm_h, CALLUI_PLM_LCD_OFF);
- } else if (display_state == CALLUI_DISPLAY_OFF) {
- plm_h->lcd_state = CALLUI_PLM_LCD_OFF;
- } else {
- plm_h->lcd_state = CALLUI_PLM_LCD_ON;
}
break;
}
plm_h->cb_data = data;
}
-static bool __callui_plm_check_need_to_turn_on_display(_callui_proximity_lock_manager_h plm_h, const callui_display_state_e *display_state)
-{
- callui_display_state_e d_state = CALLUI_DISPLAY_NORMAL;
- if (!display_state) {
- _callui_display_get_state(plm_h->base.ad->display, &d_state);
- } else {
- d_state = *display_state;
- }
- return (d_state == CALLUI_DISPLAY_OFF && plm_h->proximity_distance > 0.0 && !plm_h->running_flags);
-}
-
static bool __callui_plm_check_need_to_turn_off_display(_callui_proximity_lock_manager_h plm_h, const callui_display_state_e *display_state)
{
callui_display_state_e d_state = CALLUI_DISPLAY_NORMAL;
char *uri_bundle = NULL;
char *operation = NULL;
- if (_callui_vm_get_cur_view_type(ad->view_manager) == CALLUI_VIEW_UNDEFINED
- && !ad->waiting_dialing) {
- err("CALLUI_VIEW_UNDEFINED. Clear data");
+ if (_callui_vm_get_cur_view_type(ad->view_manager) == CALLUI_VIEW_UNDEFINED && !ad->waiting_dialing) {
ad->on_background = false;
_callui_display_set_control_state(ad->display, CALLUI_DISPLAY_CONTROL_OFF_SLEEP_LOCK);
}