focus_server: copy pid of node that will be used for session backward compatibility 35/158435/2
authorSangchul Lee <sc11.lee@samsung.com>
Wed, 1 Nov 2017 00:31:14 +0000 (09:31 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Wed, 1 Nov 2017 06:44:31 +0000 (15:44 +0900)
This pid information will be used to each multimedia framework to keep session behavior.

[Version] 0.11.31
[Issue Type] backward compatibility

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

index bd1b280..5aaea0c 100644 (file)
@@ -990,8 +990,19 @@ int mm_sound_mgr_focus_get_stream_type_of_acquired_focus(focus_type_e focus_type
 
                        *stream_type = node->stream_type;
                        *option = node->option[index];
-                       if (ext_info)
-                               *ext_info = node->ext_info[index];
+                       if (ext_info) {
+                               if (focus_type != FOCUS_TYPE_BOTH) {
+                                       *ext_info = node->ext_info[index];
+                               } else {
+                                       /* In case of FOCUS_TYPE_BOTH, it should be used only for
+                                        * session backward compatibility. ext_info will contain pid of the node */
+                                       gchar *buf = g_strdup_printf("%d", node->pid);
+                                       if (buf) {
+                                               *ext_info = buf;
+                                               debug_msg("copied node->pid to ext_info [%s]", *ext_info);
+                                       }
+                               }
+                       }
                        ret = MM_ERROR_NONE;
                        break;
                }
index 36c2a5d..24a4989 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <gio/gio.h>
 
+#include "include/mm_sound_mgr_focus.h"
 #include "include/mm_sound_mgr_focus_dbus.h"
 #include "include/mm_sound_mgr_focus_ipc.h"
 #include "../include/mm_sound_dbus.h"
@@ -384,6 +385,12 @@ send_reply:
        else
                _method_call_return_error(invocation, ret);
 
+       /* In case of FOCUS_TYPE_BOTH, it should be used only for
+        * session backward compatibility. ext_info contains pid of the node,
+        * and should be freed here. */
+       if (focus_type == FOCUS_TYPE_BOTH && ext_info)
+               g_free(ext_info);
+
        debug_fleave();
 }
 
index 674d968..700caa8 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-sound
 Summary:    MMSound Package contains client lib and sound_server binary
-Version:    0.11.30
+Version:    0.11.31
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0