From: bhutani.92 Date: Mon, 5 Dec 2016 09:59:31 +0000 (+0530) Subject: Fixed TSAM-10974 Unable to play music notification after rejecting call X-Git-Tag: submit/tizen_3.0/20161206.143007^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bb38333e2b2177f3292805e102f2b812659f0c0f;p=profile%2Fmobile%2Fapps%2Fnative%2Fmusic-player.git Fixed TSAM-10974 Unable to play music notification after rejecting call Change-Id: Ib9ba31764cb9b096ae1186acc45510ca91154d41 Signed-off-by: bhutani.92 --- diff --git a/src/core/mp-player-mgr.c b/src/core/mp-player-mgr.c index f1a8f1c..b1cd524 100644 --- a/src/core/mp-player-mgr.c +++ b/src/core/mp-player-mgr.c @@ -1138,16 +1138,7 @@ void mp_player_focus_callback(sound_stream_info_h stream_info, sound_stream_focu startfunc; struct appdata *ad = user_data; - sound_stream_focus_state_e state_for_playback; - sound_stream_focus_state_e state_for_recording; - int ret = SOUND_MANAGER_ERROR_INVALID_PARAMETER; - ret = sound_manager_get_focus_state(ad->stream_info, &state_for_playback, - &state_for_recording); - if(ret != SOUND_MANAGER_ERROR_NONE) { - ERROR_TRACE("failed in sound_manager_get_focus_state"); - } - - if (state_for_playback == SOUND_STREAM_FOCUS_STATE_RELEASED) { + if (focus_mask == SOUND_STREAM_FOCUS_FOR_PLAYBACK && focus_state == SOUND_STREAM_FOCUS_STATE_RELEASED) { mp_player_mgr_pause(ad); sound_manager_get_focus_reacquisition(ad->stream_info, &reacquire_state); @@ -1166,21 +1157,6 @@ void mp_player_focus_callback(sound_stream_info_h stream_info, sound_stream_focu sound_manager_set_focus_reacquisition(ad->stream_info, EINA_FALSE); } } else { - if (reason_for_change == SOUND_STREAM_FOCUS_CHANGED_BY_VOIP || - reason_for_change == SOUND_STREAM_FOCUS_CHANGED_BY_CALL || - reason_for_change == SOUND_STREAM_FOCUS_CHANGED_BY_RINGTONE) { - ERROR_TRACE("Some other application has the focus currently... Returning..."); - char *message = STR_MP_UNABLE_TO_PLAY_DURING_CALL; - if (message) { - int ret = notification_status_message_post(dgettext("music-player", message)); - if (ret != 0) { - ERROR_TRACE("notification_status_message_post()... [0x%x]", ret); - } else { - DEBUG_TRACE("message: [%s]", message); - } - } - return; - } mp_play_control_play_pause(ad, true); } }