From: Igor Olshevskyi Date: Wed, 5 Oct 2016 10:47:56 +0000 (+0300) Subject: Merge branch 'tizen' into tizen_dev X-Git-Tag: submit/tizen/20161005.160256^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6023fb78ab35fe4bcdc0af1e5725c45b0501dc20;p=profile%2Fmobile%2Fapps%2Fnative%2Fcall-ui.git Merge branch 'tizen' into tizen_dev Conflicts: edje_src/edc/call_edc/callui-view-lock-screen.edc edje_src/edc/callui-view-end-call.edc src/callui-touch-lock-manager.c Change-Id: Iee3a58211386e8226696017e8fe937c03a9e78d8 --- 6023fb78ab35fe4bcdc0af1e5725c45b0501dc20 diff --cc src/callui-keypad.c index db01567,60d7deb..4acd6b7 --- a/src/callui-keypad.c +++ b/src/callui-keypad.c @@@ -25,9 -25,9 +25,10 @@@ #include "callui-view-elements.h" #include "callui-view-layout.h" #include "callui-sound-manager.h" +#include "callui-listeners-collection.h" - #define CALLUI_GROUP_KEYPAD "keypad" + #define CALLUI_LY_STYLE_KEYPAD "keypad" + #define CALLUI_LY_STYLE_KEYPAD_BTNS "keypad_btns" #define CALLUI_PART_SWALLOW_TEXT_AREA "swallow.textarea" #define CALLUI_PART_SWALLOW_KEYPAD "swallow.keypad_region" #define CALLUI_PART_SWALLOW_KEYPAD_LAYOUT_AREA "swallow.keypad_layout_area" diff --cc src/callui-touch-lock-manager.c index 4fb0815,fcf8b1c..744897e --- a/src/callui-touch-lock-manager.c +++ b/src/callui-touch-lock-manager.c @@@ -40,131 -36,48 +40,132 @@@ struct __touch_lock_manager Evas_Object *hit_rect; Ecore_Timer *no_lock_timer; bool is_locked; + bool was_incomming_call; + bool was_handsfree_mode; }; -typedef struct __touch_lock_manager __callui_touch_lock_manager_t; +typedef struct __touch_lock_manager __callui_tlm_t; + #define CALLUI_LY_STYLE_TOUCH_LOCK_SCREEN "touch_lock_screen" + -static callui_result_e __callui_touch_lock_manager_create(callui_lock_manager_h lock_h, callui_app_data_t *ad); -static void __callui_touch_lock_manager_start(callui_lock_manager_h lock_h); -static void __callui_touch_lock_manager_stop(callui_lock_manager_h lock_h, bool force); -static bool __callui_touch_lock_manager_is_lcd_off(callui_lock_manager_h lock_h); -static void __callui_touch_lock_manager_set_callback_on_unlock(callui_lock_manager_h lock_h, unlock_cb_t callback, void* data){}; -static bool __callui_touch_lock_manager_is_lockscreen_shown(callui_lock_manager_h tlm_h); -static void __callui_touch_lock_manager_destroy(callui_lock_manager_h lock_h); - -static void __callui_touch_lock_manager_start_timer(_callui_touch_lock_manager_h tlm_h); -static void __callui_touch_lock_manager_stop_timer(_callui_touch_lock_manager_h tlm_h); -static bool __callui_touch_lock_manager_create_layout(_callui_touch_lock_manager_h tlm_h); -static void __callui_touch_lock_manager_show_layout(_callui_touch_lock_manager_h tlm_h); -static void __callui_touch_lock_manager_hide_layout(_callui_touch_lock_manager_h tlm_h); - -static void __callui_touch_lock_manager_show_layout(_callui_touch_lock_manager_h tlm_h) +static callui_result_e __callui_tlm_create(callui_lock_manager_h lock_h, callui_app_data_t *ad); +static void __callui_tlm_resume(callui_lock_manager_h lock_h); +static void __callui_tlm_pause(callui_lock_manager_h lock_h, bool force); +static bool __callui_tlm_is_running(callui_lock_manager_h lock_h); +static void __callui_tlm_destroy(callui_lock_manager_h lock_h); + +static callui_result_e __callui_tlm_ui_elements(_callui_touch_lock_manager_h tlm_h); +static void __callui_tlm_lock(_callui_touch_lock_manager_h tlm_h); +static void __callui_tlm_unlock(_callui_touch_lock_manager_h tlm_h); +static void __callui_tlm_update_state(_callui_touch_lock_manager_h tlm_h); - +static Eina_Bool __callui_tlm_lock_timeout_cb(void *data); +static void __callui_tlm_call_state_event_cb(void *user_data, callui_call_event_type_e call_event_type, unsigned int call_id, callui_sim_slot_type_e sim_type, void *event_info); +static void __callui_tlm_keypad_show_state_change_cd(void *data, Eina_Bool is_visible); + +static void __callui_tlm_audio_state_changed_cb(void *user_data, callui_audio_state_type_e audio_state) { - debug_enter(); + CALLUI_RETURN_IF_FAIL(user_data); + + _callui_touch_lock_manager_h tlm_h = user_data; + switch (audio_state) { + case CALLUI_AUDIO_STATE_SPEAKER: + case CALLUI_AUDIO_STATE_EARJACK: + case CALLUI_AUDIO_STATE_BT: + tlm_h->was_handsfree_mode = true; + DELETE_ECORE_TIMER(tlm_h->no_lock_timer); + if (tlm_h->is_locked) { + __callui_tlm_unlock(tlm_h); + } + break; + case CALLUI_AUDIO_STATE_RECEIVER: + if (tlm_h->was_handsfree_mode) { + tlm_h->was_handsfree_mode = false; + __callui_tlm_lock(tlm_h); + } else { + __callui_tlm_update_state(tlm_h); + } + break; + default: + break; + } +} +static void __callui_tlm_call_state_event_cb(void *user_data, callui_call_event_type_e call_event_type, unsigned int call_id, callui_sim_slot_type_e sim_type, void *event_info) +{ + CALLUI_RETURN_IF_FAIL(user_data); + + __callui_tlm_update_state(user_data); +} + +static void __callui_tlm_update_state(_callui_touch_lock_manager_h tlm_h) +{ CALLUI_RETURN_IF_FAIL(tlm_h); - callui_audio_state_type_e audio_state = _callui_sdm_get_audio_state(tlm_h->base.ad->sound_manager); - if (audio_state == CALLUI_AUDIO_STATE_SPEAKER) { - dbg("Speaker ON. Do not display lockscreen."); - return; - } - if (EINA_TRUE == _callui_keypad_get_show_status(tlm_h->base.ad->keypad)) { - dbg("Keypad is ON. Do not display lockscreen."); - return; + const callui_call_data_t *active = _callui_stp_get_call_data(tlm_h->base.ad->state_provider, CALLUI_CALL_DATA_ACTIVE); + const callui_call_data_t *held = _callui_stp_get_call_data(tlm_h->base.ad->state_provider, CALLUI_CALL_DATA_HELD); + const callui_call_data_t *incom = _callui_stp_get_call_data(tlm_h->base.ad->state_provider, CALLUI_CALL_DATA_INCOMING); + + Eina_Bool is_keypad_shown = _callui_keypad_get_show_status(tlm_h->base.ad->keypad); + + dbg("Touch lockscreen [%s]", tlm_h->is_locked? "ON":"OFF"); + + if (_callui_stp_is_any_calls_available(tlm_h->base.ad->state_provider)) { + dbg("Any calls available"); + if (tlm_h->base.ad->on_background && !tlm_h->is_locked) { + dbg("Ignore. Application is on background"); + } else if (is_keypad_shown) { + dbg("Ignore. Keypad is shown"); + } else if (_callui_common_is_handsfree_mode_on(tlm_h->base.ad)) { + dbg("Ignore. Handsfree mode"); + } else { + DELETE_ECORE_TIMER(tlm_h->no_lock_timer); + if (incom) { + dbg("Incoming call"); + if (tlm_h->is_locked) { + __callui_tlm_unlock(tlm_h); + } + tlm_h->was_incomming_call = true; + return; + } else if (active && active->is_dialing) { + dbg("Active call. Dialing mode"); + if (tlm_h->is_locked) { + __callui_tlm_unlock(tlm_h); + } + tlm_h->no_lock_timer = ecore_timer_add(CALLUI_TLM_DURING_CALL_LOCK_TIMEOUT_SEC, __callui_tlm_lock_timeout_cb, tlm_h); + } else if (active || held) { + dbg("Active or Held call"); + if (tlm_h->was_incomming_call) { + dbg("Incoming call was before"); + __callui_tlm_lock(tlm_h); + } else { + tlm_h->no_lock_timer = ecore_timer_add(CALLUI_TLM_DEFAULT_LOCK_TIMEOUT_SEC, __callui_tlm_lock_timeout_cb, tlm_h); + } + } + } + tlm_h->was_incomming_call = false; + } else { + dbg("No calls available"); + DELETE_ECORE_TIMER(tlm_h->no_lock_timer); + if (tlm_h->is_locked) { + __callui_tlm_unlock(tlm_h); + } } +} + +static void __callui_tlm_lock(_callui_touch_lock_manager_h tlm_h) +{ + debug_enter(); + + CALLUI_RETURN_IF_FAIL(tlm_h); - evas_object_raise(tlm_h->layout); + elm_object_part_content_set(_callui_vm_get_main_ly(tlm_h->base.ad->view_manager), "elm.swallow.touchlock", tlm_h->layout); evas_object_show(tlm_h->layout); + tlm_h->is_locked = true; + #ifdef _DBUS_DISPLAY_DEVICE_TIMEOUT_ if (_callui_vm_get_cur_view_type(tlm_h->base.ad->view_manager) != CALLUI_VIEW_DIALLING) { - dbg("lcd show"); + dbg("Update display timeout [Lock]"); _callui_display_set_timeout(tlm_h->base.ad->display, CALLUI_DISPLAY_TIMEOUT_LS_SET); } #endif @@@ -250,9 -163,9 +251,9 @@@ static callui_result_e __callui_tlm_ui_ evas_object_show(hit_rect); tlm_h->hit_rect = hit_rect; - /* Touch lockscreen layout */ - Evas_Object *layout = _callui_load_edj(_callui_vm_get_main_ly(ad->view_manager), CALLUI_CALL_EDJ_PATH, "lock-screen"); - CALLUI_RETURN_VALUE_IF_FAIL(layout, CALLUI_RESULT_FAIL); - layout = _callui_create_layout(_callui_vm_get_main_ly(ad->view_manager), CALLUI_LY_STYLE_TOUCH_LOCK_SCREEN); ++ Evas_Object *layout = _callui_create_layout(_callui_vm_get_main_ly(ad->view_manager), CALLUI_LY_STYLE_TOUCH_LOCK_SCREEN); + CALLUI_RETURN_VALUE_IF_FAIL(layout, false); + evas_object_resize(layout, ad->root_w, ad->root_h); evas_object_move(layout, 0, 0); elm_object_translatable_part_text_set(layout, "lock-text", "IDS_CALL_NPBODY_DOUBLE_TAP_THE_LOCK_ICON_TO_UNLOCK_YOUR_DEVICE"); diff --cc src/callui-view-incoming-call.c index ae7abfc,ff00ca0..13dc189 --- a/src/callui-view-incoming-call.c +++ b/src/callui-view-incoming-call.c @@@ -122,10 -123,15 +123,11 @@@ static callui_result_e __callui_view_in vd->base_view.ad = ad; - if (_callui_lock_manager_is_started(ad->lock_manager)) { - _callui_lock_manager_force_stop(ad->lock_manager); - } - _callui_window_set_size_type(ad->window, CALLUI_WIN_SIZE_FULLSCREEN); _callui_window_set_rotation_locked(ad->window, true); + _callui_window_hide_quickpanel(ad->window); - if (_callui_window_set_keygrab_mode(ad->window, CALLUI_KEY_SELECT, CALLUI_WIN_KEYGRAB_TOPMOST) != CALLUI_RESULT_OK) { + if (_callui_window_set_keygrab_mode(ad->window, CALLUI_KEY_HOME, CALLUI_WIN_KEYGRAB_TOPMOST) != CALLUI_RESULT_OK) { dbg("KEY_SELECT key grab failed"); }