callui_app_data_t *ad = data;
+ DELETE_ECORE_TIMER(ad->app_state_check_timer);
+
_callui_indicator_set_locked(ad->indicator, false);
_callui_indicator_set_active(ad->indicator, false);
debug_enter();
callui_view_type_e view_type = _callui_vm_get_cur_view_type(ad->view_manager);
-
- const callui_call_data_t *active = _callui_stp_get_call_data(ad->state_provider,
- CALLUI_CALL_DATA_ACTIVE);
-
- int is_powerkey_enabled = _callui_common_is_powerkey_ending_call_mode_on();
- dbg("End call with power key [%s]", is_powerkey_enabled ? "ON":"OFF");
-
+ const callui_call_data_t *active = _callui_stp_get_call_data(ad->state_provider, CALLUI_CALL_DATA_ACTIVE);
callui_display_state_e state;
- if (_callui_display_get_state(ad->display, &state) == CALLUI_RESULT_OK
- && state != CALLUI_DISPLAY_OFF && is_powerkey_enabled) {
+
+ if (_callui_common_is_powerkey_ending_call_mode_on()) {
if (view_type == CALLUI_VIEW_DIALLING) {
if (active) {
- _callui_manager_end_call(ad->call_manager, active->call_id,
- CALLUI_CALL_RELEASE_BY_CALL_HANDLE);
+ _callui_manager_end_call(ad->call_manager, active->call_id, CALLUI_CALL_RELEASE_BY_CALL_HANDLE);
}
} else if (view_type == CALLUI_VIEW_SINGLECALL ||
view_type == CALLUI_VIEW_MULTICALL_CONF) {
} else if (view_type == CALLUI_VIEW_INCOMING_CALL_NOTI) {
_callui_vm_change_view(ad->view_manager, CALLUI_VIEW_INCOMING_CALL);
}
- } else {
+ } else if (_callui_display_get_state(ad->display, &state) == CALLUI_RESULT_OK && state != CALLUI_DISPLAY_OFF) {
dbg("Power key to lock device [UP]");
- const callui_call_data_t *incom = _callui_stp_get_call_data(ad->state_provider,
- CALLUI_CALL_DATA_INCOMING);
- const callui_call_data_t *held = _callui_stp_get_call_data(ad->state_provider,
- CALLUI_CALL_DATA_HELD);
+ const callui_call_data_t *incom = _callui_stp_get_call_data(ad->state_provider, CALLUI_CALL_DATA_INCOMING);
+ const callui_call_data_t *held = _callui_stp_get_call_data(ad->state_provider, CALLUI_CALL_DATA_HELD);
if (incom && !active && !held) {
- callui_view_type_e type = CALLUI_VIEW_INCOMING_CALL;
- callui_view_type_e cur_type = _callui_vm_get_cur_view_type(ad->view_manager);
- if (_callui_common_get_idle_lock_type() == CALLUI_LOCK_TYPE_UNLOCK &&
- (cur_type == CALLUI_VIEW_UNDEFINED || cur_type == CALLUI_VIEW_ENDCALL)
+ callui_view_type_e new_view_type = CALLUI_VIEW_INCOMING_CALL;
+ if ((view_type == CALLUI_VIEW_UNDEFINED || view_type == CALLUI_VIEW_ENDCALL)
+ && _callui_common_get_idle_lock_type() == CALLUI_LOCK_TYPE_UNLOCK
&& !_callui_dpm_is_need_enforce_change_password(ad->dpm)) {
- type = CALLUI_VIEW_INCOMING_CALL_NOTI;
+ new_view_type = CALLUI_VIEW_INCOMING_CALL_NOTI;
}
- _callui_vm_change_view(ad->view_manager, type);
+ _callui_vm_change_view(ad->view_manager, new_view_type);
}
}