focus-server: fix bug of invoking monitor callback of other nodes 01/144601/1
authorSangchul Lee <sc11.lee@samsung.com>
Thu, 17 Aug 2017 08:05:29 +0000 (17:05 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Thu, 17 Aug 2017 08:09:09 +0000 (17:09 +0900)
[Version] 0.11.17
[Issue Type] Bug

Change-Id: I630cb5420f2addb4666e398f3fcd38af3143ae51
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
focus_server/mm_sound_mgr_focus.c
packaging/libmm-sound.spec

index d614b78..982144a 100644 (file)
@@ -191,7 +191,7 @@ static bool _check_session_node_exist(int pid)
        return false;
 }
 
-static bool _check_session_watch_node_exist(int pid)
+static bool _check_session_monitor_node_exist(int pid)
 {
        GList *list = NULL;
        focus_node_t *node = NULL;
@@ -200,15 +200,11 @@ static bool _check_session_watch_node_exist(int pid)
                node = (focus_node_t *)list->data;
                if (node->pid != pid)
                        continue;
-               if (!node->is_for_watch)
-                       continue;
-               if (node->is_for_monitor)
-                       continue;
-               if (node->is_for_session)
+               if (node->is_for_watch && node->is_for_session && node->is_for_monitor)
                        return true;
        }
 
-       debug_msg("session watch node for pid[%d] does not exist", pid);
+       debug_msg("session monitor node for pid[%d] does not exist", pid);
 
        return false;
 }
@@ -342,7 +338,7 @@ RELEASE:
        }
 }
 
-/* session backward compatibility for monitor handle */
+/* session backward compatibility for monitor handle, it is for monitor callback of other nodes */
 static int _mm_sound_mgr_focus_do_monitor_callback_outer(focus_type_e focus_type, focus_command_e command, focus_node_t *my_node, const _mm_sound_mgr_focus_param_t *param)
 {
        GList *list = NULL;
@@ -359,12 +355,15 @@ static int _mm_sound_mgr_focus_do_monitor_callback_outer(focus_type_e focus_type
                CONTINUE_IF_LIST_DATA_IS_NULL(node, list);
                if (node == my_node)
                        continue;
+               /* do not invoke monitor callback of mine */
+               if (node->pid == my_node->pid)
+                       continue;
                if (!node->is_for_watch || !node->is_for_monitor || !node->is_for_session)
                        continue;
                if (!(node->status & focus_type))
                        continue;
                /* check if it meets the condition to trigger monitor callback */
-               if (!_check_session_watch_node_exist(node->pid))
+               if (!_check_session_monitor_node_exist(node->pid))
                        continue;
 
                _invoke_watch_callback(node, my_node->stream_type, focus_type, command, param);
index fd0facc..58810c2 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-sound
 Summary:    MMSound Package contains client lib and sound_server binary
-Version:    0.11.16
+Version:    0.11.17
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0