#define CALLUI_BUFF_SIZE_SML 32
#define CALLUI_BUFF_SIZE_TINY 16
+#define CALLUI_PAUSE_LOCK_TIMEOUT_LIMIT_SEC 0.3
+
#undef SAFE_C_CAST
#define SAFE_C_CAST(type, value) ((type)(ptrdiff_t)value)
/**
* @brief Launch Composer of Message application
*
- * @param[in] appdata App data
- * @param[in] number Phone number
+ * @param[in] appdata App data
+ * @param[in] number Phone number
+ * @param[in] is_exit_app_needed Set if exit application is needed on Message app launch
*
*/
-void _callui_common_launch_msg_composer(void *appdata, const char *number);
+void _callui_common_launch_msg_composer(void *appdata, const char *number, bool is_exit_app_needed);
/**
* @brief Launch Dialer of Phone application
#define CALLUI_CSTM_I18N_UDATE_IGNORE -2 /* Used temporarily since there is no substitute of UDATE_IGNORE in base-utils */
#define CALLUI_TIME_STRING_BUFF_SIZE 512
-#define CALLUI_PAUSE_LOCK_TIMEOUT_LIMIT 0.35
#define CALLUI_TIME_FORMAT_12 "hm"
#define CALLUI_TIME_FORMAT_24 "Hm"
if (type == CALLUI_LOCK_TYPE_SECURITY_LOCK) {
_callui_window_set_above_lockscreen_mode(ad->window, false);
}
- _callui_common_unlock_swipe_lock();
+
+ if (type != CALLUI_LOCK_TYPE_UNLOCK) {
+ _callui_common_unlock_swipe_lock();
+ }
}
static void __app_launch_reply_cb(app_control_h request, app_control_h reply, app_control_result_e result, void *user_data)
}
}
-void _callui_common_launch_msg_composer(void *appdata, const char *number)
+static void __msg_composer_launch_reply_cb(callui_app_data_t *ad, app_control_result_e result)
+{
+ if (result == APP_CONTROL_RESULT_APP_STARTED) {
+ ad->on_background = true;
+ if (_callui_common_get_idle_lock_type() != CALLUI_LOCK_TYPE_UNLOCK) {
+ _callui_common_unlock_swipe_lock();
+ }
+ }
+}
+
+static void __msg_composer_launch_with_app_exit_reply_cb(app_control_h request, app_control_h reply, app_control_result_e result, void *user_data)
+{
+ debug_enter();
+
+ __msg_composer_launch_reply_cb(user_data, result);
+
+ _callui_common_exit_app();
+}
+
+static void __msg_composer_launch_without_app_exit_reply_cb(app_control_h request, app_control_h reply, app_control_result_e result, void *user_data)
+{
+ debug_enter();
+
+ __msg_composer_launch_reply_cb(user_data, result);
+}
+
+void _callui_common_launch_msg_composer(void *appdata, const char *number, bool is_exit_app_needed)
{
CALLUI_RETURN_IF_FAIL(appdata);
char str[CALLUI_BUFF_SIZE_SML];
snprintf(str, sizeof(str), "%s%s", CALLUI_MESSAGE_SMS_URI, number);
+ app_control_reply_cb reply_func = NULL;
+ if (is_exit_app_needed) {
+ reply_func = __msg_composer_launch_with_app_exit_reply_cb;
+ } else {
+ reply_func = __msg_composer_launch_without_app_exit_reply_cb;
+ }
+
app_control_h app_control = NULL;
int ret;
if ((ret = app_control_create(&app_control)) != APP_CONTROL_ERROR_NONE) {
err("app_control_set_operation() is failed. ret[%d]", ret);
} else if ((ret = app_control_set_uri(app_control, str)) != APP_CONTROL_ERROR_NONE) {
err("app_control_set_uri() is failed. ret[%d]", ret);
- } else if ((ret = app_control_send_launch_request(app_control, NULL, NULL)) != APP_CONTROL_ERROR_NONE) {
+ } else if ((ret = app_control_enable_app_started_result_event(app_control)) != APP_CONTROL_ERROR_NONE) {
+ 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 {
__reset_visibility_properties(ad);
}
+
+ if (ret != APP_CONTROL_ERROR_NONE && is_exit_app_needed) {
+ _callui_common_exit_app();
+ }
+
if (app_control) {
app_control_destroy(app_control);
}
ret = vconf_get_bool(VCONFKEY_CISSAPPL_POWER_KEY_ENDS_CALL_BOOL, &powerkey_mode);
if (!ret) {
- dbg("powerkey_mode = [%d] \n", powerkey_mode);
+ dbg("powerkey_mode = [%d]", powerkey_mode);
} else {
- dbg("vconf_get_int failed..[%d]\n", ret);
+ dbg("vconf_get_int failed..[%d]", ret);
}
return powerkey_mode;
}
static void __lock_state_changed_cb(system_settings_key_e key, void *user_data)
{
+ debug_enter();
+
CALLUI_RETURN_IF_FAIL(user_data);
callui_app_data_t *ad = user_data;
} else {
dbg("Device lock state [LOCKED]");
if (!ad->on_background) {
+ dbg("App on background [NO]");
_callui_window_set_above_lockscreen_mode(ad->window, true);
} else {
+ dbg("App on background [YES]");
double time_diff = ecore_time_get() - ad->app_pause_time;
- if (time_diff <= CALLUI_PAUSE_LOCK_TIMEOUT_LIMIT) {
- dbg("App_pause -> lock_device time diff [%ld]", time_diff);
+ dbg("Pause and Lock time diff [%lf]", time_diff);
+ if (time_diff <= CALLUI_PAUSE_LOCK_TIMEOUT_LIMIT_SEC) {
_callui_window_set_above_lockscreen_mode(ad->window, true);
ad->app_pause_time = 0.0;
+ ad->on_background = false;
}
if (_callui_lock_manager_is_started(ad->lock_handle)) {
_callui_lock_manager_stop(ad->lock_handle);
}
}
}
+
+ debug_leave();
}
void _callui_common_set_lock_state_changed_cb(void *user_data)
int res = device_display_get_state(&disp_state);
CALLUI_RETURN_VALUE_IF_FAIL(res == DEVICE_ERROR_NONE, false);
- switch (disp_state) {
- case DISPLAY_STATE_NORMAL:
- case DISPLAY_STATE_SCREEN_DIM:
- return true;
- case DISPLAY_STATE_SCREEN_OFF:
- default:
- return false;
- }
+ return (disp_state == DISPLAY_STATE_NORMAL || disp_state == DISPLAY_STATE_SCREEN_DIM);
}
static void __call_back_btn_click_cb(void *data, Evas_Object *obj, const char *emission, const char *source);
static void __msg_btn_click_cb(void *data, Evas_Object *obj, const char *emission, const char *source);
-static char *__vcui_endcall_get_item_text(void *data, Evas_Object *obj, const char *part);
+static char *__endcall_gl_item_text_cb(void *data, Evas_Object *obj, const char *part);
static void __create_contact_btn_click_cb(void *data, Evas_Object *obj, void *event_info);
static void __update_contact_btn_click_cb(void *data, Evas_Object *obj, void *event_info);
static void __run_minimize_animation(callui_view_callend_h vd);
static void __run_maximize_animation(callui_view_callend_h vd);
-static void __launch_contact_app(const char *operation, const char *call_number);
+static void __launch_contact_app(const char *operation, const char *call_number, callui_app_data_t *ad);
callui_view_callend_h _callui_view_callend_new()
{
__run_maximize_animation(data);
}
-static char *__vcui_endcall_get_item_text(void *data, Evas_Object *obj, const char *part)
+static char *__endcall_gl_item_text_cb(void *data, Evas_Object *obj, const char *part)
{
CALLUI_RETURN_VALUE_IF_FAIL(data, NULL);
if (!strcmp(part, "elm.text")) {
return NULL;
}
-static void __launch_contact_app(const char *operation, const char *call_number)
+static void __contact_app_launch_reply_cb(app_control_h request, app_control_h reply, app_control_result_e result, void *user_data)
+{
+ CALLUI_RETURN_IF_FAIL(user_data);
+ callui_app_data_t *ad = user_data;
+
+ if (result == APP_CONTROL_RESULT_APP_STARTED) {
+ ad->on_background = true;
+
+ if (_callui_common_get_idle_lock_type() != CALLUI_LOCK_TYPE_UNLOCK) {
+ _callui_common_unlock_swipe_lock();
+ }
+ }
+
+ _callui_common_exit_app();
+}
+
+static void __launch_contact_app(const char *operation, const char *call_number, callui_app_data_t *ad)
{
app_control_h app_control = NULL;
int ret;
err("app_control_set_mime() is failed. ret[%d]", ret);
} else if ((ret = app_control_add_extra_data(app_control, APP_CONTROL_DATA_PHONE, call_number)) != APP_CONTROL_ERROR_NONE) {
err("app_control_add_extra_data() is failed. ret[%d]", ret);
- } else if ((ret = app_control_send_launch_request(app_control, NULL, NULL)) != APP_CONTROL_ERROR_NONE) {
+ } else if ((ret = app_control_enable_app_started_result_event(app_control)) != APP_CONTROL_ERROR_NONE) {
+ err("app_control_enable_app_started_result_event() is failed. ret[%d]", ret);
+ } else if ((ret = app_control_send_launch_request(app_control, __contact_app_launch_reply_cb, ad)) != APP_CONTROL_ERROR_NONE) {
err("app_control_send_launch_request() is failed. ret[%d]", ret);
}
+
+ if(ret != APP_CONTROL_ERROR_NONE) {
+ _callui_common_exit_app();
+ }
+
if (app_control) {
app_control_destroy(app_control);
}
callui_view_callend_h vd = data;
- _callui_common_exit_app();
-
- __launch_contact_app(APP_CONTROL_OPERATION_ADD, vd->call_number);
+ __launch_contact_app(APP_CONTROL_OPERATION_ADD, vd->call_number, vd->base_view.ad);
}
static void __update_contact_btn_click_cb(void *data, Evas_Object *obj, void *event_info)
callui_view_callend_h vd = data;
- _callui_common_exit_app();
-
- __launch_contact_app(APP_CONTROL_OPERATION_EDIT, vd->call_number);
+ __launch_contact_app(APP_CONTROL_OPERATION_EDIT, vd->call_number, vd->base_view.ad);
}
static void __popup_back_click_cb(void *data, Evas_Object *obj, void *event_info)
Elm_Genlist_Item_Class *itc = elm_genlist_item_class_new();
CALLUI_RETURN_IF_FAIL(itc);
itc->item_style = "type1";
- itc->func.text_get = __vcui_endcall_get_item_text;
+ itc->func.text_get = __endcall_gl_item_text_cb;
elm_genlist_item_append(genlist, itc, _("IDS_COM_OPT_CREATE_CONTACT"),
NULL, ELM_GENLIST_ITEM_NONE, __create_contact_btn_click_cb, vd);
edje_object_signal_callback_del_full(_EDJ(obj), "clicked", "edje", __msg_btn_click_cb, vd);
- _callui_common_launch_msg_composer(ad, vd->call_number);
-
- _callui_common_exit_app();
+ _callui_common_launch_msg_composer(ad, vd->call_number, true);
}
static Eina_Bool __ending_timer_expired_cb(void *data)
const callui_call_data_t *incom = _callui_stp_get_call_data(ad->state_provider, CALLUI_CALL_DATA_INCOMING);
CALLUI_RETURN_IF_FAIL(incom);
- _callui_common_launch_msg_composer(ad, incom->call_num);
+ _callui_common_launch_msg_composer(ad, incom->call_num, false);
callui_result_e res = _callui_manager_reject_call(ad->call_manager);
if (res != CALLUI_RESULT_OK) {
__reset_params_after_transit(data);
callui_view_incoming_call_noti_h vd = data;
+ vd->base_view.ad->on_background = true;
+
_callui_window_set_top_level_priority(vd->base_view.ad->window, false);
_callui_window_minimize(vd->base_view.ad->window);
- vd->base_view.ad->on_background = true;
}
static Eina_Bool __appear_effect_activated_cb(void *data)
const callui_call_data_t *incom = _callui_stp_get_call_data(ad->state_provider, CALLUI_CALL_DATA_INCOMING);
CALLUI_RETURN_IF_FAIL(incom);
- _callui_common_launch_msg_composer(ad, incom->call_num);
+ _callui_common_launch_msg_composer(ad, incom->call_num, false);
callui_result_e res = _callui_manager_reject_call(ad->call_manager);
if (res != CALLUI_RESULT_OK) {