errorstr = "INVALID_PARAMETER";
break;
case MM_ERROR_SOUND_PERMISSION_DENIED:
+ //LCOV_EXCL_START
ret = SOUND_MANAGER_ERROR_PERMISSION_DENIED;
errorstr = "PERMISSION_DENIED";
break;
+ //LCOV_EXCL_STOP
case MM_ERROR_SOUND_NO_DATA:
ret = SOUND_MANAGER_ERROR_NO_DATA;
errorstr = "NO_DATA";
errorstr = "INVALID_STATE";
break;
default:
+ //LCOV_EXCL_START
LOGW("it should not be reached here, this error(0x%x) should be defined.", code);
ret = SOUND_MANAGER_ERROR_INTERNAL;
errorstr = "INTERNAL";
break;
+ //LCOV_EXCL_STOP
}
if (ret)
LOGE("[%s] >> leave : %s(0x%08x), mm_error(0x%08x)", func, errorstr, ret, code);
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) ||
*change_reason = SOUND_STREAM_FOCUS_CHANGED_BY_MEDIA_EXTERNAL_ONLY;
} else {
+ //LCOV_EXCL_START
LOGE("not supported stream_type(%s)", stream_type);
return MM_ERROR_INVALID_ARGUMENT;
+ //LCOV_EXCL_STOP
}
return MM_ERROR_NONE;
}
+//LCOV_EXCL_START
static int _convert_stream_type_to_interrupt_reason(const char *stream_type, sound_session_interrupted_code_e *change_reason)
{
SM_NULL_ARG_CHECK_FOR_PRIV(stream_type);
return MM_ERROR_NONE;
}
+//LCOV_EXCL_STOP
static int __get_dbus_connection(GDBusConnection **conn)
{
*conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &err);
if (!(*conn) || err) {
+ //LCOV_EXCL_START
if (err)
LOGE("g_bus_get_sync() error (%s)", err->message);
else
LOGE("g_bus_get_sync() error");
g_error_free(err);
return MM_ERROR_SOUND_INTERNAL;
+ //LCOV_EXCL_STOP
}
return MM_ERROR_NONE;
} else if (!strncmp(sound_type, "voice", strlen(sound_type))) {
*sound_type_enum = SOUND_TYPE_VOICE;
} else {
+ //LCOV_EXCL_START
LOGE("not supported sound_type(%s)", sound_type);
return MM_ERROR_INVALID_ARGUMENT;
+ //LCOV_EXCL_STOP
}
return MM_ERROR_NONE;
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;
} else if (!strncmp(device_type_str, "audio-jack", SOUND_DEVICE_TYPE_LEN)) {
*device_type = SOUND_DEVICE_AUDIO_JACK;
-
} else if (!strncmp(device_type_str, "hdmi", SOUND_DEVICE_TYPE_LEN)) {
*device_type = SOUND_DEVICE_HDMI;
LOGE("not supported device_type(%s)", device_type_str);
return MM_ERROR_INVALID_ARGUMENT;
}
+ //LCOV_EXCL_STOP
return MM_ERROR_NONE;
}
case MM_SOUND_DEVICE_TYPE_BUILTIN_MIC:
*sound_device_type = SOUND_DEVICE_BUILTIN_MIC;
break;
+ //LCOV_EXCL_START
case MM_SOUND_DEVICE_TYPE_AUDIOJACK:
*sound_device_type = SOUND_DEVICE_AUDIO_JACK;
break;
default:
LOGE("not supported device_type(%d)", device_type);
return MM_ERROR_INVALID_ARGUMENT;
+ //LCOV_EXCL_STOP
}
return MM_ERROR_NONE;
return name;
}
+//LCOV_EXCL_START
void _focus_state_change_callback(int index, mm_sound_focus_type_e focus_type, mm_sound_focus_state_e state, const char *reason, int option, const char *extra_info, void *user_data)
{
int ret = MM_ERROR_NONE;
LOGI("<< leave");
return;
}
+//LCOV_EXCL_STOP
void _pa_context_state_cb(pa_context *c, void *userdata)
{
return;
}
+//LCOV_EXCL_START
static int _check_media_stream_exist_by_pid(unsigned int pid, const char *direction, bool *exist)
{
int ret = MM_ERROR_NONE;
return;
}
+//LCOV_EXCL_STOP
int _set_session_mode(_session_mode_e mode)
{
if (type == MM_SOUND_DEVICE_TYPE_BUILTIN_SPEAKER || type == MM_SOUND_DEVICE_TYPE_BUILTIN_MIC)
CHECK_AND_SET_DEVICE(proper_device, proper_device2, tmp_device);
break;
+ //LCOV_EXCL_START
case _SESSION_MODE_VOICE_WITH_AUDIO_JACK:
if (type == MM_SOUND_DEVICE_TYPE_BUILTIN_MIC)
proper_device_builtin_mic = tmp_device;
if (type == MM_SOUND_DEVICE_TYPE_BLUETOOTH_SCO)
CHECK_AND_SET_DEVICE(proper_device, proper_device2, tmp_device);
break;
+ //LCOV_EXCL_STOP
default:
break;
}
g_cached_session_mode = mode;
return ret;
-
+//LCOV_EXCL_START
ERROR_CASE_RINGTONE:
if (g_voip_ringtone_vstream_h) {
_destroy_virtual_stream(g_voip_ringtone_vstream_h);
mm_sound_free_device_list(device_list);
ret = MM_ERROR_SOUND_INTERNAL;
return ret;
+//LCOV_EXCL_STOP
}
int _make_pa_connection_and_register_focus(sound_stream_info_s *stream_h, bool is_for_session, sound_stream_focus_state_changed_cb callback, void *user_data)
}
}
goto SUCCESS;
-
+//LCOV_EXCL_START
PA_ERROR_WITH_UNLOCK:
pa_threaded_mainloop_unlock(stream_h->pa_mainloop);
}
ret = MM_ERROR_SOUND_INTERNAL;
LOGE("pa_ret(%d), ret(0x%x)", pa_ret, ret);
-
+//LCOV_EXCL_STOP
SUCCESS:
return ret;
}
pa_threaded_mainloop_unlock(virtual_stream->pa_mainloop);
return ret;
-
+//LCOV_EXCL_START
ERROR_WITH_UNLOCK:
/* UNLOCK the pa_threaded_mainloop */
pa_threaded_mainloop_unlock(virtual_stream->pa_mainloop);
}
}
LOGE("pa_ret(%d)", pa_ret);
-
+//LCOV_EXCL_STOP
ERROR:
return ret;
}
SM_INSTANCE_CHECK_FOR_PRIV(virtual_stream);
if ((ret = _create_virtual_stream(stream_info, virtual_stream)))
- LOGE("failed to _create_virtual_stream(), ret(0x%x)", ret);
+ LOGE("failed to _create_virtual_stream(), ret(0x%x)", ret); //LCOV_EXCL_LINE
else if ((ret = _start_virtual_stream(*virtual_stream)))
- LOGE("failed to _start_virtual_stream(), ret(0x%x)", ret);
+ LOGE("failed to _start_virtual_stream(), ret(0x%x)", ret); //LCOV_EXCL_LINE
return ret;
}
SM_INSTANCE_CHECK_FOR_PRIV(virtual_stream);
if ((ret = _stop_virtual_stream(virtual_stream)))
- LOGE("failed to _stop_virtual_stream(), ret(0x%x)", ret);
+ LOGE("failed to _stop_virtual_stream(), ret(0x%x)", ret); //LCOV_EXCL_LINE
else if ((ret = _destroy_virtual_stream(virtual_stream)))
- LOGE("failed to _destroy_virtual_stream(), ret(0x%x)", ret);
+ LOGE("failed to _destroy_virtual_stream(), ret(0x%x)", ret); //LCOV_EXCL_LINE
return ret;
}