Fixed TSAM-10437 Incoming call issue 18/100318/1
authorbhutani.92 <bhutani.92@samsung.com>
Sat, 26 Nov 2016 13:22:44 +0000 (18:52 +0530)
committerbhutani.92 <bhutani.92@samsung.com>
Sat, 26 Nov 2016 13:22:44 +0000 (18:52 +0530)
Change-Id: I787eadca6c3f8ebcd0c2550e35e618d4e32c6f47
Signed-off-by: bhutani.92 <bhutani.92@samsung.com>
src/core/mp-player-mgr.c

index ee58c00..4c4fac4 100755 (executable)
@@ -1175,6 +1175,21 @@ 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);
        }
 }