Resolved sound_manager_focus issue during call and message notification [TSAM-6316] 66/79366/2
authorbhutani.92 <bhutani.92@samsung.com>
Mon, 11 Jul 2016 05:56:30 +0000 (11:26 +0530)
committerAkhil Bhutani <bhutani.92@samsung.com>
Mon, 11 Jul 2016 05:46:56 +0000 (22:46 -0700)
Change-Id: If0088cb7bd850fbd4c266ed5cb20441357e4ab28
Signed-off-by: bhutani.92 <bhutani.92@samsung.com>
src/core/mp-player-mgr.c

index 2fe48b734bf1abdaea6c439751688c7cc00953dc..d47e7f76fbfbf61f4f6fb9a8d91d9a34b4303f94 100755 (executable)
@@ -1159,18 +1159,17 @@ void mp_player_focus_callback(sound_stream_info_h stream_info, sound_stream_focu
        }
        if (state_for_playback == SOUND_STREAM_FOCUS_STATE_RELEASED) {
                mp_player_mgr_pause(ad);
+
+               DEBUG_TRACE("reason for change is %d", reason_for_change);
                if (reason_for_change != SOUND_STREAM_FOCUS_CHANGED_BY_ALARM &&
                                reason_for_change != SOUND_STREAM_FOCUS_CHANGED_BY_NOTIFICATION) {
-                       DEBUG_TRACE("reason for change is %d", reason_for_change);
                        sound_manager_get_focus_reacquisition(ad->stream_info, &reacquire_state);
-                       if (reason_for_change == SOUND_STREAM_FOCUS_CHANGED_BY_RINGTONE) {
+                       if (!strcmp(additional_info, "cam_capture")) {
                                sound_manager_set_focus_reacquisition(ad->stream_info, EINA_TRUE);
-                       } else if (!strcmp(additional_info, "cam_capture")) {
+                       } else if (reason_for_change == SOUND_STREAM_FOCUS_CHANGED_BY_RINGTONE || SOUND_STREAM_FOCUS_CHANGED_BY_VOIP || SOUND_STREAM_FOCUS_CHANGED_BY_CALL) {
                                sound_manager_set_focus_reacquisition(ad->stream_info, EINA_TRUE);
                        } else if (reacquire_state == EINA_TRUE) {
                                sound_manager_set_focus_reacquisition(ad->stream_info, EINA_FALSE);
-                       } else {
-                               sound_manager_set_focus_reacquisition(ad->stream_info, EINA_TRUE);
                        }
                }
        } else {