TizenRefApp-7047 [Call UI] Fix issue with end call with power button mode 93/86093/2
authorIgor Olshevskyi <i.olshevskyi@samsung.com>
Tue, 30 Aug 2016 12:27:50 +0000 (15:27 +0300)
committerIgor Olshevskyi <i.olshevskyi@samsung.com>
Tue, 30 Aug 2016 12:29:16 +0000 (15:29 +0300)
Change-Id: I7095cd17119ec646c1d5f16da7998bde1abb9ccd

src/callui-common.c
src/callui-display.c
src/callui.c

index 0c7905b..8e8da12 100755 (executable)
@@ -463,16 +463,6 @@ static void __lock_state_changed_cb(system_settings_key_e key, void *user_data)
                _check_and_try_make_delayed_app_launch_request(ad);
        } else {
                dbg("Device lock state [LOCKED]");
-               if (!ad->on_background) {
-                       dbg("App on background [NO]");
-               } else {
-                       dbg("App on background [YES]");
-
-                       if (_callui_lock_manager_is_started(ad->lock_handle)) {
-                               _callui_lock_manager_stop(ad->lock_handle);
-                               ad->start_lock_manager_on_resume = true;
-                       }
-               }
        }
        debug_leave();
 }
index 47d0031..ac02710 100644 (file)
@@ -330,7 +330,7 @@ callui_result_e _callui_display_get_state(callui_display_h disp, callui_display_
 
        switch (disp_state) {
        case DISPLAY_STATE_NORMAL:
-               dbg("Display screen state [ON]");
+               dbg("Display screen state [NORMAL]");
                *state = CALLUI_DISPLAY_NORMAL;
                break;
        case DISPLAY_STATE_SCREEN_DIM:
index 4052152..d8af979 100755 (executable)
@@ -612,6 +612,8 @@ static void __app_resume(void *data)
 
        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);
 
@@ -727,20 +729,13 @@ static void __process_power_key_up(callui_app_data_t *ad)
        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) {
@@ -751,23 +746,20 @@ static void __process_power_key_up(callui_app_data_t *ad)
                } 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);
                }
        }