bool mc_is_call_connected(void)
{
- telephony_call_state_e state;
+ telephony_call_h *call_list_sim;
telephony_handle_list_s tel_list;
+ telephony_error_e ret_sim;
+ unsigned int count_sim[2] = {0};
+
int tel_valid = telephony_init(&tel_list);
if (tel_valid != 0) {
ERROR_TRACE("telephony is not initialized. ERROR Code is %d",
return false;
}
- telephony_h *newhandle = tel_list.handle;
+ for (int i=0;i<tel_list.count;i++) {
+ ret_sim =
+ telephony_call_get_call_list(tel_list.handle[i], &count_sim[i],
+ &call_list_sim);
+ if (ret_sim != TELEPHONY_ERROR_NONE) {
+ ERROR_TRACE("Cannot get call list information for primary sim");
+ }
- int error = telephony_call_get_voice_call_state(*newhandle, &state);
+ telephony_call_release_call_list(count_sim[i], &call_list_sim);
+ }
telephony_deinit(&tel_list);
- if (error == TELEPHONY_ERROR_NONE) {
- if (state == TELEPHONY_CALL_STATE_IDLE) {
- return false; /*There exists no calls */
- }
- /* There exists at least one call that is dialing, alerting or incoming */
+ if (count_sim[0] > 0) {
+ DEBUG_TRACE("Call connected from SIM 1");
return true;
- } else {
- ERROR_TRACE("ERROR: state error is %d", error);
}
+
+ if (count_sim[1] > 0) {
+ DEBUG_TRACE("Call connected from SIM 2");
+ return true;
+ }
+
return false;
}
WARN_TRACE("Enter sound_manager_set_active_device_changed_cb");
ret =
- sound_manager_set_device_information_changed_cb
- (SOUND_DEVICE_ALL_MASK, _mp_app_active_device_chaged_cb, ad);
+ sound_manager_add_device_state_changed_cb
+ (SOUND_DEVICE_ALL_MASK, _mp_app_active_device_chaged_cb, ad, &ad->device_state_id);
if (ret != SOUND_MANAGER_ERROR_NONE) {
ERROR_TRACE
("sound_manager_set_active_device_changed_cb().. [0x%x]", ret);
sound_device_list_h g_device_list = NULL;
sound_device_mask_e g_device_mask = SOUND_DEVICE_IO_DIRECTION_OUT_MASK;
WARN_TRACE("Enter sound_manager_get_active_device");
- int ret;
+ int ret = SOUND_MANAGER_ERROR_NONE;
if ((ret =
- sound_manager_get_current_device_list(g_device_mask,
- &g_device_list))) {
+ sound_manager_get_device_list(g_device_mask,
+ &g_device_list))) {
ERROR_TRACE("sound_manager_get_active_device()... [0x%x]", ret);
}
bool mp_util_is_call_connected(void)
{
- telephony_call_state_e state;
+ telephony_call_h *call_list_sim;
telephony_handle_list_s tel_list;
+ telephony_error_e ret_sim;
+ unsigned int count_sim[2] = {0};
+
int tel_valid = telephony_init(&tel_list);
if (tel_valid != 0) {
ERROR_TRACE("telephony is not initialized. ERROR Code is %d",
return false;
}
- telephony_h *newhandle = tel_list.handle;
+ for (int i=0;i<tel_list.count;i++) {
+ ret_sim =
+ telephony_call_get_call_list(tel_list.handle[i], &count_sim[i],
+ &call_list_sim);
+ if (ret_sim != TELEPHONY_ERROR_NONE) {
+ ERROR_TRACE("Cannot get call list information for primary sim");
+ }
- int error = telephony_call_get_voice_call_state(*newhandle, &state);
+ telephony_call_release_call_list(count_sim[i], &call_list_sim);
+ }
telephony_deinit(&tel_list);
- if (error == TELEPHONY_ERROR_NONE) {
- if (state == TELEPHONY_CALL_STATE_IDLE) {
- return false; /*There exists no calls */
- }
- /* There exists at least one call that is dialing, alerting or incoming */
+ if (count_sim[0] > 0) {
+ DEBUG_TRACE("Call connected from SIM 1");
+ return true;
+ }
+
+ if (count_sim[1] > 0) {
+ DEBUG_TRACE("Call connected from SIM 2");
return true;
- } else {
- ERROR_TRACE("ERROR: state error is %d", error);
}
return false;
Evas_Object *popup[MP_POPUP_MAX];
int win_angle;
int del_cb_invoked;
+ int device_state_id;
/* App control parameters */
bool exit_status;
ERROR_TRACE("Unable to remove callback for recorder state");
}
+ int error = SOUND_MANAGER_ERROR_NONE;
+ error = sound_manager_remove_device_state_changed_cb(ad->device_state_id);
+ if (error != SOUND_MANAGER_ERROR_NONE) {
+ ERROR_TRACE("Cannot remove device state changed callback");
+ }
+
if (ad->stream_info) {
- int error =
+ error =
sound_manager_destroy_stream_information(ad->stream_info);
if (error != SOUND_MANAGER_ERROR_NONE) {
ERROR_TRACE("unable to destroy stream. error code [%x]",
sound_device_list_h g_device_list = NULL;
sound_device_mask_e g_device_mask = SOUND_DEVICE_IO_DIRECTION_OUT_MASK;
WARN_TRACE("Enter sound_manager_get_active_device");
- int ret;
+ int ret = SOUND_MANAGER_ERROR_NONE;
if ((ret =
- sound_manager_get_current_device_list(g_device_mask,
- &g_device_list))) {
+ sound_manager_get_device_list(g_device_mask,
+ &g_device_list))) {
ERROR_TRACE("sound_manager_get_active_device()... [0x%x]", ret);
}
sound_device_list_h g_device_list = NULL;
sound_device_mask_e g_device_mask = SOUND_DEVICE_IO_DIRECTION_OUT_MASK;
WARN_TRACE("Enter sound_manager_get_active_device");
- int ret;
+ int ret = SOUND_MANAGER_ERROR_NONE;
if ((ret =
- sound_manager_get_current_device_list(g_device_mask,
- &g_device_list))) {
+ sound_manager_get_device_list(g_device_mask,
+ &g_device_list))) {
ERROR_TRACE("sound_manager_get_active_device()... [0x%x]", ret);
}
static bool telephony_is_call_connected(void)
{
- DEBUG_TRACE("start");
- telephony_call_h *call_list_sim1, *call_list_sim2;
- unsigned int count_sim1, count_sim2;
+ DEBUG_TRACE("Gathering Telephony Information");
+ telephony_call_h *call_list_sim;
telephony_handle_list_s tel_list;
- telephony_error_e ret_sim1, ret_sim2;
+ telephony_error_e ret_sim;
+ unsigned int count_sim[2];
int tel_valid = telephony_init(&tel_list);
if (tel_valid != 0) {
return false;
}
- ret_sim1 =
- telephony_call_get_call_list(tel_list.handle[0], &count_sim1,
- &call_list_sim1);
- if (ret_sim1 != TELEPHONY_ERROR_NONE) {
- ERROR_TRACE("Cannot get call list information for primary sim");
- }
+ for (int i=0;i<tel_list.count;i++) {
+ ret_sim =
+ telephony_call_get_call_list(tel_list.handle[i], &count_sim[i],
+ &call_list_sim);
+ if (ret_sim != TELEPHONY_ERROR_NONE) {
+ ERROR_TRACE("Cannot get call list information for primary sim");
+ }
- ret_sim2 =
- telephony_call_get_call_list(tel_list.handle[1], &count_sim2,
- &call_list_sim2);
- if (ret_sim2 != TELEPHONY_ERROR_NONE) {
- ERROR_TRACE("Cannot get call list information for secondary sim");
+ telephony_call_release_call_list(count_sim[i], &call_list_sim);
}
- telephony_call_release_call_list(count_sim1, &call_list_sim1);
- telephony_call_release_call_list(count_sim2, &call_list_sim2);
telephony_deinit(&tel_list);
- if (count_sim1 == 0 && count_sim2 == 0) {
- return false;
- } else {
+ if (count_sim[0] > 0) {
+ DEBUG_TRACE("Call connected from SIM 1");
+ return true;
+ }
+
+ if (count_sim[1] > 0) {
+ DEBUG_TRACE("Call connected from SIM 2");
return true;
}