styles {
style {
name: "lock_screen_txt_style";
- base: "font="VC_FONT_REGULAR" font_size=40 color=#FFFFFF color_class:"ATO011" align=center text_class="ATO011" wrap=mixed";
+ base: "font="VC_FONT_REGULAR" font_size=40 color=#FFFFFF color_class:"ATO011" align=center wrap=word";
tag: "br" "\n";
tag: "tab" "\t";
}
images {
image: IMG_SRC_DIR/"call_lock_icon.png" COMP;
image: IMG_SRC_DIR/"call_bg_dim.png" COMP;
+ image: IMG_SRC_DIR/"background_dim.png" COMP;
}
parts {
- part { name: "background";
+ part { name: "bg_dim_core";
type: IMAGE;
scale: 1;
description {
state: "default" 0.0;
- image {
- normal: IMG_SRC_DIR/"call_bg_dim.png";
- }
+ image.normal: IMG_SRC_DIR/"background_dim.png";
aspect_preference: BOTH;
align: 0.0 0.0;
- visible: 1;
}
}
-
- part {
- name: "lock-icon";
+ part { name: "bg_dim_app";
+ type: IMAGE;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ image.normal: IMG_SRC_DIR/"call_bg_dim.png";
+ aspect_preference: BOTH;
+ align: 0.0 0.0;
+ }
+ }
+ part { name: "lock-icon";
type: IMAGE;
scale: 1;
mouse_events: 1;
description {
state: "default" 0.0;
visible: 1;
- rel1 {relative: LOCK_SCREEN_ICON_L LOCK_SCREEN_ICON_T; to: background; }
- rel2 {relative: LOCK_SCREEN_ICON_R LOCK_SCREEN_ICON_B; to: background; }
+ rel1 { relative: LOCK_SCREEN_ICON_L LOCK_SCREEN_ICON_T; to: "bg_dim_core"; }
+ rel2 { relative: LOCK_SCREEN_ICON_R LOCK_SCREEN_ICON_B; to: "bg_dim_core"; }
image.normal: IMG_SRC_DIR/"call_lock_icon.png";
aspect_preference: SOURCE;
}
}
-
- part {
- name: "lock-text";
+ part { name: "lock-text";
type: TEXTBLOCK;
scale: 1;
description {
state: "default" 0.0;
visible: 1;
- rel1 {relative: LOCK_SCREEN_TEXT_L LOCK_SCREEN_TEXT_T; to: background; }
- rel2 {relative: LOCK_SCREEN_TEXT_R LOCK_SCREEN_TEXT_B; to: background; }
- text {
- style: "lock_screen_txt_style";
- text_class: "ATO011";
- align: 0 0;
- }
+ rel1 { relative: LOCK_SCREEN_TEXT_L LOCK_SCREEN_TEXT_T; to: "bg_dim_core"; }
+ rel2 { relative: LOCK_SCREEN_TEXT_R LOCK_SCREEN_TEXT_B; to: "bg_dim_core"; }
+ text.style: "lock_screen_txt_style";
color_class: "ATO011";
}
}
}
}
-
rel2 { relative: 1.0 1.0; to: "keypadarea.clipper"; }
}
)
+ CU_PART_SWALLOW( "elm.swallow.touchlock",
+ description { state: "default" 0.0; }
+ )
}
programs {
program { name: "anim_minimize_main_clipper";
void _callui_common_process_accept_incoming_call(void *appdata);
/**
- * @brief Get the support status of proximity sensor
+ * @brief Gets the support status of proximity sensor
*
* @return true when proximity sensor is supported, otherwise false
*/
bool _callui_common_is_proximity_sensor_supported();
+/**
+ * @brief Gets the handsfree mode status
+ *
+ * @param[in] appdata Application data
+ *
+ * @return @c true when call is on handsfree mode, otherwise false
+ */
+bool _callui_common_is_on_handsfree_mode(void *appdata);
+
#endif /*__CALLUI_COMMON_H_ */
*/
void _callui_keypad_hide_immediately(callui_keypad_h keypad);
+
/**
* @brief Adds keypad show status change callback
*
* @param[in] keypad Keypad handle
- * @param[in] cb_func Callback function
- * @param[in] cb_data Callback data
+ * @param[in] cb_func User callback function
+ * @param[in] cb_data User callback data
+ *
+ * @return CALLUI_RESULT_OK on success or another result otherwise
+ */
+callui_result_e _callui_keypad_add_show_status_change_cb(callui_keypad_h keypad,
+ show_state_change_cd cb_func, void *cb_data);
+
+/**
+ * @brief Removes keypad show status change callback
+ *
+ * @param[in] keypad Keypad handle
+ * @param[in] cb_func User callback function
+ * @param[in] cb_data User callback data
+ *
+ * @return CALLUI_RESULT_OK on success or another result otherwise
*/
-void _callui_keypad_show_status_change_callback_set(callui_keypad_h keypad,
- show_state_change_cd cb_func,
- void *cb_data);
+callui_result_e _callui_keypad_remove_show_status_change_cb(callui_keypad_h keypad,
+ show_state_change_cd cb_func, void *cb_data);
#endif /* __CALLUI_VIEW_KEYPAD_H__ */
typedef callui_result_e (*lock_create) (callui_lock_manager_h lock_h, callui_app_data_t *ad);
/**
- * @brief Called when lock manager starts
+ * @brief Called when lock manager resumes
*/
-typedef void (*lock_start) (callui_lock_manager_h lock_h);
+typedef void (*lock_resume) (callui_lock_manager_h lock_h);
/**
* @brief Called when need lock status
*/
-typedef bool (*lock_is_started) (callui_lock_manager_h lock_h);
+typedef bool (*lock_is_running) (callui_lock_manager_h lock_h);
/**
- * @brief Called when lock manager stops
+ * @brief Called when lock manager pauses
*/
-typedef void (*lock_stop) (callui_lock_manager_h lock_h, bool force);
+typedef void (*lock_pause) (callui_lock_manager_h lock_h, bool force);
/**
* @brief Called when need lcd status
struct __lock_manager {
lock_create create;
- lock_start start;
- lock_stop stop;
- lock_is_started is_started;
+ lock_resume resume;
+ lock_pause pause;
+ lock_is_running is_running;
lock_is_lcd_off is_lcd_off;
lock_set_unlock_cb set_unlock_cb;
lock_destroy destroy;
*
* @param[in] lock_h The lock manager handle
*/
-void _callui_lock_manager_start(callui_lock_manager_h lock_h);
+void _callui_lock_manager_resume(callui_lock_manager_h lock_h);
/**
* @brief Stops lock manager
*
* @param[in] lock_h The lock manager handle
*/
-void _callui_lock_manager_stop(callui_lock_manager_h lock_h);
-
-/**
- * @brief Force stops lock manager
- *
- * @param[in] lock_h The lock manager handle
- */
-void _callui_lock_manager_force_stop(callui_lock_manager_h lock_h);
+void _callui_lock_manager_pause(callui_lock_manager_h lock_h);
/**
* @brief Gets lock status
*
* @param[in] lock_h The lock manager handle
*
- * @return true when proximity lock manager is started, otherwise false
+ * @return true when proximity lock manager is running, otherwise false
*/
-bool _callui_lock_manager_is_started(callui_lock_manager_h lock_h);
+bool _callui_lock_manager_is_running(callui_lock_manager_h lock_h);
/**
* @brief Destroy lock manager
#define LOCK_SCREEN_LAYER_WIDTH MAIN_SCREEN_W
#define LOCK_SCREEN_LAYER_HEIGHT MAIN_SCREEN_H
-#define LOCK_SCREEN_ICON_TOP_PAD 420
-#define LOCK_SCREEN_ICON_HEIGHT 270
+#define LOCK_SCREEN_ICON_TOP_PAD 455
+#define LOCK_SCREEN_ICON_HEIGHT 242
#define REL_LOCK_SCREEN_W(x) ((x)/LOCK_SCREEN_LAYER_WIDTH)
#define REL_LOCK_SCREEN_H(y) ((y)/LOCK_SCREEN_LAYER_HEIGHT)
#define LOCK_SCREEN_ICON_T REL_LOCK_SCREEN_H(LOCK_SCREEN_ICON_TOP_PAD)
#define LOCK_SCREEN_ICON_B REL_LOCK_SCREEN_H(LOCK_SCREEN_ICON_TOP_PAD+LOCK_SCREEN_ICON_HEIGHT)
-#define LOCK_SCREEN_VERTICAL_GAP 20
-#define LOCK_SCREEN_TEXT_LEFT_PADDING 15
-#define LOCK_SCREEN_TEXT_RIGHT_PADDING 15
-#define LOCK_SCREEN_TEXT_HEIGHT 144
+#define LOCK_SCREEN_VERTICAL_GAP 86
+#define LOCK_SCREEN_TEXT_LEFT_PADDING 32
+#define LOCK_SCREEN_TEXT_RIGHT_PADDING 32
+#define LOCK_SCREEN_TEXT_HEIGHT 160
#define LOCK_SCREEN_TEXT_L REL_LOCK_SCREEN_W(LOCK_SCREEN_TEXT_LEFT_PADDING)
#define LOCK_SCREEN_TEXT_R REL_LOCK_SCREEN_W(LOCK_SCREEN_LAYER_WIDTH-LOCK_SCREEN_TEXT_RIGHT_PADDING)
callui_lock_manager_h lock_manager;
- bool start_lock_manager_on_resume;
bool on_background;
int root_w; /**<Width of a root window */
static bool __bt_device_connected_profile(bt_profile_e profile, void *user_data);
static bool __bt_adapter_bonded_device_cb(bt_device_info_s *device_info, void *user_data);
-static void __try_to_stop_lock_manager(callui_app_data_t *ad);
static void __lock_state_changed_cb (system_settings_key_e key, void *user_data);
static const char *__get_res_path();
static const char *__get_resource(const char *res_name);
}
}
-/**
- * @brief Tries to stop lock manager
- *
- * @param[in] ad App data
- */
-static void __try_to_stop_lock_manager(callui_app_data_t *ad)
-{
- if (_callui_lock_manager_is_started(ad->lock_manager)) {
- _callui_lock_manager_stop(ad->lock_manager);
- ad->start_lock_manager_on_resume = true;
- }
-}
-
static void __app_launch_reply_cb(app_control_h request, app_control_h reply, app_control_result_e result, void *user_data)
{
debug_enter();
CALLUI_RETURN_IF_FAIL(user_data);
- callui_app_data_t *ad = user_data;
- callui_idle_lock_type_t type = _callui_common_get_idle_lock_type();
if (result == APP_CONTROL_RESULT_APP_STARTED) {
+ callui_app_data_t *ad = user_data;
ad->on_background = true;
- } else if (result == APP_CONTROL_RESULT_FAILED) {
- if (ad->start_lock_manager_on_resume && type != CALLUI_LOCK_TYPE_SECURITY_LOCK) {
- _callui_lock_manager_start(ad->lock_manager);
- ad->start_lock_manager_on_resume = false;
- }
}
}
if (type == CALLUI_LOCK_TYPE_SECURITY_LOCK) {
_callui_window_set_above_lockscreen_state(ad->window, false);
}
- __try_to_stop_lock_manager(ad);
if (type != CALLUI_LOCK_TYPE_UNLOCK) {
_callui_common_unlock_swipe_lock();
err("app_control_enable_app_started_result_event() is failed. ret[%d]", ret);
} else if ((ret = app_control_send_launch_request(app_control, reply_func, ad)) != APP_CONTROL_ERROR_NONE) {
err("app_control_send_launch_request() is failed. ret[%d]", ret);
- } else {
- __try_to_stop_lock_manager(ad);
}
if (ret != APP_CONTROL_ERROR_NONE && is_exit_app_needed) {
int ret;
if ((ret = app_control_send_launch_request(ad->delayed_app_control, __app_launch_reply_cb, ad)) != APP_CONTROL_ERROR_NONE) {
err("app_control_send_launch_request() is failed. ret[%d]", ret);
- } else {
- __try_to_stop_lock_manager(ad);
}
app_control_destroy(ad->delayed_app_control);
sensor_is_supported(SENSOR_PROXIMITY, &is_supported);
return is_supported;
}
+
+bool _callui_common_is_on_handsfree_mode(void *appdata)
+{
+ callui_app_data_t *ad = appdata;
+
+ callui_audio_state_type_e type = _callui_sdm_get_audio_state(ad->sound_manager);
+ bool is_mode_on = (type != CALLUI_AUDIO_STATE_RECEIVER && type != CALLUI_AUDIO_STATE_NONE);
+ dbg("Handsfree mode [%s]", is_mode_on?"ON":"OFF");
+ return is_mode_on;
+}
#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_PART_SWALLOW_TEXT_AREA "swallow.textarea"
void *cb_data;
Ecore_Timer *auto_spacing_timer;
+
+ _callui_listeners_coll_t show_status_lc;
};
typedef struct _callui_keypad _callui_keypad_t;
elm_object_part_content_set(keypad->main_layout, CALLUI_PART_SWALLOW_KEYPAD, keypad->btns_layout);
- int res = __create_gesture_layer(keypad);
+ callui_result_e res = _callui_listeners_coll_init(&keypad->show_status_lc);
+ CALLUI_RETURN_VALUE_IF_FAIL(res == CALLUI_RESULT_OK, res);
+
+ res = __create_gesture_layer(keypad);
CALLUI_RETURN_VALUE_IF_FAIL(res == CALLUI_RESULT_OK, res);
res = __create_entry(keypad);
{
DELETE_ECORE_TIMER(keypad->auto_spacing_timer);
+ _callui_listeners_coll_deinit(&keypad->show_status_lc);
+
if (keypad->main_layout) {
evas_object_del(keypad->btns_layout);
}
callui_app_data_t *ad = keypad->ad;
Evas_Object *main_ly = _callui_vm_get_main_ly(ad->view_manager);
- _callui_lock_manager_start(ad->lock_manager);
-
eext_object_event_callback_del(main_ly, EEXT_CALLBACK_BACK, __back_button_click_cb);
keypad->main_layout = elm_object_part_content_unset(main_ly,
evas_object_hide(keypad->main_layout);
- if (keypad->cb_func) {
- keypad->cb_func(keypad->cb_data, keypad->is_keypad_show);
- }
+ _callui_listeners_coll_call_listeners(&keypad->show_status_lc, keypad->is_keypad_show);
}
static Eina_Bool __auto_spacing_timer_cb(void *data)
if (keypad->entry) {
elm_entry_entry_append(keypad->entry, " ");
}
- return ECORE_CALLBACK_DONE;
+ return ECORE_CALLBACK_CANCEL;
}
static void __on_key_down_click_event(void *data, Evas_Object *obj, const char *emission, const char *source)
keypad->is_keypad_show = EINA_TRUE;
- _callui_lock_manager_stop(ad->lock_manager);
-
eext_object_event_callback_add(main_ly, EEXT_CALLBACK_BACK, __back_button_click_cb, keypad);
- if (keypad->cb_func) {
- keypad->cb_func(keypad->cb_data, keypad->is_keypad_show);
- }
+ _callui_listeners_coll_call_listeners(&keypad->show_status_lc, keypad->is_keypad_show);
}
/**
__hide_keypad(keypad, EINA_TRUE);
}
-/**
- * @brief Adds keypad show status change callback
- *
- * @param[in] keypad Keypad handle
- * @param[in] cb_func Callback function
- * @param[in] cb_data Callback data
- */
-void _callui_keypad_show_status_change_callback_set(callui_keypad_h keypad, show_state_change_cd cb_func, void *cb_data)
+static void __keypda_state_change_handler_func(_callui_listener_t *listener, va_list args)
{
- CALLUI_RETURN_IF_FAIL(keypad);
+ bool status = va_arg(args, int);
+ ((mute_state_changed_cb)(listener->cb_func))(listener->cb_data, status);
+}
+
+callui_result_e _callui_keypad_add_show_status_change_cb(callui_keypad_h keypad,
+ show_state_change_cd cb_func, void *cb_data)
+{
+ CALLUI_RETURN_VALUE_IF_FAIL(keypad, CALLUI_RESULT_INVALID_PARAM);
+ CALLUI_RETURN_VALUE_IF_FAIL(cb_func, CALLUI_RESULT_INVALID_PARAM);
- keypad->cb_func = cb_func;
- keypad->cb_data = cb_data;
+ return _callui_listeners_coll_add_listener(&keypad->show_status_lc,
+ __keypda_state_change_handler_func, cb_func, cb_data);
}
+
+callui_result_e _callui_keypad_remove_show_status_change_cb(callui_keypad_h keypad,
+ show_state_change_cd cb_func, void *cb_data)
+{
+ CALLUI_RETURN_VALUE_IF_FAIL(keypad, CALLUI_RESULT_INVALID_PARAM);
+ CALLUI_RETURN_VALUE_IF_FAIL(cb_func, CALLUI_RESULT_INVALID_PARAM);
+
+ return _callui_listeners_coll_remove_listener(&keypad->show_status_lc, (void *)cb_func, cb_data);
+}
+
}
CALLUI_RETURN_NULL_IF_FAIL(lock_h);
- if (lock_h->create(lock_h, ad) == CALLUI_RESULT_FAIL) {
- FREE(lock_h);
+ if (lock_h->create && lock_h->create(lock_h, ad) == CALLUI_RESULT_FAIL) {
+ if (lock_h->destroy) {
+ lock_h->destroy(lock_h);
+ }
+ return NULL;
}
return lock_h;
}
-void _callui_lock_manager_start(callui_lock_manager_h lock_h)
+void _callui_lock_manager_resume(callui_lock_manager_h lock_h)
{
dbg("..");
CALLUI_RETURN_IF_FAIL(lock_h);
-
- callui_audio_state_type_e type = _callui_sdm_get_audio_state(lock_h->ad->sound_manager);
- bool is_on_handsfree_mode = (type != CALLUI_AUDIO_STATE_RECEIVER && type != CALLUI_AUDIO_STATE_NONE);
-
- if (is_on_handsfree_mode || _callui_lock_manager_is_started(lock_h) || lock_h->ad->on_background) {
- return;
+ if (lock_h->resume) {
+ lock_h->resume(lock_h);
+ } else {
+ dbg("Not supported");
}
-
- lock_h->start(lock_h);
-}
-
-void _callui_lock_manager_stop(callui_lock_manager_h lock_h)
-{
- dbg("..");
- CALLUI_RETURN_IF_FAIL(lock_h);
- lock_h->stop(lock_h, false);
}
-void _callui_lock_manager_force_stop(callui_lock_manager_h lock_h)
+void _callui_lock_manager_pause(callui_lock_manager_h lock_h)
{
dbg("..");
CALLUI_RETURN_IF_FAIL(lock_h);
- lock_h->stop(lock_h, true);
+ if (lock_h->pause) {
+ lock_h->pause(lock_h, false);
+ } else {
+ dbg("Not supported");
+ }
}
-bool _callui_lock_manager_is_started(callui_lock_manager_h lock_h)
+bool _callui_lock_manager_is_running(callui_lock_manager_h lock_h)
{
dbg("..");
CALLUI_RETURN_VALUE_IF_FAIL(lock_h, false);
- return lock_h->is_started(lock_h);
+ if (lock_h->is_running) {
+ return lock_h->is_running(lock_h);
+ } else {
+ dbg("Not supported");
+ }
+ return false;
}
void _callui_lock_manager_destroy(callui_lock_manager_h lock_h)
{
dbg("..");
CALLUI_RETURN_IF_FAIL(lock_h);
- lock_h->destroy(lock_h);
+ if (lock_h->destroy) {
+ lock_h->destroy(lock_h);
+ } else {
+ dbg("Not supported");
+ }
}
bool _callui_lock_manager_is_lcd_off(callui_lock_manager_h lock_h)
{
dbg("..");
CALLUI_RETURN_VALUE_IF_FAIL(lock_h, false);
- return lock_h->is_lcd_off(lock_h);
+ if (lock_h->is_lcd_off) {
+ return lock_h->is_lcd_off(lock_h);
+ } else {
+ dbg("Not supported");
+ }
+ return false;
}
void _callui_lock_manager_set_callback_on_unlock(callui_lock_manager_h lock_h, unlock_cb_t callback, void* data)
{
dbg("..");
CALLUI_RETURN_IF_FAIL(lock_h);
- lock_h->set_unlock_cb(lock_h, callback, data);
+ if (lock_h->set_unlock_cb) {
+ lock_h->set_unlock_cb(lock_h, callback, data);
+ } else {
+ dbg("Not supported");
+ }
}
#include "callui-debug.h"
#include "callui-common.h"
#include "callui-common-defines.h"
+#include "callui-state-provider.h"
+#include "callui-sound-manager.h"
#define CALLUI_SENSOR_INTERVAL 100
#define CALLUI_LCD_TURN_ON_DELAY_INTERVAL 0.1
} callui_plm_lcd_state_e;
typedef enum {
- CALLUI_PLM_STATE_UNDEFINED,
- CALLUI_PLM_STATE_STARTED,
- CALLUI_PLM_STATE_SUSPENDED,
- CALLUI_PLM_STATE_STOPPED
+ CALLUI_PLM_STATE_RUNNING,
+ CALLUI_PLM_STATE_PAUSED
} callui_plm_run_state_e;
struct __proximity_lock_manager {
unlock_cb_t unlock_cb;
void *cb_data;
Ecore_Timer *lcd_turn_on_timer;
+ float proximity_distance;
+ bool was_handsfree_mode;
+ bool need_process_cb_in_pause;
};
typedef struct __proximity_lock_manager __callui_proximity_lock_manager_t;
static callui_result_e __callui_proximity_lock_manager_create(callui_lock_manager_h lock_h, callui_app_data_t *ad);
-static void __callui_proximity_lock_manager_start(callui_lock_manager_h lock_h);
-static void __callui_proximity_lock_manager_force_stop(callui_lock_manager_h lock_h, bool force);
-static void __callui_proximity_lock_manager_stop(callui_lock_manager_h lock_h);
-static bool __callui_proximity_lock_manager_is_started(callui_lock_manager_h);
-static void __callui_proximity_lock_manager_destroy(callui_lock_manager_h lock_h);
+static bool __callui_proximity_lock_manager_is_running(callui_lock_manager_h lock_h);
static bool __callui_proximity_lock_manager_is_lcd_off(callui_lock_manager_h lock_h);
+static void __callui_proximity_lock_manager_destroy(callui_lock_manager_h lock_h);
static void __callui_proximity_lock_manager_set_callback_on_unlock(callui_lock_manager_h lock_h, unlock_cb_t callback, void *data);
-static int __callui_proximity_lock_manager_create_listener(_callui_proximity_lock_manager_h plm_h);
-static void __callui_proximity_lock_manager_cb(sensor_h sensor, sensor_event_s *sensor_data, void *user_data);
+static void __callui_proximity_lock_manager_log_run_state(_callui_proximity_lock_manager_h plm_h);
+static void __audio_state_changed_cb(void *user_data, callui_audio_state_type_e audio_state);
+static void __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_proximity_lock_manager_turn_lcd_on(_callui_proximity_lock_manager_h plm_h);
static Eina_Bool __callui_proximity_lock_manager_turn_lcd_on_timer_cb(void *data);
+static void __callui_proximity_lock_manager_cb(sensor_h sensor, sensor_event_s *sensor_data, void *user_data);
+static void __callui_proximity_lock_set_init_running_state(_callui_proximity_lock_manager_h plm_h);
+static callui_result_e __callui_proximity_lock_init_proximity_sensor_listener(_callui_proximity_lock_manager_h plm_h);
+static void __callui_proximity_lock_deinit_proximity_sensor_listener(_callui_proximity_lock_manager_h plm_h);
+
+static void __callui_proximity_lock_manager_log_run_state(_callui_proximity_lock_manager_h plm_h)
+{
+ const char *state_str = NULL;
+ switch (plm_h->run_state) {
+ case CALLUI_PLM_STATE_RUNNING:
+ state_str = "RUNNING";
+ break;
+ case CALLUI_PLM_STATE_PAUSED:
+ state_str = "PAUSED";
+ break;
+ default:
+ state_str = "Incorrect state value";
+ break;
+ }
+ dbg("PLM run state [%s]", state_str);
+}
-static int __callui_proximity_lock_manager_create_listener(_callui_proximity_lock_manager_h plm_h)
+static void __audio_state_changed_cb(void *user_data, callui_audio_state_type_e audio_state)
{
- dbg("..");
- int ret = SENSOR_ERROR_NONE;
- CALLUI_RETURN_VALUE_IF_FAIL(plm_h, SENSOR_ERROR_INVALID_PARAMETER);
- ret = sensor_create_listener(plm_h->sensor, &plm_h->sensor_listener);
- if (ret != SENSOR_ERROR_NONE) {
- err("sensor_create_listener() failed(%d)", ret);
- return ret;
+ debug_enter();
+
+ CALLUI_RETURN_IF_FAIL(user_data);
+
+ _callui_proximity_lock_manager_h plm_h = user_data;
+
+ __callui_proximity_lock_manager_log_run_state(plm_h);
+
+ switch (audio_state) {
+ case CALLUI_AUDIO_STATE_SPEAKER:
+ case CALLUI_AUDIO_STATE_EARJACK:
+ case CALLUI_AUDIO_STATE_BT:
+ {
+ plm_h->was_handsfree_mode = true;
+ dbg("Handsfree mode [ON]");
+ if (plm_h->lcd_state == CALLUI_PLM_LCD_OFF) {
+ dbg("PLM LCD state [OFF]");
+ DELETE_ECORE_TIMER(plm_h->lcd_turn_on_timer);
+ _callui_indicator_set_locked(plm_h->base.ad->indicator, false);
+ plm_h->unlock_cb = NULL;
+ plm_h->cb_data = NULL;
+ _callui_display_set_control_state(plm_h->base.ad->display, CALLUI_DISPLAY_CONTROL_ON);
+ }
+ dbg("Set PLM run state [PAUSED]");
+ plm_h->run_state = CALLUI_PLM_STATE_PAUSED;
+ plm_h->lcd_state = CALLUI_PLM_LCD_UNDEFINED;
+ break;
+ }
+ case CALLUI_AUDIO_STATE_RECEIVER:
+ {
+ if (!plm_h->was_handsfree_mode) {
+ dbg("Ignore. Initial callback");
+ return;
+ }
+ dbg("Handsfree mode [OFF]");
+ if (plm_h->run_state == CALLUI_PLM_STATE_PAUSED) {
+ callui_display_state_e display_state = CALLUI_DISPLAY_NORMAL;
+ _callui_display_get_state(plm_h->base.ad->display, &display_state);
+ dbg("Proximity sensor current proximity_distance [%.1f]", plm_h->proximity_distance);
+
+ if (display_state == CALLUI_DISPLAY_OFF && plm_h->proximity_distance > 0.0) {
+ dbg("Turn display [ON]");
+ _callui_display_set_control_state(plm_h->base.ad->display, CALLUI_DISPLAY_CONTROL_ON);
+ plm_h->lcd_state = CALLUI_PLM_LCD_ON;
+ } else {
+ plm_h->lcd_state = CALLUI_PLM_LCD_OFF;
+ }
+
+ const callui_call_data_t *incom = _callui_stp_get_call_data(plm_h->base.ad->state_provider, CALLUI_CALL_DATA_INCOMING);
+ if (_callui_stp_is_any_calls_available(plm_h->base.ad->state_provider) && !incom) {
+ dbg("Set PLM run state [RUNNING]");
+ plm_h->run_state = CALLUI_PLM_STATE_RUNNING;
+ } else if (plm_h->lcd_state == CALLUI_PLM_LCD_OFF) {
+ plm_h->need_process_cb_in_pause = true;
+ }
+ }
+ break;
+ }
+ default:
+ break;
}
- sensor_listener_set_option(plm_h->sensor_listener, SENSOR_OPTION_ALWAYS_ON);
- sensor_listener_set_event_cb(plm_h->sensor_listener, CALLUI_SENSOR_INTERVAL, __callui_proximity_lock_manager_cb, plm_h);
- return ret;
+ debug_leave();
+}
+
+static void __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)
+{
+ debug_enter();
+
+ CALLUI_RETURN_IF_FAIL(user_data);
+ _callui_proximity_lock_manager_h plm_h = user_data;
+
+ __callui_proximity_lock_manager_log_run_state(plm_h);
+
+ const callui_call_data_t *incom = _callui_stp_get_call_data(plm_h->base.ad->state_provider, CALLUI_CALL_DATA_INCOMING);
+
+ if (!_callui_stp_is_any_calls_available(plm_h->base.ad->state_provider)) {
+ dbg("Set PLM run state [PAUSED]");
+ plm_h->run_state = CALLUI_PLM_STATE_PAUSED;
+ if (plm_h->lcd_state == CALLUI_PLM_LCD_OFF) {
+ dbg("PLM lcd state [OFF]. Set force change");
+ plm_h->need_process_cb_in_pause = true;
+ }
+ } else if (incom) {
+ dbg("Incoming call");
+ if (plm_h->lcd_state != CALLUI_PLM_LCD_OFF) {
+ dbg("PLM lcd state [ON]. Set PLM run state [PAUSED]");
+ plm_h->run_state = CALLUI_PLM_STATE_PAUSED;
+ } else {
+ dbg("PLM lcd state [OFF]. Wait for open sensor");
+ }
+ } else if (plm_h->run_state == CALLUI_PLM_STATE_PAUSED) {
+ if (!_callui_common_is_on_handsfree_mode(plm_h->base.ad)) {
+ dbg("Set PLM run state [RUNNING]");
+ plm_h->run_state = CALLUI_PLM_STATE_RUNNING;
+ }
+ }
+ debug_leave();
}
static void __callui_proximity_lock_manager_turn_lcd_on(_callui_proximity_lock_manager_h plm_h)
static Eina_Bool __callui_proximity_lock_manager_turn_lcd_on_timer_cb(void *data)
{
+ CALLUI_RETURN_VALUE_IF_FAIL(data, ECORE_CALLBACK_CANCEL);
+
_callui_proximity_lock_manager_h plm_h = data;
/* Unlock indicator color change mechanism */
__callui_proximity_lock_manager_turn_lcd_on(plm_h);
plm_h->lcd_turn_on_timer = NULL;
- return ECORE_CALLBACK_DONE;
+ const callui_call_data_t *incom = _callui_stp_get_call_data(plm_h->base.ad->state_provider, CALLUI_CALL_DATA_INCOMING);
+ if (incom || !_callui_stp_is_any_calls_available(plm_h->base.ad->state_provider)) {
+ dbg("Set PLM run state [PAUSED]");
+ plm_h->run_state = CALLUI_PLM_STATE_PAUSED;
+ }
+
+ return ECORE_CALLBACK_CANCEL;
}
static void __callui_proximity_lock_manager_cb(sensor_h sensor, sensor_event_s *sensor_data, void *user_data)
CALLUI_RETURN_IF_FAIL(sensor_data);
_callui_proximity_lock_manager_h plm_h = user_data;
- if (plm_h->run_state == CALLUI_PLM_STATE_STOPPED) {
- dbg("Ignored. Proximity Lock Manager is stopped.");
- return;
- }
float value = sensor_data->values[0];
dbg("Proximity sensor value [%.1f]. Sensor state [%s]", value, (value > 0) ? "OPENED" : "CLOSED");
+ plm_h->proximity_distance = value;
+
+ if (plm_h->run_state == CALLUI_PLM_STATE_PAUSED) {
+ if (!_callui_stp_is_any_calls_available(plm_h->base.ad->state_provider)
+ && plm_h->need_process_cb_in_pause
+ && plm_h->lcd_state != CALLUI_PLM_LCD_ON) {
+ dbg("Proximity sensor was closed. Need to process callback");
+ plm_h->need_process_cb_in_pause = false;
+ } else {
+ return;
+ }
+ }
+
if (value > 0) {
if (plm_h->lcd_state == CALLUI_PLM_LCD_OFF) {
dbg("Make request on turn display [ON] with delay");
plm_h->lcd_turn_on_timer = ecore_timer_add(CALLUI_LCD_TURN_ON_DELAY_INTERVAL, __callui_proximity_lock_manager_turn_lcd_on_timer_cb, plm_h);
}
} else {
-
callui_display_state_e state;
if (_callui_display_get_state(plm_h->base.ad->display, &state) == CALLUI_RESULT_OK && state != CALLUI_DISPLAY_OFF) {
if (plm_h->lcd_turn_on_timer) {
}
}
-static callui_result_e __callui_proximity_lock_manager_create(callui_lock_manager_h lock_h, callui_app_data_t *ad)
+static void __callui_proximity_lock_set_init_running_state(_callui_proximity_lock_manager_h plm_h)
{
- debug_enter();
-
- CALLUI_RETURN_VALUE_IF_FAIL(lock_h, CALLUI_RESULT_INVALID_PARAM);
- CALLUI_RETURN_VALUE_IF_FAIL(ad, CALLUI_RESULT_INVALID_PARAM);
-
- _callui_proximity_lock_manager_h plm_h = (_callui_proximity_lock_manager_h)lock_h;
- plm_h->base.ad = ad;
-
- plm_h->run_state = CALLUI_PLM_STATE_UNDEFINED;
- plm_h->lcd_state = CALLUI_PLM_LCD_UNDEFINED;
- plm_h->unlock_cb = NULL;
- plm_h->cb_data = NULL;
-
- int ret = SENSOR_ERROR_NONE;
- ret = sensor_get_default_sensor(SENSOR_PROXIMITY, &plm_h->sensor);
- if (ret != SENSOR_ERROR_NONE) {
- err("sensor_get_default_sensor() failed(%d)", ret);
- free(plm_h);
- return CALLUI_RESULT_FAIL;
- }
- ret = __callui_proximity_lock_manager_create_listener(plm_h);
- if (ret != SENSOR_ERROR_NONE) {
- err("create listener failed(%d)", ret);
- free(plm_h);
- return CALLUI_RESULT_FAIL;
+ const callui_call_data_t *incom = _callui_stp_get_call_data(plm_h->base.ad->state_provider, CALLUI_CALL_DATA_INCOMING);
+ if (!_callui_stp_is_any_calls_available(plm_h->base.ad->state_provider) || incom || _callui_common_is_on_handsfree_mode(plm_h->base.ad)) {
+ dbg("Set PLM run state [PAUSED]");
+ plm_h->run_state = CALLUI_PLM_STATE_PAUSED;
+ } else {
+ dbg("Set PLM run state [RUNNING]");
+ plm_h->run_state = CALLUI_PLM_STATE_RUNNING;
}
- return CALLUI_RESULT_OK;
}
-static void __callui_proximity_lock_manager_start(callui_lock_manager_h lock_h)
+static callui_result_e __callui_proximity_lock_init_proximity_sensor_listener(_callui_proximity_lock_manager_h plm_h)
{
- debug_enter();
+ int res = sensor_get_default_sensor(SENSOR_PROXIMITY, &plm_h->sensor);
+ CALLUI_RETURN_VALUE_IF_FAIL(res == SENSOR_ERROR_NONE, CALLUI_RESULT_FAIL);
- CALLUI_RETURN_IF_FAIL(lock_h);
- _callui_proximity_lock_manager_h plm_h = (_callui_proximity_lock_manager_h)lock_h;
+ res = sensor_create_listener(plm_h->sensor, &plm_h->sensor_listener);
+ CALLUI_RETURN_VALUE_IF_FAIL(res == SENSOR_ERROR_NONE, CALLUI_RESULT_FAIL);
- switch (plm_h->run_state) {
- case CALLUI_PLM_STATE_STARTED:
- dbg("Already started");
- return;
- case CALLUI_PLM_STATE_SUSPENDED:
- plm_h->unlock_cb = NULL;
- plm_h->cb_data = NULL;
- break;
- default:
- {
- int ret = sensor_listener_start(plm_h->sensor_listener);
- if (ret != SENSOR_ERROR_NONE) {
- err("sensor_listener_start() failed. res[%d]", ret);
- }
- break;
- }
- }
+ res = sensor_listener_set_option(plm_h->sensor_listener, SENSOR_OPTION_ALWAYS_ON);
+ CALLUI_RETURN_VALUE_IF_FAIL(res == SENSOR_ERROR_NONE, CALLUI_RESULT_FAIL);
-#ifdef _DBUS_DISPLAY_DEVICE_TIMEOUT_
- _callui_display_set_timeout(plm_h->base.ad->display, CALLUI_DISPLAY_TIMEOUT_SET);
-#endif
- plm_h->run_state = CALLUI_PLM_STATE_STARTED;
- plm_h->lcd_state = CALLUI_PLM_LCD_UNDEFINED;
+ res = sensor_listener_set_event_cb(plm_h->sensor_listener, CALLUI_SENSOR_INTERVAL, __callui_proximity_lock_manager_cb, plm_h);
+ CALLUI_RETURN_VALUE_IF_FAIL(res == SENSOR_ERROR_NONE, CALLUI_RESULT_FAIL);
+
+ res = sensor_listener_start(plm_h->sensor_listener);
+ CALLUI_RETURN_VALUE_IF_FAIL(res == SENSOR_ERROR_NONE, CALLUI_RESULT_FAIL);
+
+ return CALLUI_RESULT_OK;
}
-static void __callui_proximity_lock_manager_on_unlock_cb(void *data)
+static void __callui_proximity_lock_deinit_proximity_sensor_listener(_callui_proximity_lock_manager_h plm_h)
{
- __callui_proximity_lock_manager_stop((callui_lock_manager_h)data);
+ sensor_listener_unset_event_cb(plm_h->sensor_listener);
+ sensor_destroy_listener(plm_h->sensor_listener);
}
-static void __callui_proximity_lock_manager_force_stop(callui_lock_manager_h lock_h, bool force)
+static void __display_state_changed_cb(void *user_data)
{
- debug_enter();
+ _callui_proximity_lock_manager_h plm_h = user_data;
- CALLUI_RETURN_IF_FAIL(lock_h);
- _callui_proximity_lock_manager_h plm_h = (_callui_proximity_lock_manager_h)lock_h;
+ callui_display_state_e state;
+ _callui_display_get_state(plm_h->base.ad->display, &state);
- if (!force && __callui_proximity_lock_manager_is_lcd_off((callui_lock_manager_h)plm_h)) {
- plm_h->run_state = CALLUI_PLM_STATE_SUSPENDED;
- __callui_proximity_lock_manager_set_callback_on_unlock((callui_lock_manager_h)plm_h, __callui_proximity_lock_manager_on_unlock_cb, plm_h);
- } else {
- __callui_proximity_lock_manager_stop((callui_lock_manager_h)plm_h);
+ if (plm_h->run_state == CALLUI_PLM_STATE_RUNNING) {
+ if ((plm_h->lcd_state != CALLUI_PLM_LCD_ON && (state == CALLUI_DISPLAY_NORMAL || state == CALLUI_DISPLAY_DIM))
+ || (plm_h->lcd_state != CALLUI_PLM_LCD_OFF && state == CALLUI_DISPLAY_OFF)) {
+ dbg("Desync of display status and proximity lcd state. Reset to undefined state.");
+ plm_h->lcd_state = CALLUI_PLM_LCD_UNDEFINED;
+ }
}
}
-static void __callui_proximity_lock_manager_stop(callui_lock_manager_h lock_h)
+static callui_result_e __callui_proximity_lock_manager_create(callui_lock_manager_h lock_h, callui_app_data_t *ad)
{
debug_enter();
- CALLUI_RETURN_IF_FAIL(lock_h);
+ CALLUI_RETURN_VALUE_IF_FAIL(lock_h, CALLUI_RESULT_INVALID_PARAM);
+ CALLUI_RETURN_VALUE_IF_FAIL(ad, CALLUI_RESULT_INVALID_PARAM);
+
_callui_proximity_lock_manager_h plm_h = (_callui_proximity_lock_manager_h)lock_h;
+ plm_h->base.ad = ad;
- int ret = sensor_listener_stop(plm_h->sensor_listener);
- if (ret != SENSOR_ERROR_NONE) {
- err("sensor_listener_stop() failed(%d)", ret);
- }
- plm_h->run_state = CALLUI_PLM_STATE_STOPPED;
plm_h->lcd_state = CALLUI_PLM_LCD_UNDEFINED;
+ plm_h->unlock_cb = NULL;
+ plm_h->cb_data = NULL;
+
+ callui_result_e res = __callui_proximity_lock_init_proximity_sensor_listener(plm_h);
+ CALLUI_RETURN_VALUE_IF_FAIL(res == CALLUI_RESULT_OK, res);
+
+ res = _callui_stp_add_call_state_event_cb(ad->state_provider, __call_state_event_cb, plm_h);
+ CALLUI_RETURN_VALUE_IF_FAIL(res == CALLUI_RESULT_OK, res);
+
+ res = _callui_sdm_add_audio_state_changed_cb(ad->sound_manager, __audio_state_changed_cb, plm_h);
+ CALLUI_RETURN_VALUE_IF_FAIL(res == CALLUI_RESULT_OK, res);
+
+ __callui_proximity_lock_set_init_running_state(plm_h);
+
+ _callui_display_add_display_state_change_cb(ad->display, __display_state_changed_cb, plm_h);
+
+ return res;
}
-static bool __callui_proximity_lock_manager_is_started(callui_lock_manager_h lock_h)
+static bool __callui_proximity_lock_manager_is_running(callui_lock_manager_h lock_h)
{
debug_enter();
CALLUI_RETURN_VALUE_IF_FAIL(lock_h, false);
_callui_proximity_lock_manager_h plm_h = (_callui_proximity_lock_manager_h)lock_h;
- return (plm_h->run_state == CALLUI_PLM_STATE_STARTED);
+ __callui_proximity_lock_manager_log_run_state(plm_h);
+
+ return (plm_h->run_state == CALLUI_PLM_STATE_RUNNING);
}
static void __callui_proximity_lock_manager_destroy(callui_lock_manager_h lock_h)
_callui_proximity_lock_manager_h plm_h = (_callui_proximity_lock_manager_h)lock_h;
DELETE_ECORE_TIMER(plm_h->lcd_turn_on_timer);
- sensor_listener_unset_event_cb(plm_h->sensor_listener);
- sensor_destroy_listener(plm_h->sensor_listener);
+ __callui_proximity_lock_deinit_proximity_sensor_listener(plm_h);
+ _callui_stp_remove_call_state_event_cb(plm_h->base.ad->state_provider, __call_state_event_cb, plm_h);
+ _callui_sdm_remove_audio_state_changed_cb(plm_h->base.ad->sound_manager, __audio_state_changed_cb, plm_h);
+ _callui_display_remove_display_state_change_cb(plm_h->base.ad->display, __display_state_changed_cb, plm_h);
+
free(plm_h);
}
CALLUI_RETURN_VALUE_IF_FAIL(lock_h, false);
_callui_proximity_lock_manager_h plm_h = (_callui_proximity_lock_manager_h)lock_h;
- dbg("Proximity lock manager LCD state [%s]", (plm_h->lcd_state == CALLUI_PLM_LCD_OFF) ? "OFF":"ON");
+ dbg("PLM LCD state [%s]", (plm_h->lcd_state == CALLUI_PLM_LCD_OFF) ? "OFF":"ON");
return (plm_h->lcd_state == CALLUI_PLM_LCD_OFF);
}
{
debug_enter();
- CALLUI_RETURN_IF_FAIL(lock_h || callback || data);
+ CALLUI_RETURN_IF_FAIL(lock_h || callback);
_callui_proximity_lock_manager_h plm_h = (_callui_proximity_lock_manager_h)lock_h;
plm_h->unlock_cb = callback;
CALLUI_RETURN_NULL_IF_FAIL(plm_h);
plm_h->base.create = __callui_proximity_lock_manager_create;
- plm_h->base.start = __callui_proximity_lock_manager_start;
- plm_h->base.stop = __callui_proximity_lock_manager_force_stop;
- plm_h->base.is_started = __callui_proximity_lock_manager_is_started;
+ plm_h->base.is_running = __callui_proximity_lock_manager_is_running;
plm_h->base.is_lcd_off = __callui_proximity_lock_manager_is_lcd_off;
plm_h->base.set_unlock_cb = __callui_proximity_lock_manager_set_callback_on_unlock;
plm_h->base.destroy = __callui_proximity_lock_manager_destroy;
{
CALLUI_RETURN_VALUE_IF_FAIL(stp_h, false);
- return (stp_h->st_data_list[CALLUI_CALL_DATA_INCOMING] ||
+ bool is_available = (stp_h->st_data_list[CALLUI_CALL_DATA_INCOMING] ||
stp_h->st_data_list[CALLUI_CALL_DATA_ACTIVE] ||
stp_h->st_data_list[CALLUI_CALL_DATA_HELD]);
+ dbg("Any calls available [%s]", is_available ? "YES" : "NO");
+
+ return is_available;
}
#include "callui-view-elements.h"
#include "callui-common.h"
#include "callui-sound-manager.h"
+#include "callui-keypad.h"
+
+#define CALLUI_TLM_DURING_CALL_LOCK_TIMEOUT_SEC 2.0
+#define CALLUI_TLM_DEFAULT_LOCK_TIMEOUT_SEC 3.0
struct __touch_lock_manager {
_callui_lock_manager_t base;
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;
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_resume(callui_lock_manager_h lock_h);
+static void __callui_touch_lock_manager_pause(callui_lock_manager_h lock_h, bool force);
+static bool __callui_touch_lock_manager_is_running(callui_lock_manager_h lock_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 callui_result_e __callui_touch_lock_manager_ui_elements(_callui_touch_lock_manager_h tlm_h);
+static void __callui_touch_lock_manager_lock(_callui_touch_lock_manager_h tlm_h);
+static void __callui_touch_lock_manager_unlock(_callui_touch_lock_manager_h tlm_h);
+static void __callui_touch_lock_manager_update_state(_callui_touch_lock_manager_h tlm_h);
+
+static Eina_Bool __lock_timeout_cb(void *data);
+static void __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 __keypad_show_state_change_cd(void *data, Eina_Bool is_visible);
-static void __callui_touch_lock_manager_show_layout(_callui_touch_lock_manager_h tlm_h)
+static void __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_touch_lock_manager_unlock(tlm_h);
+ }
+ break;
+ case CALLUI_AUDIO_STATE_RECEIVER:
+ if (tlm_h->was_handsfree_mode) {
+ tlm_h->was_handsfree_mode = false;
+ __callui_touch_lock_manager_lock(tlm_h);
+ } else {
+ __callui_touch_lock_manager_update_state(tlm_h);
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+static void __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_touch_lock_manager_update_state(user_data);
+}
+static void __callui_touch_lock_manager_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_on_handsfree_mode(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_touch_lock_manager_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_touch_lock_manager_unlock(tlm_h);
+ }
+ tlm_h->no_lock_timer = ecore_timer_add(CALLUI_TLM_DURING_CALL_LOCK_TIMEOUT_SEC, __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_touch_lock_manager_lock(tlm_h);
+ } else {
+ tlm_h->no_lock_timer = ecore_timer_add(CALLUI_TLM_DEFAULT_LOCK_TIMEOUT_SEC, __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_touch_lock_manager_unlock(tlm_h);
+ }
}
+}
+
+static void __callui_touch_lock_manager_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
-
- tlm_h->is_locked = true;
- return;
}
-static void __callui_touch_lock_manager_hide_layout(_callui_touch_lock_manager_h tlm_h)
+static void __callui_touch_lock_manager_unlock(_callui_touch_lock_manager_h tlm_h)
{
debug_enter();
CALLUI_RETURN_IF_FAIL(tlm_h);
+ if (!tlm_h->is_locked) {
+ dbg("Touch lock manager already unlocked");
+ return;
+ }
+ elm_object_part_content_unset(_callui_vm_get_main_ly(tlm_h->base.ad->view_manager), "elm.swallow.touchlock");
evas_object_hide(tlm_h->layout);
+
tlm_h->is_locked = false;
#ifdef _DBUS_DISPLAY_DEVICE_TIMEOUT_
if (_callui_vm_get_cur_view_type(tlm_h->base.ad->view_manager) != CALLUI_VIEW_DIALLING) {
- dbg("lcd hide");
+ dbg("Update display timeout [Normal]");
_callui_display_set_timeout(tlm_h->base.ad->display, CALLUI_DISPLAY_TIMEOUT_SET);
}
#endif
{
debug_enter();
+ CALLUI_RETURN_VALUE_IF_FAIL(data, ECORE_CALLBACK_CANCEL);
+
_callui_touch_lock_manager_h tlm_h = data;
+ __callui_touch_lock_manager_lock(tlm_h);
tlm_h->no_lock_timer = NULL;
- callui_view_type_e type = _callui_vm_get_cur_view_type(tlm_h->base.ad->view_manager);
- if (type >= CALLUI_VIEW_MULTICALL_LIST) {
- return ECORE_CALLBACK_CANCEL;
- } else if (type == CALLUI_VIEW_INCOMING_CALL || type == CALLUI_VIEW_INCOMING_CALL_NOTI) {
- return ECORE_CALLBACK_RENEW;
- }
-
- __callui_touch_lock_manager_show_layout(tlm_h);
return ECORE_CALLBACK_CANCEL;
}
-static void __callui_touch_lock_manager_icon_double_clicked_cb(void *data, Evas_Object *o, const char *emission, const char *source)
+static void __lock_icon_double_clicked_cb(void *data, Evas_Object *o, const char *emission, const char *source)
{
debug_enter();
_callui_touch_lock_manager_h tlm_h = data;
- __callui_touch_lock_manager_hide_layout(tlm_h);
- tlm_h->no_lock_timer = ecore_timer_add(3.0, __lock_timeout_cb, tlm_h);
+ __callui_touch_lock_manager_unlock(tlm_h);
+ __callui_touch_lock_manager_update_state(tlm_h);
}
-static void __callui_touch_lock_manager_user_action_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info)
+static void __user_action_screen_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info)
{
debug_enter();
_callui_touch_lock_manager_h tlm_h = data;
- DELETE_ECORE_TIMER(tlm_h->no_lock_timer);
- tlm_h->no_lock_timer = ecore_timer_add(3.0, __lock_timeout_cb, tlm_h);
+ if (tlm_h->is_locked) {
+ return;
+ }
+ __callui_touch_lock_manager_update_state(tlm_h);
}
-static bool __callui_touch_lock_manager_create_layout(_callui_touch_lock_manager_h tlm_h)
+static callui_result_e __callui_touch_lock_manager_ui_elements(_callui_touch_lock_manager_h tlm_h)
{
debug_enter();
- callui_app_data_t *ad = tlm_h->base.ad;
- Evas_Object *layout = NULL;
- Evas_Object *hit_rect = NULL;
CALLUI_RETURN_VALUE_IF_FAIL(tlm_h, false);
- /* Make Hit rectangle to refresh lock timer */
- hit_rect = evas_object_rectangle_add(evas_object_evas_get(_callui_window_get_eo(ad->window)));
+ callui_app_data_t *ad = tlm_h->base.ad;
+
+ /* Hit rectangle to refresh lock timer */
+ Evas_Object *hit_rect = evas_object_rectangle_add(evas_object_evas_get(_callui_window_get_eo(ad->window)));
+ CALLUI_RETURN_VALUE_IF_FAIL(hit_rect, CALLUI_RESULT_FAIL);
evas_object_color_set(hit_rect, 0, 0, 0, 0);
evas_object_resize(hit_rect, ad->root_w, ad->root_h);
evas_object_move(hit_rect, 0, 0);
evas_object_repeat_events_set(hit_rect, EINA_TRUE);
evas_object_propagate_events_set(hit_rect, EINA_FALSE);
- evas_object_event_callback_add(hit_rect, EVAS_CALLBACK_MOUSE_DOWN, __callui_touch_lock_manager_user_action_cb, tlm_h);
+ evas_object_event_callback_add(hit_rect, EVAS_CALLBACK_MOUSE_DOWN, __user_action_screen_cb, tlm_h);
evas_object_show(hit_rect);
tlm_h->hit_rect = hit_rect;
- layout = _callui_load_edj(_callui_vm_get_main_ly(ad->view_manager), CALLUI_CALL_EDJ_PATH, "lock-screen");
- CALLUI_RETURN_VALUE_IF_FAIL(layout, false);
-
+ /* 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);
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");
-
- edje_object_signal_callback_add(_EDJ(layout), "mouse,down,1,double", "lock-icon", __callui_touch_lock_manager_icon_double_clicked_cb, tlm_h);
-
+ edje_object_signal_callback_add(_EDJ(layout), "mouse,down,1,double", "lock-icon", __lock_icon_double_clicked_cb, tlm_h);
+ evas_object_hide(tlm_h->layout);
tlm_h->layout = layout;
- __callui_touch_lock_manager_show_layout(tlm_h);
-
- return true;
-}
-
-static void __callui_touch_lock_manager_start_timer(_callui_touch_lock_manager_h tlm_h)
-{
- CALLUI_RETURN_IF_FAIL(tlm_h);
-
- DELETE_ECORE_TIMER(tlm_h->no_lock_timer);
- tlm_h->no_lock_timer = ecore_timer_add(3.0, __lock_timeout_cb, tlm_h);
-}
-
-static void __callui_touch_lock_manager_stop_timer(_callui_touch_lock_manager_h tlm_h)
-{
- CALLUI_RETURN_IF_FAIL(tlm_h);
-
- DELETE_ECORE_TIMER(tlm_h->no_lock_timer);
+ return CALLUI_RESULT_OK;
}
static void __callui_touch_lock_manager_destroy(callui_lock_manager_h lock_h)
DELETE_ECORE_TIMER(tlm_h->no_lock_timer);
+ _callui_stp_remove_call_state_event_cb(tlm_h->base.ad->state_provider, __call_state_event_cb, tlm_h);
+ _callui_sdm_remove_audio_state_changed_cb(tlm_h->base.ad->sound_manager, __audio_state_changed_cb, tlm_h);
+ _callui_keypad_remove_show_status_change_cb(tlm_h->base.ad->keypad, __keypad_show_state_change_cd, tlm_h);
+
free(tlm_h);
}
-static bool __callui_touch_lock_manager_is_lockscreen_shown(callui_lock_manager_h tlm_h)
+static bool __callui_touch_lock_manager_is_running(callui_lock_manager_h lock_h)
{
- CALLUI_RETURN_VALUE_IF_FAIL(tlm_h, false);
+ CALLUI_RETURN_VALUE_IF_FAIL(lock_h, false);
- return ((_callui_touch_lock_manager_h)tlm_h)->is_locked;
+ _callui_touch_lock_manager_h tlm_h = (_callui_touch_lock_manager_h)lock_h;
+
+ return tlm_h->is_locked;
+}
+
+static void __keypad_show_state_change_cd(void *data, Eina_Bool is_visible)
+{
+ _callui_touch_lock_manager_h tlm_h = data;
+
+ if (is_visible) {
+ DELETE_ECORE_TIMER(tlm_h->no_lock_timer);
+ __callui_touch_lock_manager_unlock(tlm_h);
+ } else {
+ __callui_touch_lock_manager_update_state(tlm_h);
+ }
}
static callui_result_e __callui_touch_lock_manager_create(callui_lock_manager_h lock_h, callui_app_data_t *ad)
_callui_touch_lock_manager_h tlm_h = (_callui_touch_lock_manager_h)lock_h;
tlm_h->base.ad = ad;
+ tlm_h->is_locked = false;
- if (!__callui_touch_lock_manager_create_layout(tlm_h)) {
- free(tlm_h);
- return CALLUI_RESULT_FAIL;
- }
- __callui_touch_lock_manager_hide_layout(tlm_h);
+ callui_result_e res = __callui_touch_lock_manager_ui_elements(tlm_h);
+ CALLUI_RETURN_VALUE_IF_FAIL(res == CALLUI_RESULT_OK, res);
- return CALLUI_RESULT_OK;
+ res = _callui_stp_add_call_state_event_cb(ad->state_provider, __call_state_event_cb, tlm_h);
+ CALLUI_RETURN_VALUE_IF_FAIL(res == CALLUI_RESULT_OK, res);
+
+ res = _callui_sdm_add_audio_state_changed_cb(ad->sound_manager, __audio_state_changed_cb, tlm_h);
+ CALLUI_RETURN_VALUE_IF_FAIL(res == CALLUI_RESULT_OK, res);
+
+ res = _callui_keypad_add_show_status_change_cb(ad->keypad, __keypad_show_state_change_cd, tlm_h);
+ CALLUI_RETURN_VALUE_IF_FAIL(res == CALLUI_RESULT_OK, res);
+
+ return res;
}
-static void __callui_touch_lock_manager_start(callui_lock_manager_h lock_h)
+static void __callui_touch_lock_manager_resume(callui_lock_manager_h lock_h)
{
CALLUI_RETURN_IF_FAIL(lock_h);
- __callui_touch_lock_manager_show_layout((_callui_touch_lock_manager_h)lock_h);
- __callui_touch_lock_manager_start_timer((_callui_touch_lock_manager_h)lock_h);
+ __callui_touch_lock_manager_update_state((_callui_touch_lock_manager_h)lock_h);
}
-static void __callui_touch_lock_manager_stop(callui_lock_manager_h lock_h, bool force)
+static void __callui_touch_lock_manager_pause(callui_lock_manager_h lock_h, bool force)
{
CALLUI_RETURN_IF_FAIL(lock_h);
- __callui_touch_lock_manager_hide_layout((_callui_touch_lock_manager_h)lock_h);
- __callui_touch_lock_manager_stop_timer((_callui_touch_lock_manager_h)lock_h);
-}
+ _callui_touch_lock_manager_h tlm_h = (_callui_touch_lock_manager_h)lock_h;
+ DELETE_ECORE_TIMER(tlm_h->no_lock_timer);
-static bool __callui_touch_lock_manager_is_lcd_off(callui_lock_manager_h lock_h)
-{
- return false;
+ if (tlm_h->is_locked) {
+ __callui_touch_lock_manager_unlock((_callui_touch_lock_manager_h)lock_h);
+ }
}
_callui_touch_lock_manager_h _callui_touch_lock_manager_new()
CALLUI_RETURN_NULL_IF_FAIL(tlm_h);
tlm_h->base.create = __callui_touch_lock_manager_create;
- tlm_h->base.start = __callui_touch_lock_manager_start;
- tlm_h->base.stop = __callui_touch_lock_manager_stop;
- tlm_h->base.is_started = __callui_touch_lock_manager_is_lockscreen_shown;
- tlm_h->base.is_lcd_off = __callui_touch_lock_manager_is_lcd_off;
- tlm_h->base.set_unlock_cb = __callui_touch_lock_manager_set_callback_on_unlock;
+ tlm_h->base.resume = __callui_touch_lock_manager_resume;
+ tlm_h->base.pause = __callui_touch_lock_manager_pause;
+ tlm_h->base.is_running = __callui_touch_lock_manager_is_running;
tlm_h->base.destroy = __callui_touch_lock_manager_destroy;
return tlm_h;
callui_view_callend_h vd = (callui_view_callend_h)view_data;
vd->base_view.ad = appdata;
- vd->base_view.ad->start_lock_manager_on_resume = false;
- _callui_lock_manager_stop(vd->base_view.ad->lock_manager);
-
callui_result_e res = __create_main_content(vd, parent);
CALLUI_RETURN_VALUE_IF_FAIL(res == CALLUI_RESULT_OK, res);
callui_result_e res = __create_main_content(vd, parent);
CALLUI_RETURN_VALUE_IF_FAIL(res == CALLUI_RESULT_OK, CALLUI_RESULT_FAIL);
- _callui_lock_manager_start(ad->lock_manager);
-
return __update_displayed_data(vd);
}
_callui_action_bar_show(ad->action_bar);
_callui_keypad_clear_input(ad->keypad);
- _callui_keypad_show_status_change_callback_set(ad->keypad, __keypad_show_state_change_cd, vd);
+ _callui_keypad_add_show_status_change_cb(ad->keypad, __keypad_show_state_change_cd, vd);
CALLUI_RETURN_VALUE_IF_FAIL(_callui_create_end_call_button(vd->base_view.contents, __end_call_btn_click_cb, vd),
CALLUI_RESULT_ALLOCATION_FAIL);
_callui_action_bar_hide(ad->action_bar);
_callui_keypad_hide_immediately(ad->keypad);
- _callui_keypad_show_status_change_callback_set(ad->keypad, NULL, NULL);
+ _callui_keypad_remove_show_status_change_cb(ad->keypad, __keypad_show_state_change_cd, vd);
DELETE_EVAS_OBJECT(vd->base_view.contents);
if (_callui_common_is_proximity_sensor_supported()) {
is_lcd_locked = _callui_lock_manager_is_lcd_off(ad->lock_manager);
} else {
- is_lcd_locked = _callui_lock_manager_is_started(ad->lock_manager);
+ is_lcd_locked = _callui_lock_manager_is_running(ad->lock_manager);
}
if (is_lcd_locked) {
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);
if (_callui_lock_manager_is_lcd_off(ad->lock_manager)) {
_callui_lock_manager_set_callback_on_unlock(ad->lock_manager, _lock_manager_unlock_cb, ad);
} else {
- _callui_lock_manager_stop(ad->lock_manager);
res = __change_view(vm, CALLUI_VIEW_ENDCALL);
}
} else {
_callui_action_bar_show(ad->action_bar);
_callui_keypad_clear_input(ad->keypad);
- _callui_keypad_show_status_change_callback_set(ad->keypad, __keypad_show_state_change_cd, vd);
+ _callui_keypad_add_show_status_change_cb(ad->keypad, __keypad_show_state_change_cd, vd);
CALLUI_RETURN_VALUE_IF_FAIL(
_callui_create_end_call_button(vd->base_view.contents, __end_call_btn_click_cb, vd),
_callui_action_bar_hide(ad->action_bar);
_callui_keypad_hide_immediately(ad->keypad);
- _callui_keypad_show_status_change_callback_set(ad->keypad, NULL, NULL);
+ _callui_keypad_remove_show_status_change_cb(ad->keypad, __keypad_show_state_change_cd, vd);
DELETE_ECORE_TIMER(vd->base_view.call_duration_timer);
free(vd->base_view.call_duration_tm);
callui_result_e res = __create_main_content(vd, parent);
CALLUI_RETURN_VALUE_IF_FAIL(res == CALLUI_RESULT_OK, res);
- _callui_lock_manager_start(ad->lock_manager);
-
return __update_displayed_data(vd);
}
callui_view_mc_split_h vd = (callui_view_mc_split_h)view_data;
- _callui_lock_manager_start(vd->base_view.ad->lock_manager);
-
callui_result_e res = CALLUI_RESULT_FAIL;
if (vd->base_view.update_flags & CALLUI_UF_DATA_REFRESH) {
res = __update_displayed_data(vd);
_callui_action_bar_hide(ad->action_bar);
_callui_keypad_hide_immediately(ad->keypad);
- _callui_keypad_show_status_change_callback_set(ad->keypad, NULL, NULL);
+ _callui_keypad_remove_show_status_change_cb(ad->keypad, __keypad_show_state_change_cd, vd);
DELETE_ECORE_TIMER(vd->base_view.call_duration_timer);
_callui_action_bar_show(ad->action_bar);
_callui_keypad_clear_input(ad->keypad);
- _callui_keypad_show_status_change_callback_set(ad->keypad, __keypad_show_state_change_cd, vd);
+ _callui_keypad_add_show_status_change_cb(ad->keypad, __keypad_show_state_change_cd, vd);
CALLUI_RETURN_VALUE_IF_FAIL(_callui_create_end_call_button(vd->base_view.contents,
__end_call_btn_click_cb, vd), CALLUI_RESULT_ALLOCATION_FAIL);
} else if ((ret = app_control_send_launch_request(app_control, NULL, NULL)) != APP_CONTROL_ERROR_NONE) {
err("app_control_send_launch_request() is failed. ret[%d]", ret);
} else {
- callui_app_data_t *ad = qp->ad;
- _callui_lock_manager_start(ad->lock_manager);
__hide_minicontrol(qp);
}
if (app_control) {
callui_result_e res = __create_main_content(vd, parent);
CALLUI_RETURN_VALUE_IF_FAIL(res == CALLUI_RESULT_OK, res);
- _callui_lock_manager_start(ad->lock_manager);
-
return __update_displayed_data(vd);
}
_callui_action_bar_hide(ad->action_bar);
_callui_keypad_hide_immediately(ad->keypad);
- _callui_keypad_show_status_change_callback_set(ad->keypad, NULL, NULL);
+ _callui_keypad_remove_show_status_change_cb(ad->keypad, __keypad_show_state_change_cd, vd);
DELETE_ECORE_TIMER(vd->base_view.call_duration_timer);
free(vd->base_view.call_duration_tm);
_callui_action_bar_show(ad->action_bar);
_callui_keypad_clear_input(ad->keypad);
- _callui_keypad_show_status_change_callback_set(ad->keypad, __keypad_show_state_change_cd, vd);
+ _callui_keypad_add_show_status_change_cb(ad->keypad, __keypad_show_state_change_cd, vd);
CALLUI_RETURN_VALUE_IF_FAIL(_callui_create_end_call_button(vd->base_view.contents, __end_call_btn_click_cb, vd),
CALLUI_RESULT_ALLOCATION_FAIL);
#define CALLUI_POWERKEY_PRESS_TIME_LIMIT_SEC 0.1
static callui_app_data_t _g_ad;
+static bool _g_ignore_power_key_end_call = false;
int g_callui_sig_to_handle[] = {SIGILL, SIGABRT, SIGFPE, SIGSEGV};
#define APP_SIG_COUNT ((int)(sizeof(g_callui_sig_to_handle) / sizeof(g_callui_sig_to_handle[0])))
static Eina_Bool __hard_key_down_cb(void *data, int type, void *event);
static Eina_Bool __hard_key_up_cb(void *data, int type, void *event);
-static void __audio_state_changed_cb(void *user_data,
- callui_audio_state_type_e audio_state);
static void __call_state_change_cb(void *user_data,
callui_call_event_type_e call_event_type,
unsigned int call_id,
static void __process_outgoing_call(callui_app_data_t *ad, const char *number);
static void __process_incoming_call(callui_app_data_t *ad);
-static void __reset_state_params(callui_app_data_t *ad);
static void __add_ecore_event_key_handlers(callui_app_data_t *ad);
static void __remove_ecore_event_key_handlers(callui_app_data_t *ad);
static void __set_main_win_key_grab(callui_app_data_t *ad);
}
}
-static void __audio_state_changed_cb(void *user_data, callui_audio_state_type_e audio_state)
-{
- CALLUI_RETURN_IF_FAIL(user_data);
-
- callui_app_data_t *ad = (callui_app_data_t *)user_data;
-
- switch (audio_state) {
- case CALLUI_AUDIO_STATE_SPEAKER:
- case CALLUI_AUDIO_STATE_EARJACK:
- case CALLUI_AUDIO_STATE_BT:
- _callui_lock_manager_force_stop(ad->lock_manager);
- break;
- case CALLUI_AUDIO_STATE_RECEIVER:
- _callui_lock_manager_start(ad->lock_manager);
- break;
- default:
- break;
- }
-}
-
static void __call_state_change_cb(void *user_data,
callui_call_event_type_e call_event_type,
unsigned int call_id,
}
}
-static void __reset_state_params(callui_app_data_t *ad)
-{
- CALLUI_RETURN_IF_FAIL(ad);
-
- ad->start_lock_manager_on_resume = false;
- ad->on_background = false;
-
- return;
-}
-
static void __bt_init()
{
int ret = bt_initialize();
callui_display_state_e state;
if (_callui_display_get_state(ad->display, &state) == CALLUI_RESULT_OK && state != CALLUI_DISPLAY_OFF && ad->on_background) {
+ _callui_indicator_set_locked(ad->indicator, false);
_callui_indicator_set_active(ad->indicator, true);
}
ad->app_state_check_timer = NULL;
dbg("****** APP STATE CHECK TIMER CALLBACK END ******");
- return ECORE_CALLBACK_DONE;
+ return ECORE_CALLBACK_CANCEL;
}
static void __display_state_changed_cb(void *user_data)
_callui_manager_add_dial_status_cb(ad->call_manager, __dial_status_cb, ad);
_callui_stp_add_call_state_event_cb(ad->state_provider, __call_state_change_cb, ad);
- _callui_sdm_add_audio_state_changed_cb(ad->sound_manager, __audio_state_changed_cb, ad);
ad->view_manager = _callui_vm_create(ad);
CALLUI_RETURN_VALUE_IF_FAIL(ad->view_manager, false);
_callui_display_remove_display_state_change_cb(ad->display, __display_state_changed_cb, ad);
_callui_stp_remove_call_state_event_cb(ad->state_provider, __call_state_change_cb, ad);
- _callui_sdm_remove_audio_state_changed_cb(ad->sound_manager, __audio_state_changed_cb, ad);
__remove_ecore_event_key_handlers(ad);
ad->on_background = true;
- if (_callui_lock_manager_is_started(ad->lock_manager)) {
- _callui_lock_manager_stop(ad->lock_manager);
- ad->start_lock_manager_on_resume = true;
- }
+ _callui_lock_manager_pause(ad->lock_manager);
_callui_vm_pause(ad->view_manager);
ad->on_background = false;
+#ifdef _DBUS_DISPLAY_DEVICE_TIMEOUT_
+ _callui_display_set_timeout(ad->display, CALLUI_DISPLAY_TIMEOUT_SET);
+#endif
+
_callui_vm_resume(ad->view_manager);
- /*
- * Temporary. When proximity sensor is ON suddenly resume callback can be called.
- * To over step problem with turning off lock manager it is used view type check
- */
- callui_view_type_e type = _callui_vm_get_cur_view_type(ad->view_manager);
- if (ad->start_lock_manager_on_resume || (type != CALLUI_VIEW_ENDCALL
- && type != CALLUI_VIEW_INCOMING_CALL
- && type != CALLUI_VIEW_INCOMING_CALL_NOTI)) {
- ad->start_lock_manager_on_resume = false;
- _callui_lock_manager_start(ad->lock_manager);
- }
+ _callui_lock_manager_resume(ad->lock_manager);
dbg("****** RESUME END ******");
}
if (_callui_vm_get_cur_view_type(ad->view_manager) == CALLUI_VIEW_UNDEFINED
&& !ad->waiting_dialing) {
err("CALLUI_VIEW_UNDEFINED. Clear data");
- __reset_state_params(ad);
+ ad->on_background = false;
_callui_display_set_control_state(ad->display, CALLUI_DISPLAY_CONTROL_OFF_SLEEP_LOCK);
}
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);
- callui_display_state_e state;
+ callui_display_state_e state = CALLUI_DISPLAY_NORMAL;
if (_callui_common_is_powerkey_ending_call_mode_on()) {
-
- if (_callui_lock_manager_is_lcd_off(ad->lock_manager)) {
- dbg("Lock Manager LCD status [OFF]. Ignore Power key ending call mode");
+ if (_g_ignore_power_key_end_call) {
+ _g_ignore_power_key_end_call = false;
+ dbg("Proximity sensor was closed when Power key was pressed. Ignore Power key ending call mode");
return;
}
if (!strcmp(ev->keyname, CALLUI_KEY_POWER)) {
dbg("KEY_POWER");
ad->powerkey_press_time = ecore_time_get();
+
+ if (_callui_lock_manager_is_lcd_off(ad->lock_manager) && _callui_common_is_powerkey_ending_call_mode_on()) {
+ _g_ignore_power_key_end_call = true;
+ }
}
return ECORE_CALLBACK_DONE;