From 9272539d63689d13ceb2eeab1d597cd658e4c4e5 Mon Sep 17 00:00:00 2001 From: "bhutani.92" Date: Fri, 9 Jun 2017 12:34:50 +0530 Subject: [PATCH] Removed Deprecated Telephony API's Change-Id: Ide0b0da95bff92258dc574832a075157533fc24b Signed-off-by: bhutani.92 --- playview/src/common/vp-play-config.c | 77 ++++++++++++++------------- playview/src/core/vp-sound.c | 5 +- playview/src/view/include/vp-play-view-priv.h | 2 + playview/src/vp-play-view.c | 6 +++ src/common/mp-util.c | 53 ++++++++++++++---- 5 files changed, 95 insertions(+), 48 deletions(-) diff --git a/playview/src/common/vp-play-config.c b/playview/src/common/vp-play-config.c index f79560b..9d0f93d 100644 --- a/playview/src/common/vp-play-config.c +++ b/playview/src/common/vp-play-config.c @@ -232,35 +232,37 @@ static void _call_async_event_callback(telephony_h handle, VideoLogDebug("call interrupt cb called"); PlayView *pPlayView = (PlayView *) user_data; - int status = 0; - telephony_call_state_e voice_status; - telephony_call_state_e video_status; + int ret = TELEPHONY_ERROR_NONE; + telephony_call_h *call_list_sim; + telephony_call_status_e status; + telephony_call_type_e type; + telephony_error_e ret_sim; + unsigned int count_sim = 0; VideoLogDebug("getting call status"); - status = telephony_call_get_voice_call_state(handle, &voice_status); - - if (status != TELEPHONY_ERROR_NONE) { - VideoLogError("getting call status failed"); + ret_sim = + telephony_call_get_call_list(handle, &count_sim, + &call_list_sim); + if (ret_sim != TELEPHONY_ERROR_NONE) { + VideoLogError("Cannot get call list information for the sim"); return; } - status = telephony_call_get_video_call_state(handle, &video_status); - - if (status != TELEPHONY_ERROR_NONE) { - VideoLogError("getting video call status failed"); + ret = telephony_call_get_status(*call_list_sim, &status); + if (ret != TELEPHONY_ERROR_NONE) { + VideoLogError("getting call status failed"); return; } - VideoLogDebug("voice_status = %d", voice_status); - VideoLogDebug("video_status = %d", video_status); + VideoLogDebug("call status = %d", status); - if (voice_status != TELEPHONY_CALL_STATE_IDLE - || video_status != TELEPHONY_CALL_STATE_IDLE) { + telephony_call_release_call_list(count_sim, &call_list_sim); + + if (status != TELEPHONY_CALL_STATE_IDLE) { if (!vp_play_normal_view_pause(pPlayView->pNormalView)) { VideoLogError("vp_play_normal_view_pause fail"); } - } else if (voice_status == TELEPHONY_CALL_STATE_IDLE - && video_status == TELEPHONY_CALL_STATE_IDLE) { + } else if (status == TELEPHONY_CALL_STATE_IDLE) { bool bManualPause = FALSE; vp_play_normal_view_get_manual_pause(pPlayView->pNormalView, &bManualPause); @@ -286,27 +288,28 @@ bool vp_play_telephony_initialize(void *pUserData) } /*setting callbacks */ - telephony_h *newhandle = tel_list.handle; - int api_err = - telephony_set_noti_cb(*newhandle, TELEPHONY_NOTI_VOICE_CALL_STATE, - (telephony_noti_cb) - _call_async_event_callback, - (void *) pUserData); - if (api_err != TELEPHONY_ERROR_NONE) { - VideoLogError - ("tel_register_noti_event for voice call failed ( api_err : %d ) !!", - api_err); - } + for (int i=0;idevice_state_id); if (nRet != SOUND_MANAGER_ERROR_NONE) { VideoLogError("sound_manager_set_available_route_changed_cb fail"); return FALSE; diff --git a/playview/src/view/include/vp-play-view-priv.h b/playview/src/view/include/vp-play-view-priv.h index f607c41..2ef3a9b 100644 --- a/playview/src/view/include/vp-play-view-priv.h +++ b/playview/src/view/include/vp-play-view-priv.h @@ -173,4 +173,6 @@ typedef struct _PlayView { bool b_lockmini_show; bool isLiveStreaming; app_control_h pServiceShare; + + int device_state_id; } PlayView; diff --git a/playview/src/vp-play-view.c b/playview/src/vp-play-view.c index 7003757..31d34a8 100644 --- a/playview/src/vp-play-view.c +++ b/playview/src/vp-play-view.c @@ -2000,6 +2000,12 @@ bool vp_play_view_unrealize(play_view_handle pViewHandle) VideoLogError("failed to release focus error[%x]", error); } } + + error = sound_manager_remove_device_state_changed_cb(pPlayView->device_state_id); + if (error != SOUND_MANAGER_ERROR_NONE) { + VideoLogError("Cannot remove device state changed callback"); + } + media_key_release(); int nDuration = 0; if (vp_play_normal_view_get_video_duration diff --git a/src/common/mp-util.c b/src/common/mp-util.c index 01d79e5..05c909f 100644 --- a/src/common/mp-util.c +++ b/src/common/mp-util.c @@ -681,6 +681,11 @@ bool mp_util_remove_all_videos_question_popup(void *pUserData, tmpTitle = g_strdup_printf(VIDEOS_DELETEPOP_HEADER_DELETE); elm_object_part_text_set(pPopUpHandle, "title,text", tmpTitle); + if (tmpTitle) { + free(tmpTitle); + tmpTitle = NULL; + + } if (viewType == MP_LIST_VIEW_AS_FOLDER_LIST) { VideoLogInfo("All folders are selected to delete"); @@ -695,6 +700,10 @@ bool mp_util_remove_all_videos_question_popup(void *pUserData, } elm_object_part_text_set(pPopUpHandle, "default", tmpStr); + if (tmpStr) { + free(tmpStr); + tmpStr = NULL; + } pButton = elm_button_add(pPopUpHandle); elm_object_domain_translatable_text_set(pButton, VIDEOS_STRING, @@ -763,6 +772,10 @@ bool mp_util_remove_question_popup(int pUserData, tmpTitle = g_strdup_printf(VIDEOS_DELETEPOP_HEADER_DELETE); elm_object_part_text_set(pPopUpHandle, "title,text", tmpTitle); + if (tmpTitle) { + free(tmpTitle); + tmpTitle = NULL; + } if (nSelected < -1) { /* select videos */ if (viewType == MP_LIST_VIEW_AS_FOLDER_LIST) { @@ -795,6 +808,10 @@ bool mp_util_remove_question_popup(int pUserData, } } elm_object_part_text_set(pPopUpHandle, "default", tmpStr); + if (tmpStr) { + free(tmpStr); + tmpStr = NULL; + } pButton = elm_button_add(pPopUpHandle); elm_object_domain_translatable_text_set(pButton, VIDEOS_STRING, @@ -1109,8 +1126,13 @@ void *mp_util_create_style_button(void *pParent, const char *szButtonText, bool mp_util_call_off(void) { - telephony_call_state_e state = TELEPHONY_CALL_STATE_IDLE; telephony_handle_list_s tel_list; + telephony_call_h *call_list_sim; + telephony_call_status_e status = TELEPHONY_CALL_STATE_IDLE; + telephony_call_type_e type; + unsigned int count_sim[2] = {0}; + int ret = TELEPHONY_ERROR_NONE; + int tel_valid = telephony_init(&tel_list); if (tel_valid != TELEPHONY_ERROR_NONE) { VideoLogError("telephony is not initialized. ERROR Code is %d", @@ -1118,19 +1140,32 @@ bool mp_util_call_off(void) return TRUE; } - telephony_h *newhandle = tel_list.handle; - int s = telephony_call_get_voice_call_state(*newhandle, &state); - telephony_deinit(&tel_list); + for (int i=0;i