#define _EDJ(obj) elm_layout_edje_get(obj)
#endif
-#define MSG_PKG "org.tizen.message"
-
#undef _
#define _(s) gettext(s)
void _callui_common_win_set_noti_type(void *appdata, bool win_noti);
/**
- * @brief Launch contacts application
+ * @brief Launch bluetooth application
*
* @param[in] appdata App data
*
*/
-void _callui_common_launch_contacts(void *appdata);
+void _callui_common_launch_setting_bluetooth(void *appdata);
/**
- * @brief Launch bluetooth application
+ * @brief Launch Composer of Message application
*
* @param[in] appdata App data
+ * @param[in] number Phone number
*
*/
-void _callui_common_launch_bt_app(void *appdata);
+void _callui_common_launch_msg_composer(void *appdata, const char *number);
/**
- * @brief Launch dialer application
+ * @brief Launch Dialer of Phone application
*
* @param[in] appdata App data
*
void _callui_common_launch_dialer(void *appdata);
/**
- * @brief Launch message application
+ * @brief Launch Contacts application
*
* @param[in] appdata App data
- * @param[in] number Phone number
*
*/
-void _callui_common_launch_msg_composer(void *appdata, const char *number);
+void _callui_common_launch_contacts(void *appdata);
/**
* @brief Reset main layout text fields
#include "callui-state-provider.h"
#include "callui-view-caller-info-defines.h"
-#define PART_SWALLOW_ACTION_BAR "action_bar"
+#define PART_SWALLOW_ACTION_BAR "action_bar"
typedef enum {
CALLUI_ACTION_BTN_SPEAKER = 0,
if (bt_state == BT_ADAPTER_DISABLED) {
_callui_load_bluetooth_popup(ad);
} else {
- _callui_common_launch_bt_app(ad);
+ _callui_common_launch_setting_bluetooth(ad);
}
} else {
err("Fail to get vconf key: %d", ret_code);
#include "callui-sound-manager.h"
#include "callui-state-provider.h"
-#define CONTACT_PKG "org.tizen.contacts"
-#define PHONE_PKG "org.tizen.phone"
-#define BLUETOOTH_PKG "ug-bluetooth-efl"
+#define BLUETOOTH_PKG "ug-bluetooth-efl"
+#define CONTACTS_PKG "org.tizen.contacts"
+
+#define PHONE_TELEPHONE_URI "tel:"
+#define PHONE_LAUNCH_TYPE_PARAM_NAME "launch_type"
+#define PHONE_LAUNCH_TYPE_VALUE "add_call"
+
+#define MESSAGE_SMS_URI "sms:"
#define TIME_BUF_LEN (16)
+#define CONTACT_NUMBER_BUF_LEN 32
static bool g_is_headset_connected;
}
}
-void _callui_common_launch_contacts(void *appdata)
+static void __reset_visibility_properties(callui_app_data_t *ad)
{
- dbg("..");
- app_control_h service;
- callui_app_data_t *ad = appdata;
_callui_lock_manager_stop(ad->lock_handle);
ad->start_lock_manager_on_resume = true;
- _callui_common_win_set_noti_type(appdata, false);
-
- int ret = app_control_create(&service);
- if (ret < 0) {
- err("app_control_create() return error : %d", ret);
- return;
- }
-
- if (app_control_set_app_id(service, CONTACT_PKG) != APP_CONTROL_ERROR_NONE) {
- err("app_control_set_app_id() is failed");
- } else if (app_control_set_operation(service, APP_CONTROL_OPERATION_DEFAULT) != APP_CONTROL_ERROR_NONE) {
- err("app_control_set_operation() is failed");
- } else if (app_control_send_launch_request(service, NULL, NULL) != APP_CONTROL_ERROR_NONE) {
- err("app_control_send_launch_request() is failed");
- }
-
- app_control_destroy(service);
+ _callui_common_win_set_noti_type(ad, false);
}
-void _callui_common_launch_bt_app(void *appdata)
+void _callui_common_launch_setting_bluetooth(void *appdata)
{
- dbg("..");
- app_control_h service;
- callui_app_data_t *ad = appdata;
- _callui_lock_manager_stop(ad->lock_handle);
- ad->start_lock_manager_on_resume = true;
+ CALLUI_RETURN_IF_FAIL(appdata);
- _callui_common_win_set_noti_type(appdata, false);
+ callui_app_data_t *ad = appdata;
- int ret = app_control_create(&service);
- if (ret < 0) {
- err("app_control_create() return error : %d", ret);
- return;
+ app_control_h app_control = NULL;
+ int ret;
+ if ((ret = app_control_create(&app_control)) != APP_CONTROL_ERROR_NONE) {
+ err("app_control_create() is failed. ret[%d]", ret);
+ } else if ((ret = app_control_set_app_id(app_control, BLUETOOTH_PKG)) != APP_CONTROL_ERROR_NONE) {
+ err("app_control_set_app_id() is failed. ret[%d]", ret);
+ } else if ((ret = app_control_set_operation(app_control, APP_CONTROL_OPERATION_PICK)) != APP_CONTROL_ERROR_NONE) {
+ err("app_control_set_operation() is failed. ret[%d]", ret);
+ } 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 {
+ __reset_visibility_properties(ad);
}
-
- if (app_control_set_app_id(service, BLUETOOTH_PKG) != APP_CONTROL_ERROR_NONE) {
- err("app_control_set_app_id() is failed");
- } else if (app_control_set_operation(service, APP_CONTROL_OPERATION_PICK) != APP_CONTROL_ERROR_NONE) {
- err("app_control_set_operation() is failed");
- } else if (app_control_send_launch_request(service, NULL, NULL) != APP_CONTROL_ERROR_NONE) {
- err("app_control_send_launch_request() is failed");
+ if (app_control) {
+ app_control_destroy(app_control);
}
-
- app_control_destroy(service);
}
void _callui_common_launch_dialer(void *appdata)
{
- app_control_h service = NULL;
- int ret = APP_CONTROL_ERROR_NONE;
- char *uri = NULL;
+ CALLUI_RETURN_IF_FAIL(appdata);
callui_app_data_t *ad = appdata;
- _callui_lock_manager_stop(ad->lock_handle);
- ad->start_lock_manager_on_resume = true;
-
- _callui_common_win_set_noti_type(appdata, false);
-
- ret = app_control_create(&service);
- if (ret < 0) {
- err("app_control_create() return error : %d", ret);
- return;
- }
- uri = (char *)calloc(5, sizeof(char));
- if (uri == NULL) {
- err("memory alloc failed");
- app_control_destroy(service);
- return;
+ app_control_h app_control = NULL;
+ int ret;
+ if ((ret = app_control_create(&app_control)) != APP_CONTROL_ERROR_NONE) {
+ err("app_control_create() is failed. ret[%d]", ret);
+ } else if ((ret = app_control_set_operation(app_control, APP_CONTROL_OPERATION_DIAL)) != APP_CONTROL_ERROR_NONE) {
+ err("app_control_set_operation() is failed. ret[%d]", ret);
+ } else if ((ret = app_control_set_uri(app_control, PHONE_TELEPHONE_URI)) != APP_CONTROL_ERROR_NONE) {
+ err("app_control_set_uri() is failed. ret[%d]", ret);
+ } else if ((ret = app_control_add_extra_data(app_control, PHONE_LAUNCH_TYPE_PARAM_NAME, PHONE_LAUNCH_TYPE_VALUE)) != 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) {
+ err("app_control_send_launch_request() is failed. ret[%d]", ret);
+ } else {
+ __reset_visibility_properties(ad);
}
- snprintf(uri, sizeof(char)*5, "%s", "tel:");
-
- if (app_control_set_app_id(service, PHONE_PKG) != APP_CONTROL_ERROR_NONE) {
- err("app_control_set_app_id() is failed");
- } else if (app_control_set_operation(service, APP_CONTROL_OPERATION_DIAL) != APP_CONTROL_ERROR_NONE) {
- err("app_control_set_operation() is failed");
- } else if (app_control_set_uri(service, uri) != APP_CONTROL_ERROR_NONE) {
- err("app_control_set_uri() is failed");
- } else if (app_control_add_extra_data(service, "launch_type", "add_call") != APP_CONTROL_ERROR_NONE) {
- err("app_control_add_extra_data() is failed");
- } else if (app_control_send_launch_request(service, NULL, NULL) != APP_CONTROL_ERROR_NONE) {
- err("app_control_send_launch_request() is failed");
+ if (app_control){
+ app_control_destroy(app_control);
}
-
- app_control_destroy(service);
- free(uri);
-
- return;
}
-void _callui_common_launch_msg_composer(void *appdata, const char *number)
+void _callui_common_launch_contacts(void *appdata)
{
- dbg("..");
-
- app_control_h service;
- int ret = APP_CONTROL_ERROR_NONE;
+ CALLUI_RETURN_IF_FAIL(appdata);
callui_app_data_t *ad = appdata;
- _callui_lock_manager_stop(ad->lock_handle);
- ad->start_lock_manager_on_resume = true;
-
- _callui_common_win_set_noti_type(appdata, false);
- ret = app_control_create(&service);
- if (ret != APP_CONTROL_ERROR_NONE) {
- warn("app_control_create() return error : %d", ret);
- return;
+ app_control_h app_control = NULL;
+ int ret;
+ if ((ret = app_control_create(&app_control)) != APP_CONTROL_ERROR_NONE) {
+ err("app_control_create() is failed. ret[%d]", ret);
+ } else if ((ret = app_control_set_app_id(app_control, CONTACTS_PKG)) != APP_CONTROL_ERROR_NONE) {
+ err("app_control_set_app_id() is failed. ret[%d]", ret);
+ } else if ((ret = app_control_set_operation(app_control, APP_CONTROL_OPERATION_DEFAULT)) != APP_CONTROL_ERROR_NONE) {
+ err("app_control_set_operation() is failed. ret[%d]", ret);
+ } 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 {
+ __reset_visibility_properties(ad);
}
-
- ret = app_control_set_app_id(service, MSG_PKG);
- if (ret != APP_CONTROL_ERROR_NONE) {
- warn("app_control_set_app_id() return error : %d", ret);
- ret = app_control_destroy(service);
- return;
+ if (app_control) {
+ app_control_destroy(app_control);
}
+}
- if (number) {
- ret = app_control_add_extra_data(service, "type", "compose");
- if (ret != APP_CONTROL_ERROR_NONE) {
- warn("app_control_add_extra_data() return error : %d", ret);
- ret = app_control_destroy(service);
- return;
- }
+void _callui_common_launch_msg_composer(void *appdata, const char *number)
+{
+ CALLUI_RETURN_IF_FAIL(appdata);
- if (strlen(number) > 0) {
- const char *array[] = { number };
- ret = app_control_add_extra_data_array(service, APP_CONTROL_DATA_TO, array, 1);
- if (ret != APP_CONTROL_ERROR_NONE) {
- warn("app_control_add_extra_data() return error : %d", ret);
- ret = app_control_destroy(service);
- return;
- }
- }
- }
+ callui_app_data_t *ad = appdata;
- ret = app_control_send_launch_request(service, NULL, NULL);
- if (ret != APP_CONTROL_ERROR_NONE) {
- warn("app_control_send_launch_request() is failed : %d", ret);
+ char str[CONTACT_NUMBER_BUF_LEN];
+ snprintf(str, sizeof(str), "%s%s", MESSAGE_SMS_URI, number);
+
+ app_control_h app_control = NULL;
+ int ret;
+ if ((ret = app_control_create(&app_control)) != APP_CONTROL_ERROR_NONE) {
+ err("app_control_create() failed. ret[%d]", ret);
+ } else if ((ret = app_control_set_operation(app_control, APP_CONTROL_OPERATION_COMPOSE)) != 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) {
+ err("app_control_send_launch_request() is failed. ret[%d]", ret);
+ } else {
+ __reset_visibility_properties(ad);
+ }
+ if (app_control) {
+ app_control_destroy(app_control);
}
-
- app_control_destroy(service);
}
void _callui_common_reset_main_ly_text_fields(Evas_Object *contents)
#include "callui-state-provider.h"
#define APP_CONTROL_MIME_CONTACT "application/vnd.tizen.contact"
-#define CONTACT_NUMBER_BUF_LEN 32
#define OUTGOING_CALL_TIME_DURATION_STR "00:00"
#define ENDING_TIMER_INTERVAL 2.0
#define BLINKING_TIMER_INTERVAL 0.5
static void __bg_mouse_down_cb(void *data, Evas_Object *o, const char *emission, const char *source);
+static void __launch_contact_app(const char *operation, const char *call_number);
+
callui_view_callend_h _callui_view_callend_new()
{
callui_view_callend_h callend_view = calloc(1, sizeof(_callui_view_callend_t));
return NULL;
}
+static void __launch_contact_app(const char *operation, const char *call_number)
+{
+ app_control_h app_control = NULL;
+ int ret;
+ if ((ret = app_control_create(&app_control)) != APP_CONTROL_ERROR_NONE) {
+ err("app_control_create() is failed. ret[%d]", ret);
+ } else if ((ret = app_control_set_operation(app_control, operation)) != APP_CONTROL_ERROR_NONE) {
+ err("app_control_set_operation() is failed. ret[%d]", ret);
+ } else if ((ret = app_control_set_mime(app_control, APP_CONTROL_MIME_CONTACT)) != APP_CONTROL_ERROR_NONE) {
+ 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) {
+ err("app_control_send_launch_request() is failed. ret[%d]", ret);
+ }
+ if (app_control) {
+ app_control_destroy(app_control);
+ }
+}
+
static void __create_contact_btn_click_cb(void *data, Evas_Object *obj, void *event_info)
{
CALLUI_RETURN_IF_FAIL(data);
- callui_view_callend_h vd = (callui_view_callend_h)data;
- _callui_common_exit_app();
+ callui_view_callend_h vd = data;
- // TODO: Need to replace into launcher
- app_control_h request;
- app_control_create(&request);
- app_control_set_operation(request, APP_CONTROL_OPERATION_ADD);
- app_control_set_mime(request, APP_CONTROL_MIME_CONTACT);
- app_control_add_extra_data(request, APP_CONTROL_DATA_PHONE, vd->call_number);
+ _callui_common_exit_app();
- int err = app_control_send_launch_request(request, NULL, NULL);
- if (err != APP_CONTROL_ERROR_NONE) {
- dbg("app_control_send_launch_request() is failed");
- }
- app_control_destroy(request);
+ __launch_contact_app(APP_CONTROL_OPERATION_ADD, vd->call_number);
}
static void __update_contact_btn_click_cb(void *data, Evas_Object *obj, void *event_info)
{
CALLUI_RETURN_IF_FAIL(data);
- callui_view_callend_h vd = (callui_view_callend_h)data;
- _callui_common_exit_app();
+ callui_view_callend_h vd = data;
- // TODO: Need to replace into launcher
- app_control_h request;
- app_control_create(&request);
- app_control_set_operation(request, APP_CONTROL_OPERATION_EDIT);
- app_control_set_mime(request, APP_CONTROL_MIME_CONTACT);
- app_control_add_extra_data(request, APP_CONTROL_DATA_PHONE, vd->call_number);
+ _callui_common_exit_app();
- int result = app_control_send_launch_request(request, NULL, NULL);
- if (result != APP_CONTROL_ERROR_NONE) {
- err("app_control_send_launch_request() failed (%d)", result);
- }
- app_control_destroy(request);
+ __launch_contact_app(APP_CONTROL_OPERATION_EDIT, vd->call_number);
}
static void __popup_back_click_cb(void *data, Evas_Object *obj, void *event_info)
{
CALLUI_RETURN_IF_FAIL(data);
- callui_view_callend_h vd = (callui_view_callend_h)data;
+ callui_view_callend_h vd = data;
evas_object_del(obj);
static void __msg_btn_click_cb(void *data, Evas_Object *obj, const char *emission, const char *source)
{
CALLUI_RETURN_IF_FAIL(data);
- callui_view_callend_h vd = (callui_view_callend_h)data;
+ callui_view_callend_h vd = data;
+ callui_app_data_t *ad = vd->base_view.ad;
edje_object_signal_callback_del_full(_EDJ(obj), "clicked", "edje", __msg_btn_click_cb, vd);
- app_control_h request;
- app_control_create(&request);
- app_control_set_operation(request, APP_CONTROL_OPERATION_COMPOSE);
- char str[CONTACT_NUMBER_BUF_LEN];
- snprintf(str, sizeof(str), "sms:%s", vd->call_number);
- app_control_set_uri(request, str);
-
- int result = app_control_send_launch_request(request, NULL, NULL);
- if (result != APP_CONTROL_ERROR_NONE) {
- err("app_control_send_launch_request() failed (%d)", result);
- }
- app_control_destroy(request);
+ _callui_common_launch_msg_composer(ad, vd->call_number);
}
static Eina_Bool __ending_timer_expired_cb(void *data)
#define POPUP_LIST_ITEM_H 120
#define APP_CONTROL_MIME_CONTACT "application/vnd.tizen.contact"
#define CONTACT_ID_BUF_LEN 16
-#define CONTACT_NUMBER_BUF_LEN 32
typedef struct {
int index;
__callui_unload_bt_popup(ad);
/* Launch the BT App Control */
- _callui_common_launch_bt_app(ad);
+ _callui_common_launch_setting_bluetooth(ad);
return;
}
static void __launch_btn_click_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info)
{
- char *key = (char *) data;
- if (key == NULL) {
- return;
- }
+ CALLUI_RETURN_IF_FAIL(data);
+
+ char *key = (char *)data;
- //TODO: replace to separate launcher
app_control_h app_control = NULL;
- if (app_control_create(&app_control) != APP_CONTROL_ERROR_NONE) {
- dbg("app_control_create() is failed");
- } else if (app_control_set_app_id(app_control, "org.tizen.call-ui") != APP_CONTROL_ERROR_NONE) {
- dbg("app_control_set_app_id() is failed");
- } else if (app_control_set_operation(app_control, key) != APP_CONTROL_ERROR_NONE) {
- dbg("app_control_set_operation() is failed");
- } else if (app_control_send_launch_request(app_control, NULL, NULL) != APP_CONTROL_ERROR_NONE) {
- err("app_control_send_launch_request() is failed");
+ int ret;
+ if ((ret = app_control_create(&app_control)) != APP_CONTROL_ERROR_NONE) {
+ err("app_control_create() is failed. ret[%d]", ret);
+ } else if (app_control_set_app_id(app_control, PACKAGE) != APP_CONTROL_ERROR_NONE) {
+ err("app_control_set_app_id() is failed. ret[%d]", ret);
+ } else if ((ret = app_control_set_operation(app_control, key)) != APP_CONTROL_ERROR_NONE) {
+ err("app_control_set_operation() is failed. ret[%d]", ret);
+ } 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);
+ }
+ if (app_control) {
+ app_control_destroy(app_control);
}
-
- app_control_destroy(app_control);
}
static callui_result_e __create_main_content(callui_view_incoming_call_noti_h vd)
callui_app_data_t *ad = qp->ad;
__hide_minicontrol(qp);
- app_control_h request;
- app_control_create(&request);
- app_control_set_app_id(request, PACKAGE);
- int err = app_control_send_launch_request(request, NULL, NULL);
- if (err != APP_CONTROL_ERROR_NONE) {
- err("app_control_send_launch_request() failed(0x%x)", err);
- return;
+ app_control_h app_control = NULL;
+ int ret;
+ if ((ret = app_control_create(&app_control)) != APP_CONTROL_ERROR_NONE) {
+ err("app_control_create() is failed. ret[%d]", ret);
+ } else if ((ret = app_control_set_app_id(app_control, PACKAGE)) != APP_CONTROL_ERROR_NONE) {
+ err("app_control_set_app_id() is failed. ret[%d]", ret);
+ } 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 {
+ ad->on_background = false;
+ _callui_lock_manager_start(ad->lock_handle);
+ }
+ if (app_control) {
+ app_control_destroy(app_control);
}
-
- app_control_destroy(request);
- ad->on_background = false;
- _callui_lock_manager_start(ad->lock_handle);
}
static void __hide_minicontrol(callui_qp_mc_h qp)
static void __app_lang_changed_cb(app_event_info_h event_info, void *user_data);
static bool __app_init(callui_app_data_t *ad);
-static bool __app_deinit(callui_app_data_t *ad);
+static void __app_deinit(callui_app_data_t *ad);
static bool __create_main_gui_elem(callui_app_data_t *ad);
static Evas_Object *__create_main_window(callui_app_data_t *ad);
if (!res) {
__app_deinit(data);
}
+
return res;
}
return true;
}
-static bool __app_deinit(callui_app_data_t *ad)
+static void __app_deinit(callui_app_data_t *ad)
{
debug_enter();
__bt_deinit();
debug_leave();
-
- return false;
}
static void __app_terminate(void *data)
static void __app_pause(void *data)
{
- dbg("..");
+ debug_enter();
_callui_common_unset_lock_state_changed_cb();
callui_app_data_t *ad = data;
_callui_vm_pause(ad->view_manager);
+
+ debug_leave();
}
static void __app_resume(void *data)
{
- dbg("..");
+ debug_enter();
callui_app_data_t *ad = data;
}
_callui_vm_resume(ad->view_manager);
+
+ debug_leave();
}
static void __app_service(app_control_h app_control, void *data)
Ecore_Event_Key *ev = event;
if (ev == NULL) {
- err("ERROR!!! ========= Event is NULL!!!");
- return 0;
+ err("ERROR!!! Event is NULL!!!");
+ return EINA_FALSE;
}
callui_view_type_e view_type = _callui_vm_get_cur_view_type(ad->view_manager);
_callui_manager_end_call(ad->call_manager,
incom->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_SINGLECALL ||
+ view_type == CALLUI_VIEW_MULTICALL_CONF) {
_callui_manager_end_call(ad->call_manager, 0, CALLUI_CALL_RELEASE_ALL);
- } else if (view_type == CALLUI_VIEW_MULTICALL_SPLIT
- || view_type == CALLUI_VIEW_MULTICALL_LIST) {
+ } else if (view_type == CALLUI_VIEW_MULTICALL_SPLIT ||
+ view_type == CALLUI_VIEW_MULTICALL_LIST) {
_callui_manager_end_call(ad->call_manager, 0, CALLUI_CALL_RELEASE_ALL_ACTIVE);
}
} else {
Ecore_Event_Key *ev = event;
if (ev == NULL) {
- err("ERROR!!! ========= Event is NULL!!!");
+ err("ERROR!!! Event is NULL!!!");
return EINA_FALSE;
}