Fixed TSAM-9053 Cannot resume music player on incoming calls 98/100198/1
authorbhutani.92 <bhutani.92@samsung.com>
Fri, 25 Nov 2016 09:08:36 +0000 (14:38 +0530)
committerbhutani.92 <bhutani.92@samsung.com>
Fri, 25 Nov 2016 09:08:36 +0000 (14:38 +0530)
Change-Id: I12c87a7ae02bfca17219831791a20aed76c94451
Signed-off-by: bhutani.92 <bhutani.92@samsung.com>
src/common/mp-app.c
src/view/mp-player-view.c
src/widget/mp-album-detail-list.c
src/widget/mp-artist-detail-list.c
src/widget/mp-minicontroller.c
src/widget/mp-now-playing.c
src/widget/mp-track-list.c

index f81faa35b68e9bfe60da4791e33c8c5b0d25de93..3c500f6c2e54bb48a171f086a098d05d69499883 100755 (executable)
@@ -644,6 +644,15 @@ _mp_app_media_key_event_cb(media_key_e key, media_key_event_e event, void *user_
        if (_mp_is_current_focus_available(ad) != 0) {
                if (key == MEDIA_KEY_PLAY) {
                        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;
                } else {
                        ERROR_TRACE("Some other application has the focus currently... Changing state in paused state...");
index 10a8cbfb3b328cb4a6fbf35d3fd12862cea38d6b..b8804931106b007404faca70ddfbd4c78bb9eabf 100755 (executable)
@@ -2212,6 +2212,15 @@ static void _mp_player_view_play_pause_btn_clicked_cb(void *data, Evas_Object *o
 
        if (_mp_is_current_focus_available(ad) != 0) {
                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;
        }
 
index 93ca36a8031dd11369b901c0527d176ce953cad4..66fe98c92de7c49f366a2579101f0603a3ff2321 100755 (executable)
@@ -24,6 +24,7 @@
 #include "mp-common.h"
 #include "mp-widget.h"
 #include "mp-play.h"
+#include "mp-minicontroller.h"
 #include "mp-edit-callback.h"
 #include "mp-album-detail-view.h"
 
@@ -197,6 +198,22 @@ _mp_album_detail_genlist_sel_cb(void *data, Evas_Object * obj, void *event_info)
        MpList_t *list = data;
        MP_CHECK(list);
 
+       struct appdata *ad = mp_util_get_appdata();
+       MP_CHECK(ad);
+       if (_mp_is_current_focus_available(ad) != 0) {
+               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_list_item_data_t *item = (mp_list_item_data_t *) elm_object_item_data_get(gli);
        MP_CHECK(item);
 
index f6124ea4b4582c0c31ca1b087448ddc93194b43f..725a2615c7f10abda492799da2d9853e3fa50608 100755 (executable)
@@ -24,6 +24,7 @@
 #include "mp-common.h"
 #include "mp-widget.h"
 #include "mp-play.h"
+#include "mp-minicontroller.h"
 #include "mp-common.h"
 
 static char *
@@ -329,6 +330,22 @@ _mp_artist_detail_list_select_cb(void *data, Evas_Object * obj, void *event_info
        MpArtistDetailList_t *list = (MpArtistDetailList_t *)data;
        MP_CHECK(list);
 
+       struct appdata *ad = mp_util_get_appdata();
+       MP_CHECK(ad);
+       if (_mp_is_current_focus_available(ad) != 0) {
+               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_list_item_data_t *item = (mp_list_item_data_t *) elm_object_item_data_get(gli);
        MP_CHECK(item);
 
index a10e8f736815b22d210cff2eaea9ceacaef0fcae..9edcc221a67830abd1532a90b07c643feab4383e 100755 (executable)
@@ -683,15 +683,6 @@ int _mp_is_current_focus_available(struct appdata *ad)
        DEBUG_TRACE("Playback state changed by : %d", changed_by);
        if (changed_by == SOUND_STREAM_FOCUS_CHANGED_BY_CALL || changed_by == SOUND_STREAM_FOCUS_CHANGED_BY_VOIP || changed_by == SOUND_STREAM_FOCUS_CHANGED_BY_RINGTONE) {
                DEBUG_TRACE("Cannot resume Music Player due to call");
-               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 -1;
        }
 
@@ -712,6 +703,15 @@ static void _mp_minicontroller_play_pause_btn_clicked_cb(void *data, Evas_Object
 
        if (_mp_is_current_focus_available(ad) != 0) {
                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;
        }
 
index 701a9a7bd7a0678b508a88947657c2de99bf407e..90864ffea8e798fc9df283c9af404ef3ef27831d 100755 (executable)
@@ -564,6 +564,15 @@ static void _mp_now_playing_btn_clicked_cb(void *data, Evas_Object *obj, void *e
 
        if (_mp_is_current_focus_available(ad) != 0) {
                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;
        }
 
index b5454075eba8a4de86064ad6b84c43a43c66bbac..03eb7203772f41be667e9be263dca14b732553e7 100644 (file)
@@ -26,6 +26,7 @@
 #include "mp-play.h"
 #include "mp-edit-callback.h"
 #include "mp-player-mgr.h"
+#include "mp-minicontroller.h"
 #include <media_content.h>
 #include <player.h>
 
@@ -258,6 +259,22 @@ _mp_track_genlist_sel_cb(void *data, Evas_Object * obj, void *event_info)
        MpList_t *list = data;
        MP_CHECK(list);
 
+       struct appdata *ad = mp_util_get_appdata();
+       MP_CHECK(ad);
+       if (_mp_is_current_focus_available(ad) != 0) {
+               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_list_item_data_t *item = (mp_list_item_data_t *) elm_object_item_data_get(gli);
        MP_CHECK(item);