focus-server: Enhancement for session backward compatibility regarding unregistering... 39/110239/1
authorSangchul Lee <sc11.lee@samsung.com>
Fri, 13 Jan 2017 09:02:48 +0000 (18:02 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Fri, 13 Jan 2017 09:59:00 +0000 (18:59 +0900)
Exclude a node for session backward compatibility from the focus callback in case of unregistering without focus releasing.
Forward is_session value when unregistering focus node.

[Version] 0.10.81
[Profile] Common
[Issue Type] Bug fix

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

index 1d72525..171895d 100644 (file)
@@ -31,7 +31,7 @@ int __mm_sound_mgr_focus_ipc_acquire_focus(int pid, int handle_id, int focus_typ
 int __mm_sound_mgr_focus_ipc_release_focus(int pid, int handle_id, int focus_type, int option, const char *ext_info, bool is_for_session);
 int __mm_sound_mgr_focus_ipc_watch_focus(int pid, int handle_id, int focus_type, bool is_for_session);
 int __mm_sound_mgr_focus_ipc_unwatch_focus(int pid, int handle_id);
-int __mm_sound_mgr_focus_ipc_unregister_focus(int pid, int handle_id);
+int __mm_sound_mgr_focus_ipc_unregister_focus(int pid, int handle_id, bool is_for_session);
 int __mm_sound_mgr_focus_ipc_emergent_exit(int pid);
 
 #endif /* __MM_SOUND_MGR_FOCUS_IPC_H__ */
index 47b634a..51d79d3 100644 (file)
@@ -672,7 +672,7 @@ int mm_sound_mgr_focus_destroy_node(const _mm_sound_mgr_focus_param_t *param)
                }
        }
        if (my_node == NULL) {
-               debug_error("could not find any node of pid[%d]/handle_id[%d]\n", param->pid, param->handle_id);
+               debug_error("could not find any node of pid[%d]/handle_id[%d]/is_for_session[%d]\n", param->pid, param->handle_id, param->is_for_session);
                ret = MM_ERROR_INVALID_ARGUMENT;
                goto FINISH;
        }
@@ -708,6 +708,8 @@ int mm_sound_mgr_focus_destroy_node(const _mm_sound_mgr_focus_param_t *param)
                                                        UPDATE_FOCUS_TAKEN_INFO(by_id, node, my_node->taken_by_id[i].pid, my_node->taken_by_id[i].handle_id, false);
                                                }
                                        } else if (my_node->status & (i+1)) {
+                                               if (node->is_for_session)
+                                                       continue;
                                                _mm_sound_mgr_focus_param_t *new_param = g_malloc0(sizeof(_mm_sound_mgr_focus_param_t));
                                                if (!new_param) {
                                                        debug_warning("Fail to g_malloc0 for new_param, but keep going\n");
index fd05a95..6863782 100644 (file)
@@ -307,7 +307,7 @@ static void handle_method_unregister_focus(GDBusMethodInvocation* invocation)
        }
 
        g_variant_get(params, "(iib)", &pid, &handle_id, &is_for_session);
-       ret = __mm_sound_mgr_focus_ipc_unregister_focus((is_for_session) ? pid : _get_sender_pid(invocation), handle_id);
+       ret = __mm_sound_mgr_focus_ipc_unregister_focus((is_for_session) ? pid : _get_sender_pid(invocation), handle_id, is_for_session);
 
 send_reply:
        if (ret == MM_ERROR_NONE) {
index 90962bf..d9bba46 100644 (file)
@@ -46,7 +46,7 @@ int __mm_sound_mgr_focus_ipc_register_focus(int client_pid, int handle_id, const
 }
 
 // method + remove callback
-int __mm_sound_mgr_focus_ipc_unregister_focus(int pid, int handle_id)
+int __mm_sound_mgr_focus_ipc_unregister_focus(int pid, int handle_id, bool is_for_session)
 {
        _mm_sound_mgr_focus_param_t param;
        int ret = MM_ERROR_NONE;
@@ -54,6 +54,7 @@ int __mm_sound_mgr_focus_ipc_unregister_focus(int pid, int handle_id)
        memset(&param, 0x00, sizeof(_mm_sound_mgr_focus_param_t));
        param.pid = pid;
        param.handle_id = handle_id;
+       param.is_for_session = is_for_session;
 
        ret = mm_sound_mgr_focus_destroy_node(&param);
 
index 81c53cb..58b59f3 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-sound
 Summary:    MMSound Package contains client lib and sound_server binary
-Version:    0.10.80
+Version:    0.10.81
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0