From: bhutani.92 Date: Wed, 21 Dec 2016 08:05:14 +0000 (+0530) Subject: Removed Deprecated API's X-Git-Tag: submit/tizen/20170524.061254~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=241ce0e392659af98d6fc11fae7a09f4533b3f5e;p=profile%2Fmobile%2Fapps%2Fnative%2Fmusic-player.git Removed Deprecated API's Change-Id: I9d182e0c0391eeb0671871c82f7f3253f391768c Signed-off-by: bhutani.92 --- diff --git a/music-chooser/src/mc-common.c b/music-chooser/src/mc-common.c index ba48720..7e526f3 100644 --- a/music-chooser/src/mc-common.c +++ b/music-chooser/src/mc-common.c @@ -185,8 +185,11 @@ void mc_post_status_message(const char *text) 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", @@ -194,21 +197,29 @@ bool mc_is_call_connected(void) return false; } - telephony_h *newhandle = tel_list.handle; + for (int i=0;i 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; } diff --git a/src/common/mp-app.c b/src/common/mp-app.c index 2712513..875754d 100644 --- a/src/common/mp-app.c +++ b/src/common/mp-app.c @@ -481,8 +481,8 @@ bool mp_app_noti_init(void *data) 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); diff --git a/src/common/mp-util.c b/src/common/mp-util.c index ebcaa57..c51b39f 100644 --- a/src/common/mp-util.c +++ b/src/common/mp-util.c @@ -1113,10 +1113,10 @@ void mp_util_get_sound_path(mp_snd_path * snd_path) 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); } @@ -1890,8 +1890,11 @@ bool mp_util_system_volume_popup_show(void) 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", @@ -1899,20 +1902,27 @@ bool mp_util_is_call_connected(void) return false; } - telephony_h *newhandle = tel_list.handle; + for (int i=0;i 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; diff --git a/src/include/music.h b/src/include/music.h index 8ae7174..6a9c4b0 100644 --- a/src/include/music.h +++ b/src/include/music.h @@ -239,6 +239,7 @@ struct appdata { Evas_Object *popup[MP_POPUP_MAX]; int win_angle; int del_cb_invoked; + int device_state_id; /* App control parameters */ bool exit_status; diff --git a/src/mp-main.c b/src/mp-main.c index a442c2d..c3eab12 100644 --- a/src/mp-main.c +++ b/src/mp-main.c @@ -1275,8 +1275,14 @@ static void mp_terminate(void *data) 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]", diff --git a/src/view/mp-player-view.c b/src/view/mp-player-view.c index 15f4739..d19b1a4 100644 --- a/src/view/mp-player-view.c +++ b/src/view/mp-player-view.c @@ -605,10 +605,10 @@ void mp_player_view_set_snd_path_sensitivity(void *data) 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); } diff --git a/src/widget/mp-popup.c b/src/widget/mp-popup.c index b7d29f5..97e2455 100644 --- a/src/widget/mp-popup.c +++ b/src/widget/mp-popup.c @@ -293,10 +293,10 @@ static Evas_Object *_mp_popup_sound_path_create(Evas_Object * parent, 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); } diff --git a/widget/src/mp-widget-create.c b/widget/src/mp-widget-create.c index e6e7fb8..031c027 100644 --- a/widget/src/mp-widget-create.c +++ b/widget/src/mp-widget-create.c @@ -559,11 +559,11 @@ static void mp_widget_click_on_track_image_cb(void *data, 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) { @@ -572,27 +572,26 @@ static bool telephony_is_call_connected(void) 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 0) { + DEBUG_TRACE("Call connected from SIM 1"); + return true; + } + + if (count_sim[1] > 0) { + DEBUG_TRACE("Call connected from SIM 2"); return true; }