Add focus API for getting a stream type of the current acquired focus(playback/recording) 69/54169/2 accepted/tizen/mobile/20151215.230355 accepted/tizen/tv/20151215.230412 accepted/tizen/wearable/20151215.230436 submit/tizen/20151215.054820
authorSangchul Lee <sc11.lee@samsung.com>
Mon, 14 Dec 2015 02:09:16 +0000 (11:09 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Tue, 15 Dec 2015 05:24:49 +0000 (14:24 +0900)
Add DBUS interface for this API.
Modify codes to keep and update the additional info. for each focus node when acquiring/releasing/trigerring callback.

[Version] Release 0.9.276
[Profile] Common
[Issue Type] Add feature

Change-Id: I3cba21eab259d284d81fc7532eb8bd5ced31a9df
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
13 files changed:
focus_server/include/mm_sound_mgr_focus.h
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
include/mm_sound_client.h
include/mm_sound_client_dbus.h
include/mm_sound_focus.h
include/mm_sound_msg.h
mm_sound_client.c
mm_sound_client_dbus.c
mm_sound_focus.c
packaging/libmm-sound.spec

index a30cfdb..6a8410a 100644 (file)
@@ -75,6 +75,7 @@ typedef struct {
        int priority;
        bool is_for_watch;
        char stream_type[MAX_STREAM_TYPE_LEN];
+       char option[NUM_OF_STREAM_IO_TYPE][MM_SOUND_NAME_NUM];
        focus_status_e status;
        _focus_taken_by_id_t taken_by_id[NUM_OF_STREAM_IO_TYPE];
        void *callback;
@@ -93,6 +94,7 @@ int MMSoundMgrFocusFini(void);
 int mm_sound_mgr_focus_create_node (const _mm_sound_mgr_focus_param_t *param);
 int mm_sound_mgr_focus_destroy_node (const _mm_sound_mgr_focus_param_t *param);
 int mm_sound_mgr_focus_set_reacquisition (const _mm_sound_mgr_focus_param_t *param);
+int mm_sound_mgr_focus_get_stream_type_of_acquired_focus(focus_type_e focus_type, char **stream_type, char **additional_info);
 int mm_sound_mgr_focus_request_acquire (const _mm_sound_mgr_focus_param_t *param);
 int mm_sound_mgr_focus_request_release (const _mm_sound_mgr_focus_param_t *param);
 int mm_sound_mgr_focus_set_watch_cb (const _mm_sound_mgr_focus_param_t *param);
index cba6ee0..c2d365b 100644 (file)
@@ -43,6 +43,8 @@ int __mm_sound_mgr_focus_ipc_unregister_focus(int pid, int handle_id);
 
 int __mm_sound_mgr_focus_ipc_set_focus_reacquisition(int pid, int handle_id, bool reacquisition);
 
+int __mm_sound_mgr_focus_ipc_get_acquired_focus_stream_type(int focus_type, char **stream_type, char **additional_info);
+
 int __mm_sound_mgr_focus_ipc_acquire_focus(int pid, int handle_id, int focus_type, const char* name );
 
 int __mm_sound_mgr_focus_ipc_release_focus(int pid, int handle_id, int focus_type, const char* name);
index 3efb9de..b4f5f3c 100644 (file)
@@ -408,6 +408,11 @@ int _mm_sound_mgr_focus_do_callback(focus_command_e command, focus_node_t *victi
                /* client will lost the acquired focus */
                cb_data.type= assaulter_param->request_type & victim_node->status;
                cb_data.state= FOCUS_STATUS_DEACTIVATED;
+               /* remove additional info. */
+               for (i = 0; i < NUM_OF_STREAM_IO_TYPE; i++) {
+                       if (cb_data.type & (i+1))
+                               memset(victim_node->option[i], 0x0, MM_SOUND_NAME_NUM);
+               }
        } else {
                /* client will gain the lost focus */
                for (i = 0; i < NUM_OF_STREAM_IO_TYPE; i++) {
@@ -417,6 +422,11 @@ int _mm_sound_mgr_focus_do_callback(focus_command_e command, focus_node_t *victi
                }
                cb_data.type = flag_for_focus_type & assaulter_param->request_type;
                cb_data.state = !FOCUS_STATUS_DEACTIVATED;
+               /* copy additional info. */
+               for (i = 0; i < NUM_OF_STREAM_IO_TYPE; i++) {
+                       if (cb_data.type & (i+1))
+                               MMSOUND_STRNCPY(victim_node->option[i], assaulter_param->option, MM_SOUND_NAME_NUM);
+               }
        }
        MMSOUND_STRNCPY(cb_data.stream_type, assaulter_stream_type, MAX_STREAM_TYPE_LEN);
        MMSOUND_STRNCPY(cb_data.name, assaulter_param->option, MM_SOUND_NAME_NUM);
@@ -593,10 +603,10 @@ static int _mm_sound_mgr_focus_list_dump ()
        for (list = g_focus_node_list; list != NULL; list = list->next) {
                node = (focus_node_t *)list->data;
                if (node && !node->is_for_watch) {
-                       debug_log("*** pid[%5d]/handle_id[%d]/[%15s]: priority[%2d], status[%s], taken_by[P(%5d/%2d/%2d)C(%5d/%2d/%2d)], for_session[%d]\n",
+                       debug_log("*** pid[%5d]/handle_id[%d]/[%15s]:priority[%2d],status[%s],taken_by[P(%5d/%2d/%2d)C(%5d/%2d/%2d)],for_session[%d],add.info[%s/%s]\n",
                                        node->pid, node->handle_id, node->stream_type, node->priority, focus_status_str[node->status],
                                        node->taken_by_id[0].pid, node->taken_by_id[0].handle_id, node->taken_by_id[0].by_session, node->taken_by_id[1].pid,
-                                       node->taken_by_id[1].handle_id, node->taken_by_id[1].by_session, node->is_for_session);
+                                       node->taken_by_id[1].handle_id, node->taken_by_id[1].by_session, node->is_for_session, node->option[0], node->option[1]);
                }
        }
        debug_log("================================================ focus node list : end =====================================================\n");
@@ -836,7 +846,45 @@ int mm_sound_mgr_focus_set_reacquisition (const _mm_sound_mgr_focus_param_t *par
        return ret;
 }
 
-int mm_sound_mgr_focus_request_acquire (const _mm_sound_mgr_focus_param_t *param)
+int mm_sound_mgr_focus_get_stream_type_of_acquired_focus(focus_type_e focus_type, char **stream_type, char **additional_info)
+{
+       int ret = MM_ERROR_SOUND_NO_DATA;
+       GList *list = NULL;
+       focus_node_t *node = NULL;
+
+       debug_fenter();
+
+       if (focus_type == FOCUS_TYPE_BOTH) /* focus_type should be "playback" or "capture" */
+               return MM_ERROR_INVALID_ARGUMENT;
+       if (!stream_type)
+               return MM_ERROR_INVALID_ARGUMENT;
+
+       MMSOUND_ENTER_CRITICAL_SECTION_WITH_RETURN(&g_focus_node_list_mutex, MM_ERROR_SOUND_INTERNAL);
+
+       /* Update list for dead process */
+       g_list_foreach (g_focus_node_list, (GFunc)_clear_focus_node_list_func, NULL);
+
+       /* Find node to set reacquisition */
+       for (list = g_focus_node_list; list != NULL; list = list->next) {
+               node = (focus_node_t *)list->data;
+               if (node && !node->is_for_watch && (node->status & focus_type)) {
+                       debug_msg("found a node : request_focus_type(%d), stream_type(%s)/additional info(%s) of acquired focus\n", focus_type, node->stream_type, node->option);
+                       *stream_type = node->stream_type;
+                       if (additional_info)
+                               *additional_info = node->option;
+                       ret = MM_ERROR_NONE;
+                       break;
+               }
+       }
+
+       MMSOUND_LEAVE_CRITICAL_SECTION(&g_focus_node_list_mutex);
+
+       debug_fleave();
+
+       return ret;
+}
+
+int mm_sound_mgr_focus_request_acquire(const _mm_sound_mgr_focus_param_t *param)
 {
        int ret = MM_ERROR_NONE;
        GList *list = NULL;
@@ -918,6 +966,11 @@ int mm_sound_mgr_focus_request_acquire (const _mm_sound_mgr_focus_param_t *param
        }
 
        if (ret != MM_ERROR_POLICY_BLOCKED) {
+               /* copy additional info. */
+               for (i = 0; i < NUM_OF_STREAM_IO_TYPE; i++) {
+                       if (param->request_type & (i+1))
+                               MMSOUND_STRNCPY(my_node->option[i], param->option, MM_SOUND_NAME_NUM);
+               }
                /* update status */
                my_node->status |= param->request_type;
                /* do watch callback due to the status of mine */
@@ -949,6 +1002,7 @@ int mm_sound_mgr_focus_request_release (const _mm_sound_mgr_focus_param_t *param
        focus_node_t *my_node = NULL;
        bool need_to_trigger_watch_cb = true;
        bool need_to_trigger_cb = true;
+       int i = 0;
 
        debug_fenter();
 
@@ -1002,7 +1056,6 @@ int mm_sound_mgr_focus_request_release (const _mm_sound_mgr_focus_param_t *param
                        if (node == my_node || node->is_for_watch) {
                                /* skip */
                        } else {
-                               int i = 0;
                                for (i = 0; i < NUM_OF_STREAM_IO_TYPE; i++) {
                                        if (param_s->request_type & (i+1)) {
                                                if (node && (node->taken_by_id[i].pid == param_s->pid && (node->taken_by_id[i].handle_id == param_s->handle_id || node->taken_by_id[i].by_session))) {
@@ -1022,6 +1075,11 @@ int mm_sound_mgr_focus_request_release (const _mm_sound_mgr_focus_param_t *param
        }
        /* update status */
        my_node->status &= ~(param->request_type);
+       /* remove additional info. */
+       for (i = 0; i < NUM_OF_STREAM_IO_TYPE; i++) {
+               if (!(my_node->status & (i+1)))
+                       memset(my_node->option[i], 0x0, MM_SOUND_NAME_NUM);
+       }
        /* do watch callback due to the status of mine */
        if (need_to_trigger_watch_cb)
                _mm_sound_mgr_focus_do_watch_callback((focus_type_e)param->request_type, FOCUS_COMMAND_RELEASE, my_node, param);
index f3c9aa5..0464709 100644 (file)
   "      <arg name='handle_id' type='i' direction='in'/>"
   "      <arg name='reacquisition' type='b' direction='in'/>"
   "    </method>"
+  "    <method name='GetAcquiredFocusStreamType'>"
+  "      <arg name='focus_type' type='i' direction='in'/>"
+  "      <arg name='stream_type' type='s' direction='out'/>"
+  "      <arg name='additional_info' type='s' direction='out'/>"
+  "    </method>"
   "    <method name='AcquireFocus'>"
   "      <arg name='pid' type='i' direction='in'/>"
   "      <arg name='handle_id' type='i' direction='in'/>"
@@ -111,6 +116,7 @@ static void handle_method_get_unique_id(GDBusMethodInvocation* invocation);
 static void handle_method_register_focus(GDBusMethodInvocation* invocation);
 static void handle_method_unregister_focus(GDBusMethodInvocation* invocation);
 static void handle_method_set_focus_reacquisition(GDBusMethodInvocation* invocation);
+static void handle_method_get_acquired_focus_stream_type(GDBusMethodInvocation* invocation);
 static void handle_method_acquire_focus(GDBusMethodInvocation* invocation);
 static void handle_method_release_focus(GDBusMethodInvocation* invocation);
 static void handle_method_watch_focus(GDBusMethodInvocation* invocation);
@@ -146,6 +152,12 @@ struct mm_sound_mgr_focus_dbus_method methods[METHOD_CALL_MAX] = {
                },
                .handler = handle_method_set_focus_reacquisition
        },
+       [METHOD_CALL_GET_ACQUIRED_FOCUS_STREAM_TYPE] = {
+               .info = {
+                       .name = "GetAcquiredFocusStreamType",
+               },
+               .handler = handle_method_get_acquired_focus_stream_type
+       },
        [METHOD_CALL_ACQUIRE_FOCUS] = {
                .info = {
                        .name = "AcquireFocus",
@@ -405,6 +417,35 @@ send_reply:
        debug_fleave();
 }
 
+static void handle_method_get_acquired_focus_stream_type(GDBusMethodInvocation* invocation)
+{
+       int ret = MM_ERROR_NONE;
+       int focus_type = 0;
+       char *stream_type = NULL;
+       char *additional_info = NULL;
+       GVariant *params = NULL;
+
+       debug_fenter();
+
+       if (!(params = g_dbus_method_invocation_get_parameters(invocation))) {
+               debug_error("Parameter for Method is NULL");
+               ret = MM_ERROR_SOUND_INTERNAL;
+               goto send_reply;
+       }
+
+       g_variant_get(params, "(i)", &focus_type);
+       ret = __mm_sound_mgr_focus_ipc_get_acquired_focus_stream_type(focus_type, &stream_type, &additional_info);
+
+send_reply:
+       if (ret == MM_ERROR_NONE) {
+               _method_call_return_value(invocation, g_variant_new("(ss)", stream_type, additional_info));
+       } else {
+               _method_call_return_error(invocation, ret);
+       }
+
+       debug_fleave();
+}
+
 static void handle_method_acquire_focus(GDBusMethodInvocation* invocation)
 {
        int ret = MM_ERROR_NONE;
index 5e1f133..b4c3bd3 100644 (file)
@@ -114,8 +114,28 @@ int __mm_sound_mgr_focus_ipc_set_focus_reacquisition(int pid, int handle_id, boo
        return ret;
 }
 
+// method
+int __mm_sound_mgr_focus_ipc_get_acquired_focus_stream_type(int focus_type, char **stream_type, char **additional_info)
+{
+       int ret = MM_ERROR_NONE;
+       char *stream_type_str = NULL;
+       char *additional_info_str = NULL;
+
+       if (!stream_type)
+               return MM_ERROR_INVALID_ARGUMENT;
+
+       ret = mm_sound_mgr_focus_get_stream_type_of_acquired_focus(focus_type, &stream_type_str, &additional_info_str);
+       if (ret == MM_ERROR_NONE) {
+               *stream_type = stream_type_str;
+               if (additional_info)
+                       *additional_info = additional_info_str;
+       }
+
+       return ret;
+}
+
 // method -> callback
-int __mm_sound_mgr_focus_ipc_acquire_focus(int pid, int handle_id, int focus_type, const char* name )
+int __mm_sound_mgr_focus_ipc_acquire_focus(int pid, int handle_id, int focus_type, const char* name)
 {
        _mm_sound_mgr_focus_param_t param;
        int ret = MM_ERROR_NONE;
index d4da31b..f4636f4 100644 (file)
@@ -57,12 +57,13 @@ int mm_sound_client_remove_device_info_changed_callback(unsigned int subs_id);
 #ifdef USE_FOCUS
 int mm_sound_client_set_session_interrupt_callback(mm_sound_focus_session_interrupt_cb callback, void* user_data);
 int mm_sound_client_unset_session_interrupt_callback(void);
-int mm_sound_client_get_uniq_id(int *id);
+int mm_sound_client_get_unique_id(int *id);
 int mm_sound_client_is_focus_cb_thread(GThread *mine, bool *result);
 int mm_sound_client_register_focus(int id, int pid, const char *stream_type, mm_sound_focus_changed_cb callback, bool is_for_session, void* user_data);
 int mm_sound_client_unregister_focus(int id);
 int mm_sound_client_set_focus_reacquisition(int id, bool reacquisition);
 int mm_sound_client_get_focus_reacquisition(int id, bool *reacquisition);
+int mm_sound_client_get_acquired_focus_stream_type(int focus_type, char **stream_type, char **additional_info);
 int mm_sound_client_acquire_focus(int id, mm_sound_focus_type_e type, const char *option);
 int mm_sound_client_release_focus(int id, mm_sound_focus_type_e type, const char *option);
 int mm_sound_client_set_focus_watch_callback(int pid, mm_sound_focus_type_e type, mm_sound_focus_changed_watch_cb callback, bool is_for_session, void* user_data, int *id);
index 2087734..00c0885 100644 (file)
@@ -48,6 +48,7 @@ int mm_sound_client_dbus_get_audio_path(mm_sound_device_in *device_in, mm_sound_
 int mm_sound_client_dbus_register_focus(int id, int instance, const char *stream_type, mm_sound_focus_changed_cb callback, bool is_for_session, void* user_data);
 int mm_sound_client_dbus_unregister_focus(int instance, int id, bool is_for_session);
 int mm_sound_client_dbus_set_foucs_reacquisition(int instance, int id, bool reacquisition);
+int mm_sound_client_dbus_get_acquired_focus_stream_type(int focus_type, char **stream_type, char **additional_info);
 int mm_sound_client_dbus_acquire_focus(int instance, int id, mm_sound_focus_type_e type, const char *option, bool is_for_session);
 int mm_sound_client_dbus_release_focus(int instance, int id, mm_sound_focus_type_e type, const char *option, bool is_for_session);
 int mm_sound_client_dbus_set_focus_watch_callback(int instance, int handle, mm_sound_focus_type_e type, mm_sound_focus_changed_watch_cb callback, bool is_for_session, void *user_data);
index 8fe26b8..a361409 100644 (file)
@@ -55,6 +55,7 @@ int mm_sound_register_focus_for_session(int id, int pid, const char *stream_type
 int mm_sound_unregister_focus(int id);
 int mm_sound_set_focus_reacquisition(int id, bool reacquisition);
 int mm_sound_get_focus_reacquisition(int id, bool *reacquisition);
+int mm_sound_get_stream_type_of_acquired_focus(int focus_type, char **stream_type, char **additional_info);
 int mm_sound_acquire_focus(int id, mm_sound_focus_type_e focus_type, const char *additional_info);
 int mm_sound_release_focus(int id, mm_sound_focus_type_e focus_type, const char *additional_info);
 
index add0e78..97d2407 100644 (file)
@@ -135,6 +135,7 @@ enum {
         METHOD_CALL_REGISTER_FOCUS,
         METHOD_CALL_UNREGISTER_FOCUS,
         METHOD_CALL_SET_FOCUS_REACQUISITION,
+        METHOD_CALL_GET_ACQUIRED_FOCUS_STREAM_TYPE,
         METHOD_CALL_ACQUIRE_FOCUS,
         METHOD_CALL_RELEASE_FOCUS,
         METHOD_CALL_WATCH_FOCUS,
index b36b76b..9da07c5 100644 (file)
@@ -105,8 +105,8 @@ typedef struct {
        int handle;
        int type;
        int state;
-       char stream_type [MAX_STREAM_TYPE_LEN];
-       char name [MM_SOUND_NAME_NUM];
+       char stream_type[MAX_STREAM_TYPE_LEN];
+       char name[MM_SOUND_NAME_NUM];
 } focus_cb_data_lib;
 
 typedef struct {
@@ -155,7 +155,7 @@ void _focus_signal_handler(int signo)
        if (ret == MM_ERROR_NONE)
                debug_msg("[Client] Success to emergnet_exit_focus\n");
        else
-               debug_error("[Client] Error occurred : %d \n",ret);
+               debug_error("[Client] Error occurred : 0x%x \n",ret);
 
        sigprocmask(SIG_SETMASK, &old_mask, NULL);
        /* signal unblock */
@@ -1563,7 +1563,7 @@ int mm_sound_client_register_focus(int id, int pid, const char *stream_type, mm_
                        }
                }
        } else {
-               debug_error("[Client] Error occurred : %d \n",ret);
+               debug_error("[Client] Error occurred : 0x%x \n",ret);
                g_focus_sound_handle[index].is_used = false;
                goto cleanup;
        }
@@ -1603,7 +1603,7 @@ int mm_sound_client_unregister_focus(int id)
        if (ret == MM_ERROR_NONE)
                debug_msg("[Client] Success to unregister focus\n");
        else
-               debug_error("[Client] Error occurred : %d \n",ret);
+               debug_error("[Client] Error occurred : 0x%x \n",ret);
 
        g_mutex_unlock(&g_focus_sound_handle[index].focus_lock);
 
@@ -1642,7 +1642,7 @@ int mm_sound_client_set_focus_reacquisition(int id, bool reacquisition)
                if (ret == MM_ERROR_NONE) {
                        debug_msg("[Client] Success to set focus reacquisition\n");
                } else {
-                       debug_error("[Client] Error occurred : %d \n",ret);
+                       debug_error("[Client] Error occurred : 0x%x \n",ret);
                        goto cleanup;
                }
        } else {
@@ -1681,6 +1681,22 @@ int mm_sound_client_get_focus_reacquisition(int id, bool *reacquisition)
        return ret;
 }
 
+int mm_sound_client_get_acquired_focus_stream_type(int focus_type, char **stream_type, char **additional_info)
+{
+       int ret = MM_ERROR_NONE;
+
+       debug_fenter();
+
+       ret = mm_sound_client_dbus_get_acquired_focus_stream_type(focus_type, stream_type, additional_info);
+       if (ret == MM_ERROR_NONE)
+               debug_msg("[Client] Success to get stream type of acquired focus, stream_type(%s), additional_info(%s)\n", *stream_type, *additional_info);
+       else
+               debug_error("[Client] Error occurred : 0x%x \n",ret);
+
+       debug_fleave();
+       return ret;
+}
+
 int mm_sound_client_acquire_focus(int id, mm_sound_focus_type_e type, const char *option)
 {
        int ret = MM_ERROR_NONE;
@@ -1701,7 +1717,7 @@ int mm_sound_client_acquire_focus(int id, mm_sound_focus_type_e type, const char
        if (ret == MM_ERROR_NONE)
                debug_msg("[Client] Success to acquire focus\n");
        else
-               debug_error("[Client] Error occurred : %d \n",ret);
+               debug_error("[Client] Error occurred : 0x%x \n",ret);
 
        debug_fleave();
        return ret;
@@ -1726,7 +1742,7 @@ int mm_sound_client_release_focus(int id, mm_sound_focus_type_e type, const char
        if (ret == MM_ERROR_NONE)
                debug_msg("[Client] Success to release focus\n");
        else
-               debug_error("[Client] Error occurred : %d \n",ret);
+               debug_error("[Client] Error occurred : 0x%x \n",ret);
 
 
        debug_fleave();
@@ -1781,7 +1797,7 @@ int mm_sound_client_set_focus_watch_callback(int pid, mm_sound_focus_type_e focu
                        }
                }
        } else {
-               debug_error("[Client] Error occurred : %d",ret);
+               debug_error("[Client] Error occurred : 0x%x",ret);
                goto cleanup;
        }
 
@@ -1816,7 +1832,7 @@ int mm_sound_client_unset_focus_watch_callback(int id)
        if (ret == MM_ERROR_NONE)
                debug_msg("[Client] Success to unwatch focus\n");
        else
-               debug_error("[Client] Error occurred : %d \n",ret);
+               debug_error("[Client] Error occurred : 0x%x \n",ret);
 
 
        g_mutex_unlock(&g_focus_sound_handle[index].focus_lock);
index 06799ac..085e446 100644 (file)
@@ -112,6 +112,9 @@ const struct mm_sound_dbus_method_info g_methods[METHOD_CALL_MAX] = {
        [METHOD_CALL_SET_FOCUS_REACQUISITION] = {
                .name = "SetFocusReacquisition",
        },
+       [METHOD_CALL_GET_ACQUIRED_FOCUS_STREAM_TYPE] = {
+               .name = "GetAcquiredFocusStreamType",
+       },
        [METHOD_CALL_ACQUIRE_FOCUS] = {
                .name = "AcquireFocus",
        },
@@ -1382,6 +1385,31 @@ int mm_sound_client_dbus_set_foucs_reacquisition(int instance, int id, bool reac
        return ret;
 }
 
+int mm_sound_client_dbus_get_acquired_focus_stream_type(int focus_type, char **stream_type, char **additional_info)
+{
+       int ret = MM_ERROR_NONE;
+       GVariant* params = NULL, *result = NULL;
+
+       debug_fenter();
+
+       params = g_variant_new("(i)", focus_type);
+       if (params) {
+               if ((ret = _dbus_method_call_to(DBUS_TO_FOCUS_SERVER, METHOD_CALL_GET_ACQUIRED_FOCUS_STREAM_TYPE, params, &result)) != MM_ERROR_NONE) {
+                       debug_error("dbus get stream type of acquired focus failed");
+               }
+       } else {
+               debug_error("Construct Param for method call failed");
+       }
+
+       if (ret == MM_ERROR_NONE && result)
+               g_variant_get(result, "(ss)", stream_type, additional_info);
+       else
+               g_variant_unref(result);
+
+       debug_fleave();
+       return ret;
+}
+
 int mm_sound_client_dbus_acquire_focus(int instance, int id, mm_sound_focus_type_e type, const char *option, bool is_for_session)
 {
        int ret = MM_ERROR_NONE;
index f990a8c..39a3c23 100644 (file)
@@ -236,6 +236,29 @@ int mm_sound_get_focus_reacquisition(int id, bool *reacquisition)
 }
 
 EXPORT_API
+int mm_sound_get_stream_type_of_acquired_focus(int focus_type, char **stream_type, char **additional_info)
+{
+       int ret = MM_ERROR_NONE;
+
+       debug_fenter();
+
+       if (stream_type == NULL) {
+               debug_error("argument is not valid\n");
+               return MM_ERROR_INVALID_ARGUMENT;
+       }
+
+       ret = mm_sound_client_get_acquired_focus_stream_type(focus_type, stream_type, additional_info);
+
+       if (ret) {
+               debug_error("Could not get acquired focus stream type, ret[0x%x]\n", ret);
+       }
+
+       debug_fleave();
+
+       return ret;
+}
+
+EXPORT_API
 int mm_sound_acquire_focus(int id, mm_sound_focus_type_e focus_type, const char *additional_info)
 {
        int ret = MM_ERROR_NONE;
index ff96de5..40a561b 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-sound
 Summary:    MMSound Package contains client lib and sound_server binary
-Version:    0.9.275
+Version:    0.9.276
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0