int _get_current_volume_type(const char *direction, char **volume_type);
-int _get_current_media_routing_path(const char *direction, char **device_type);
+int _get_current_media_routing_path(const char *direction, sound_device_type_e *device_type);
void _update_focus_status(unsigned int index, unsigned int acquired_focus_status);
SM_NULL_ARG_CHECK(stream_h);
SM_NULL_ARG_CHECK(device);
SM_NULL_ARG_CHECK(is_on);
-#if 0
- ret = mm_sound_get_device_id(device, &device_id);
- if (ret == MM_ERROR_NONE)
- ret = _is_using_device(stream_h->index, device_id, is_on);
- if (ret == MM_ERROR_NONE)
- LOGI("stream info index(%u), device_id(%d), is_on(%d)", stream_h->index, device_id, *is_on);
-#endif
+ ret = mm_sound_is_stream_on_device(stream_h->index, device, is_on);
+
return _convert_sound_manager_error_code(__func__, ret);
}
int sound_manager_get_current_media_playback_device_type(sound_device_type_e *device_type)
{
int ret = MM_ERROR_NONE;
-#if 0
- char *device_type_str = NULL;
-#endif
LOGI(">> enter");
SM_NULL_ARG_CHECK(device_type);
-#if 0
- ret = _get_current_media_routing_path("out", &device_type_str);
- if (ret == MM_ERROR_NONE)
- ret = _convert_device_type_str_to_enum(device_type_str, device_type);
-#endif
+ ret = _get_current_media_routing_path("out", device_type);
return _convert_sound_manager_error_code(__func__, ret);
}
return ret;
}
-int _get_current_media_routing_path(const char *direction, char **device_type)
+int _get_current_media_routing_path(const char *direction, sound_device_type_e *device_type)
{
int ret = MM_ERROR_NONE;
GVariant *result = NULL;
LOGI("g_dbus_connection_call_sync() success, method return value is (%s, %s)", dbus_device_type, dbus_ret);
if (!strncmp("STREAM_MANAGER_RETURN_OK", dbus_ret, strlen(dbus_ret))) {
ret = MM_ERROR_NONE;
- *device_type = strdup(dbus_device_type);
+ if (_convert_device_type_str_to_enum(dbus_device_type, device_type) < 0)
+ ret = MM_ERROR_SOUND_INTERNAL;
} else {
ret = MM_ERROR_SOUND_INTERNAL;
}