#define DBUS_ERR_MSG_MAX 24
+//LCOV_EXCL_START
int _convert_dbus_error(const char *error_msg)
{
int ret = MM_ERROR_NONE;
return ret;
}
+//LCOV_EXCL_STOP
int _convert_sound_manager_error_code(const char *func, int code)
{
case MM_ERROR_SOUND_INTERNAL:
case MM_ERROR_SOUND_VOLUME_CAPTURE_ONLY:
case MM_ERROR_OUT_OF_MEMORY:
+ //LCOV_EXCL_START
ret = SOUND_MANAGER_ERROR_INTERNAL;
errorstr = "INTERNAL";
+ //LCOV_EXCL_STOP
break;
case MM_ERROR_POLICY_DUPLICATED:
case MM_ERROR_POLICY_INTERNAL:
*stream_type = "ext-media";
break;
default:
+ //LCOV_EXCL_START
LOGE("could not find the stream_type[%d] in this switch case statement", stream_type_enum);
ret = MM_ERROR_SOUND_INTERNAL;
break;
+ //LCOV_EXCL_STOP
}
LOGI("stream_type[%s]", *stream_type);
return ret;
}
+//LCOV_EXCL_START
int _convert_stream_type_for_internal(sound_stream_type_internal_e stream_type_enum, char **stream_type)
{
int ret = MM_ERROR_NONE;
void _set_focus_availability(sound_stream_info_s *stream_info)
{
if (stream_info == NULL || stream_info->stream_type == NULL) {
- //LCOV_EXCL_START
LOGE("invalid argument");
return;
- //LCOV_EXCL_STOP
}
if (!strncmp(stream_info->stream_type, "solo", SOUND_STREAM_TYPE_LEN) ||
!strncmp(stream_info->stream_type, "radio", SOUND_STREAM_TYPE_LEN) ||
return;
}
+//LCOV_EXCL_STOP
int _convert_stream_type_to_change_reason(const char *stream_type, sound_stream_focus_change_reason_e *change_reason)
{
*change_reason = SOUND_STREAM_FOCUS_CHANGED_BY_MEDIA;
} else if (!strncmp(stream_type, "system", SOUND_STREAM_TYPE_LEN)) {
- *change_reason = SOUND_STREAM_FOCUS_CHANGED_BY_SYSTEM;
+ *change_reason = SOUND_STREAM_FOCUS_CHANGED_BY_SYSTEM;//LCOV_EXCL_LINE
} else if (!strncmp(stream_type, "alarm", SOUND_STREAM_TYPE_LEN)) {
*change_reason = SOUND_STREAM_FOCUS_CHANGED_BY_ALARM;
*change_reason = SOUND_STREAM_FOCUS_CHANGED_BY_NOTIFICATION;
} else if (!strncmp(stream_type, "emergency", SOUND_STREAM_TYPE_LEN)) {
- *change_reason = SOUND_STREAM_FOCUS_CHANGED_BY_EMERGENCY;
+ *change_reason = SOUND_STREAM_FOCUS_CHANGED_BY_EMERGENCY;//LCOV_EXCL_LINE
} else if (!strncmp(stream_type, "voice-information", SOUND_STREAM_TYPE_LEN)) {
- *change_reason = SOUND_STREAM_FOCUS_CHANGED_BY_VOICE_INFORMATION;
+ *change_reason = SOUND_STREAM_FOCUS_CHANGED_BY_VOICE_INFORMATION;//LCOV_EXCL_LINE
} else if (!strncmp(stream_type, "voice-recognition", SOUND_STREAM_TYPE_LEN) ||
!strncmp(stream_type, "voice-recognition-service", SOUND_STREAM_TYPE_LEN)) {
} else if (!strncmp(stream_type, "call-voice", SOUND_STREAM_TYPE_LEN) ||
!strncmp(stream_type, "call-video", SOUND_STREAM_TYPE_LEN)) {
- *change_reason = SOUND_STREAM_FOCUS_CHANGED_BY_CALL;
+ *change_reason = SOUND_STREAM_FOCUS_CHANGED_BY_CALL;//LCOV_EXCL_LINE
} else if (!strncmp(stream_type, "ext-media", SOUND_STREAM_TYPE_LEN)) {
*change_reason = SOUND_STREAM_FOCUS_CHANGED_BY_MEDIA_EXTERNAL_ONLY;
SM_NULL_ARG_CHECK_FOR_PRIV(sound_type_enum);
if (!strncmp(sound_type, "system", strlen(sound_type))) {
- *sound_type_enum = SOUND_TYPE_SYSTEM;
+ *sound_type_enum = SOUND_TYPE_SYSTEM;//LCOV_EXCL_LINE
} else if (!strncmp(sound_type, "notification", strlen(sound_type))) {
- *sound_type_enum = SOUND_TYPE_NOTIFICATION;
+ *sound_type_enum = SOUND_TYPE_NOTIFICATION;//LCOV_EXCL_LINE
} else if (!strncmp(sound_type, "alarm", strlen(sound_type))) {
*sound_type_enum = SOUND_TYPE_ALARM;
} else if (!strncmp(sound_type, "ringtone", strlen(sound_type))) {
- *sound_type_enum = SOUND_TYPE_RINGTONE;
+ *sound_type_enum = SOUND_TYPE_RINGTONE;//LCOV_EXCL_LINE
} else if (!strncmp(sound_type, "media", strlen(sound_type))) {
*sound_type_enum = SOUND_TYPE_MEDIA;
} else if (!strncmp(sound_type, "call", strlen(sound_type))) {
- *sound_type_enum = SOUND_TYPE_CALL;
+ *sound_type_enum = SOUND_TYPE_CALL;//LCOV_EXCL_LINE
} else if (!strncmp(sound_type, "voip", strlen(sound_type))) {
*sound_type_enum = SOUND_TYPE_VOIP;
} else if (!strncmp(sound_type, "voice", strlen(sound_type))) {
return MM_ERROR_NONE;
}
-
+//LCOV_EXCL_START
int _convert_device_type_enum_to_str(sound_device_type_e device_type, char **device_type_str)
{
SM_NULL_ARG_CHECK_FOR_PRIV(device_type_str);
case SOUND_DEVICE_BUILTIN_MIC:
*device_type_str = "builtin-mic";
break;
- //LCOV_EXCL_START
case SOUND_DEVICE_AUDIO_JACK:
*device_type_str = "audio-jack";
break;
default:
LOGE("could not find the device_type[%d] in this switch case statement", device_type);
return MM_ERROR_SOUND_INTERNAL;
- //LCOV_EXCL_STOP
}
LOGI("device_type[%s]", *device_type_str);
if (!strncmp(device_type_str, "builtin-speaker", SOUND_DEVICE_TYPE_LEN)) {
*device_type = SOUND_DEVICE_BUILTIN_SPEAKER;
- //LCOV_EXCL_START
+
} else if (!strncmp(device_type_str, "builtin-receiver", SOUND_DEVICE_TYPE_LEN)) {
*device_type = SOUND_DEVICE_BUILTIN_RECEIVER;
LOGE("not supported device_type(%s)", device_type_str);
return MM_ERROR_INVALID_ARGUMENT;
}
- //LCOV_EXCL_STOP
return MM_ERROR_NONE;
}
-
+//LCOV_EXCL_STOP
int _convert_device_type(mm_sound_device_type_e device_type, sound_device_type_e *sound_device_type)
{
switch (device_type) {
return MM_ERROR_NONE;
}
-
+//LCOV_EXCL_START
const char* _convert_api_name(native_api_e api_name)
{
const char* name = NULL;
return MM_ERROR_NONE;
}
+//LCOV_EXCL_STOP
int _return_val_if_not_usb_device(sound_device_h device, int ret_val)
{
return;
}
+//LCOV_EXCL_START
void _pa_stream_state_cb(pa_stream *s, void * userdata)
{
pa_stream_state_t state;
return;
}
+//LCOV_EXCL_STOP
int _get_stream_conf_info(const char *stream_type, stream_conf_info_s *info)
{
NULL,
&err);
if (!result || err) {
+ //LCOV_EXCL_START
LOGE("g_dbus_connection_call_sync() for GET_STREAM_INFO error (%s)", err ? err->message : NULL);
g_error_free(err);
ret = MM_ERROR_SOUND_INTERNAL;
goto LEAVE;
+ //LCOV_EXCL_STOP
}
/* get priority */
i = 0;
while (g_variant_iter_loop(&iter, "&s", &name)) {
if (size == 1 && !strncmp(name, "none", strlen("none"))) {
- LOGI(" framework is [%s], skip it", name);
+ LOGI(" framework is [%s], skip it", name);//LCOV_EXCL_LINE
break;
}
LOGI(" framework name : %s", name);
g_variant_unref(child);
if (info->priority == -1) {
- LOGE("could not find the info of stream type(%s)", stream_type);
+ LOGE("could not find the info of stream type(%s)", stream_type);//LCOV_EXCL_LINE
ret = MM_ERROR_NOT_SUPPORT_API;
}
NULL,
&err);
if (!result || err) {
+ //LCOV_EXCL_START
LOGE("g_dbus_connection_call_sync() for SET_STREAM_ROUTE_DEVICES error (%s)", err ? err->message : NULL);
g_error_free(err);
ret = MM_ERROR_SOUND_INTERNAL;
goto LEAVE;
+ //LCOV_EXCL_STOP
}
g_variant_get(result, "(&s)", &dbus_ret);
return ret;
}
+//LCOV_EXCL_START
int _set_route_option(unsigned int index, const char *name, int value)
{
int ret = MM_ERROR_NONE;
return ret;
}
+//LCOV_EXCL_STOP
int _get_volume_max_level(const char *direction, const char *volume_type, unsigned int *max_level)
{
NULL,
&err);
if (!result || err) {
+ //LCOV_EXCL_START
LOGE("g_dbus_connection_call_sync() for GET_VOLUME_MAX_LEVEL error (%s)", err ? err->message : NULL);
g_error_free(err);
ret = MM_ERROR_SOUND_INTERNAL;
goto LEAVE;
+ //LCOV_EXCL_STOP
}
g_variant_get(result, "(u&s)", max_level, &dbus_ret);
LOGI("g_dbus_connection_call_sync() success, method return value is (%u, %s)", *max_level, dbus_ret);
if (strncmp("STREAM_MANAGER_RETURN_OK", dbus_ret, strlen(dbus_ret)))
- ret = MM_ERROR_SOUND_INTERNAL;
+ ret = MM_ERROR_SOUND_INTERNAL;//LCOV_EXCL_LINE
LEAVE:
g_variant_unref(result);
return ret;
}
+//LCOV_EXCL_START
int _get_volume_level(const char *direction, const char *volume_type, unsigned int *level)
{
int ret = MM_ERROR_NONE;
return ret;
}
+//LCOV_EXCL_STOP
int _get_current_volume_type(const char *direction, char **volume_type)
{
NULL,
&err);
if (!result || err) {
+ //LCOV_EXCL_START
LOGE("g_dbus_connection_call_sync() for GET_CURRENT_VOLUME_TYPE error (%s)", err ? err->message : NULL);
g_error_free(err);
ret = MM_ERROR_SOUND_INTERNAL;
goto LEAVE;
+ //LCOV_EXCL_STOP
}
g_variant_get(result, "(&s&s)", &dbus_volume_type, &dbus_ret);
LOGI("g_dbus_connection_call_sync() success, method return value is (%s, %s)", dbus_volume_type, dbus_ret);
if (!strncmp("STREAM_MANAGER_RETURN_OK", dbus_ret, strlen(dbus_ret))) {
- ret = MM_ERROR_NONE;
- *volume_type = strdup(dbus_volume_type);
+ ret = MM_ERROR_NONE;//LCOV_EXCL_LINE
+ *volume_type = strdup(dbus_volume_type);//LCOV_EXCL_LINE
} else if (!strncmp("STREAM_MANAGER_RETURN_ERROR_NO_STREAM", dbus_ret, strlen(dbus_ret))) {
ret = MM_ERROR_SOUND_VOLUME_NO_INSTANCE;
} else {
- ret = MM_ERROR_SOUND_INTERNAL;
+ ret = MM_ERROR_SOUND_INTERNAL;//LCOV_EXCL_LINE
}
LEAVE:
NULL,
&err);
if (!result || err) {
+ //LCOV_EXCL_START
LOGE("g_dbus_connection_call_sync() for GET_CURRENT_MEDIA_ROUTING_PATH error (%s)", err ? err->message : NULL);
g_error_free(err);
ret = MM_ERROR_SOUND_INTERNAL;
goto LEAVE;
+ //LCOV_EXCL_STOP
}
g_variant_get(result, "(&s&s)", &dbus_device_type, &dbus_ret);
if (!strncmp("STREAM_MANAGER_RETURN_OK", dbus_ret, strlen(dbus_ret))) {
ret = MM_ERROR_NONE;
if (_convert_device_type_str_to_enum(dbus_device_type, device_type) < 0)
- ret = MM_ERROR_SOUND_INTERNAL;
+ ret = MM_ERROR_SOUND_INTERNAL;//LCOV_EXCL_LINE
} else {
if (!strncmp("none", dbus_device_type, strlen(dbus_device_type)))
ret = MM_ERROR_SOUND_NO_DATA;
NULL,
&err);
if (!result || err) {
+ //LCOV_EXCL_START
LOGE("g_dbus_connection_call_sync() for UPDATE_FOCUS_STATUS error (%s)", err ? err->message : NULL);
g_error_free(err);
goto LEAVE;
+ //LCOV_EXCL_STOP
}
g_variant_get(result, "(&s)", &dbus_ret);
LOGI("g_dbus_connection_call_sync() success, method return value is (%s)", dbus_ret);
if (strncmp("STREAM_MANAGER_RETURN_OK", dbus_ret, strlen(dbus_ret)))
- LOGE("failed to UPDATE_FOCUS_STATUS error (%s)", dbus_ret);
+ LOGE("failed to UPDATE_FOCUS_STATUS error (%s)", dbus_ret);//LCOV_EXCL_LINE
LEAVE:
g_variant_unref(result);
return;
}
+//LCOV_EXCL_START
int _is_device_running_by_id(int device_id, bool *is_running)
{
int ret = MM_ERROR_NONE;
return ret;
}
+//LCOV_EXCL_STOP
int _make_pa_connection_and_register_focus(sound_stream_info_s *stream_h, sound_stream_focus_state_changed_cb callback, void *user_data)
{
pa_context_set_state_callback(stream_h->pa_context, _pa_context_state_cb, stream_h);
if (pa_context_connect(stream_h->pa_context, NULL, 0, NULL) < 0) {
- pa_ret = pa_context_errno(stream_h->pa_context);
+ pa_ret = pa_context_errno(stream_h->pa_context);//LCOV_EXCL_LINE
goto PA_ERROR;
}
if (state == PA_CONTEXT_READY)
break;
if (!PA_CONTEXT_IS_GOOD(state)) {
- pa_ret = pa_context_errno(stream_h->pa_context);
+ pa_ret = pa_context_errno(stream_h->pa_context);//LCOV_EXCL_LINE
goto PA_ERROR_WITH_UNLOCK;
}
pa_threaded_mainloop_wait(stream_h->pa_mainloop);
stream_h->user_cb = callback;
stream_h->user_data = user_data;
} else {
- LOGE("failed to register focus, ret(0x%x)", ret);
+ LOGE("failed to register focus, ret(0x%x)", ret);//LCOV_EXCL_LINE
/* disconnect */
goto PA_ERROR;
}
if (!stream_h->is_focus_unavailable) {
ret = mm_sound_unregister_focus(stream_h->focus_id);
if (ret)
- LOGE("failed to unregister focus, ret(0x%x)", ret);
+ LOGE("failed to unregister focus, ret(0x%x)", ret);//LCOV_EXCL_LINE
}
for (i = 0; i < AVAIL_DEVICES_MAX; i++) {
return MM_ERROR_NONE;
}
-
+//LCOV_EXCL_START
int _add_device_id_for_stream_routing(sound_stream_info_s *stream_info, int device_id)
{
int ret = MM_ERROR_NONE;
mm_sound_free_device(device);
return ret;
}
-
+//LCOV_EXCL_STOP
int _apply_stream_routing(sound_stream_info_s *stream_info)
{
int i = 0;
if (stream_info->stream_conf_info.route_type != STREAM_ROUTE_TYPE_MANUAL &&
stream_info->stream_conf_info.route_type != STREAM_ROUTE_TYPE_MANUAL_EXT) {
- LOGE("route type is not manual or manual-ext");
+ LOGE("route type is not manual or manual-ext");//LCOV_EXCL_LINE
/* Differ from others, it uses SOUND_INTERNAL error.
* ACR process is required prior to changing error value. */
- return MM_ERROR_SOUND_INTERNAL;
+ return MM_ERROR_SOUND_INTERNAL;//LCOV_EXCL_LINE
}
for (i = 0; i < AVAIL_DEVICES_MAX; i++) {
return MM_ERROR_SOUND_INVALID_STATE;
}
+//LCOV_EXCL_START
int _create_virtual_stream(sound_stream_info_s *stream_info, virtual_sound_stream_info_s **virtual_stream)
{
int ret = MM_ERROR_NONE;
pa_threaded_mainloop_unlock(virtual_stream->pa_mainloop);
return ret;
-//LCOV_EXCL_START
+
ERROR_WITH_UNLOCK:
pa_threaded_mainloop_unlock(virtual_stream->pa_mainloop);
}
}
LOGE("pa_ret(%d)", pa_ret);
-//LCOV_EXCL_STOP
return ret;
}
pa_threaded_mainloop_unlock(virtual_stream->pa_mainloop);
return ret;
-}
\ No newline at end of file
+}
+//LCOV_EXCL_STOP