Fixed TSAM-10974 Unable to play music notification after rejecting call 87/102287/1 submit/tizen_3.0/20161206.143007
authorbhutani.92 <bhutani.92@samsung.com>
Mon, 5 Dec 2016 09:59:31 +0000 (15:29 +0530)
committerbhutani.92 <bhutani.92@samsung.com>
Mon, 5 Dec 2016 09:59:31 +0000 (15:29 +0530)
Change-Id: Ib9ba31764cb9b096ae1186acc45510ca91154d41
Signed-off-by: bhutani.92 <bhutani.92@samsung.com>
src/core/mp-player-mgr.c

index f1a8f1c..b1cd524 100644 (file)
@@ -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);
        }
 }