From: Igor Olshevskyi Date: Thu, 13 Oct 2016 14:00:19 +0000 (+0300) Subject: TizenRefApp-7427 [Call UI] Remove logic of turning on screen by proximity sensor... X-Git-Tag: submit/tizen/20161017.141717~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F76%2F92176%2F2;p=profile%2Fmobile%2Fapps%2Fnative%2Fcall-ui.git TizenRefApp-7427 [Call UI] Remove logic of turning on screen by proximity sensor state check on exit handsfree mode Change-Id: I9ec9c6530beea30a7a8cf0e4a81eabb89bb73599 --- diff --git a/src/callui-action-bar.c b/src/callui-action-bar.c index a96755d..3a729ae 100644 --- a/src/callui-action-bar.c +++ b/src/callui-action-bar.c @@ -144,7 +144,7 @@ static void __speaker_btn_click_cb(void *data, Evas_Object *obj, void *event_inf 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); } } @@ -208,10 +208,10 @@ static void __mute_btn_click_cb(void *data, Evas_Object *obj, void *event_info) 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); } } diff --git a/src/callui-proximity-lock-manager.c b/src/callui-proximity-lock-manager.c index b249d5f..335de5e 100644 --- a/src/callui-proximity-lock-manager.c +++ b/src/callui-proximity-lock-manager.c @@ -76,7 +76,6 @@ static void __callui_plm_set_init_running_state(_callui_proximity_lock_manager_h 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) { @@ -111,27 +110,11 @@ static void __callui_plm_audio_state_changed_cb(void *user_data, callui_audio_st 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; } @@ -430,17 +413,6 @@ static void __callui_plm_set_callback_on_unlock(callui_lock_manager_h lock_h, un 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; diff --git a/src/callui.c b/src/callui.c index e03aa7d..f835d63 100755 --- a/src/callui.c +++ b/src/callui.c @@ -599,9 +599,7 @@ static void __app_service(app_control_h app_control, void *data) 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); }