} else if (-1 == g_feature_enabled) {
bool vc_supported = false;
bool mic_supported = false;
- if (0 == system_info_get_platform_bool(VC_FEATURE_PATH, &vc_supported)) {
- if (0 == system_info_get_platform_bool(VC_MIC_FEATURE_PATH, &mic_supported)) {
- if (false == vc_supported || false == mic_supported) {
- //LCOV_EXCL_START
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Voice control feature NOT supported");
- g_feature_enabled = 0;
- return VC_ERROR_NOT_SUPPORTED;
- //LCOV_EXCL_STOP
- }
+ if (SYSTEM_INFO_ERROR_NONE != system_info_get_platform_bool(VC_FEATURE_PATH, &vc_supported)) {
+ //LCOV_EXCL_START
+ SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to get feature value");
+ return VC_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
+ }
- g_feature_enabled = 1;
- } else {
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to get feature value"); //LCOV_EXCL_LINE
- return VC_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
- }
- } else {
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to get feature value"); //LCOV_EXCL_LINE
- return VC_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ if (SYSTEM_INFO_ERROR_NONE != system_info_get_platform_bool(VC_MIC_FEATURE_PATH, &mic_supported)) {
+ //LCOV_EXCL_START
+ SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to get feature value");
+ return VC_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
}
+
+ if (false == vc_supported || false == mic_supported) {
+ //LCOV_EXCL_START
+ SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Voice control feature NOT supported");
+ g_feature_enabled = 0;
+ return VC_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
+ }
+
+ g_feature_enabled = 1;
}
return VC_ERROR_NONE;
return VC_ERROR_NONE;
}
+//LCOV_EXCL_STOP
static void __vc_lang_changed_cb(const char* previous_lang, const char* current_lang)
{
} else {
SLOG(LOG_WARN, TAG_VCC, "[WARNING] Language changed callback is null");
}
-
- return;
}
+//LCOV_EXCL_START
static Eina_Bool __notify_auth_changed_cb(void *data)
{
vc_auth_state_changed_cb callback = NULL;
/* check handle */
if (true == vc_client_is_valid()) {
- SLOG(LOG_DEBUG, TAG_VCC, "[DEBUG] Already initialized"); //LCOV_EXCL_LINE
- return VC_ERROR_NONE; //LCOV_EXCL_LINE
+ SLOG(LOG_DEBUG, TAG_VCC, "[DEBUG] Already initialized");
+ return VC_ERROR_NONE;
}
if (0 != vc_tidl_open_connection()) {
g_pid = getpid();
ret = vc_config_mgr_initialize(g_pid);
if (0 != ret) {
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to init config manager : %s",
- __vc_get_error_code(__vc_convert_config_error_code(ret))); //LCOV_EXCL_LINE
+ ret = __vc_convert_config_error_code(ret); //LCOV_EXCL_LINE
+ SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to init config manager : %s", __vc_get_error_code(ret)); //LCOV_EXCL_LINE
vc_client_destroy(); //LCOV_EXCL_LINE
- return __vc_convert_config_error_code(ret); //LCOV_EXCL_LINE
+ return ret; //LCOV_EXCL_LINE
}
ret = vc_config_mgr_set_lang_cb(g_pid, __vc_lang_changed_cb);
if (0 != ret) {
+ ret = __vc_convert_config_error_code(ret); //LCOV_EXCL_LINE
SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to set config changed : %d", ret); //LCOV_EXCL_LINE
vc_config_mgr_finalize(g_pid); //LCOV_EXCL_LINE
vc_client_destroy(); //LCOV_EXCL_LINE
- return __vc_convert_config_error_code(ret);
+ return ret; //LCOV_EXCL_LINE
}
SLOG(LOG_DEBUG, TAG_VCC, "[Success] pid(%d)", g_pid);
-
return VC_ERROR_NONE;
}
}
if (VC_AUTH_STATE_NONE != state) {
- if (0 != vc_auth_disable()) {
+ if (0 != vc_auth_disable()) { //LCOV_EXCL_LINE
SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to auth disable"); //LCOV_EXCL_LINE
}
}
ret = vc_cmd_parser_delete_file(getpid(), VC_COMMAND_TYPE_FOREGROUND);
if (0 != ret)
SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to delete file, type(%d), ret(%d)", VC_COMMAND_TYPE_FOREGROUND, ret); //LCOV_EXCL_LINE
-
- return;
}
int vc_deinitialize(void)
return VC_ERROR_NONE;
}
-static Eina_Bool __vc_connect_daemon(void *data)
+static Eina_Bool connect_service(void *data)
{
SLOG(LOG_DEBUG, TAG_VCC, "@@@ [Client] Connect daemon");
int service_state = 0;
/* check handle */
- if (true == vc_client_is_valid()) {
- SLOG(LOG_DEBUG, TAG_VCC, "[DEBUG] The current client is valid");
+ if (false == vc_client_is_valid()) {
+ SLOG(LOG_ERROR, TAG_VCC, "[Not ERROR] The current client is not valid. It is destroyed."); //LCOV_EXCL_LINE
+ return EINA_FALSE;
+ }
- /* Initialize DB */
- ret = vc_db_initialize();
- if (0 != ret) {
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to initialize DB : %d", ret); //LCOV_EXCL_LINE
- return EINA_TRUE;
- }
+ SLOG(LOG_DEBUG, TAG_VCC, "[DEBUG] The current client is valid");
- ret = vc_cmd_parser_delete_file(getpid(), VC_COMMAND_TYPE_FOREGROUND);
- if (0 != ret)
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to delete file, type(%d), ret(%d)", VC_COMMAND_TYPE_FOREGROUND, ret); //LCOV_EXCL_LINE
+ /* Initialize DB */
+ ret = vc_db_initialize();
+ if (0 != ret) {
+ SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to initialize DB : %d", ret); //LCOV_EXCL_LINE
+ return EINA_TRUE;
+ }
- ret = vc_tidl_request_initialize(g_pid, &mgr_pid, &service_state, &g_daemon_pid);
- //LCOV_EXCL_START
- if (VC_ERROR_ENGINE_NOT_FOUND == ret) {
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to initialize : %s", __vc_get_error_code(ret));
+ ret = vc_cmd_parser_delete_file(getpid(), VC_COMMAND_TYPE_FOREGROUND);
+ if (0 != ret)
+ SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to delete file, type(%d), ret(%d)", VC_COMMAND_TYPE_FOREGROUND, ret); //LCOV_EXCL_LINE
- vc_client_set_error(VC_ERROR_ENGINE_NOT_FOUND);
- ecore_main_loop_thread_safe_call_async(__vc_notify_error, NULL);
+ ret = vc_tidl_request_initialize(g_pid, &mgr_pid, &service_state, &g_daemon_pid);
+ //LCOV_EXCL_START
+ if (VC_ERROR_ENGINE_NOT_FOUND == ret) {
+ SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to initialize : %s", __vc_get_error_code(ret));
- return EINA_FALSE;
- //LCOV_EXCL_STOP
- } else if (0 != ret) {
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to initialize :%s", __vc_get_error_code(ret)); //LCOV_EXCL_LINE
+ vc_client_set_error(VC_ERROR_ENGINE_NOT_FOUND);
+ ecore_main_loop_thread_safe_call_async(__vc_notify_error, NULL);
- vc_client_set_error(VC_ERROR_TIMED_OUT);
- ecore_main_loop_thread_safe_call_async(__vc_notify_error, NULL);
+ return EINA_FALSE;
+ //LCOV_EXCL_STOP
+ } else if (0 != ret) {
+ SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to initialize :%s", __vc_get_error_code(ret)); //LCOV_EXCL_LINE
- ret = vc_db_finalize();
- if (0 != ret) {
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to finalize DB : %d", ret); //LCOV_EXCL_LINE
- }
+ vc_client_set_error(VC_ERROR_TIMED_OUT);
+ ecore_main_loop_thread_safe_call_async(__vc_notify_error, NULL);
- return EINA_TRUE;
- } else {
- /* Success to connect */
+ ret = vc_db_finalize();
+ if (0 != ret) {
+ SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to finalize DB : %d", ret); //LCOV_EXCL_LINE
}
- /* Set service state */
- vc_service_state_e previous_service_state;
- vc_client_get_service_state(&previous_service_state);
+ return EINA_TRUE;
+ } else {
+ /* Success to connect */
+ }
- vc_client_set_service_state((vc_service_state_e)service_state);
+ /* Set service state */
+ vc_service_state_e previous_service_state;
+ vc_client_get_service_state(&previous_service_state);
- vc_service_state_changed_cb service_changed_callback = NULL;
- void* user_data = NULL;
- vc_client_get_service_state_changed_cb(&service_changed_callback, &user_data);
+ vc_client_set_service_state((vc_service_state_e)service_state);
- if (NULL != service_changed_callback) {
- vc_client_use_callback();
- service_changed_callback(previous_service_state, service_state, user_data);
- vc_client_not_use_callback();
- SLOG(LOG_DEBUG, TAG_VCC, "Service state changed callback is called"); //LCOV_EXCL_LINE
- } else {
- SLOG(LOG_WARN, TAG_VCC, "[WARNING] Service state changed callback is null"); //LCOV_EXCL_LINE
- }
+ vc_service_state_changed_cb service_changed_callback = NULL;
+ void* user_data = NULL;
+ vc_client_get_service_state_changed_cb(&service_changed_callback, &user_data);
- /* Register focus handler */
- ecore_thread_main_loop_begin();
- g_focus_in_handler = ecore_event_handler_add(ECORE_WL2_EVENT_FOCUS_IN, __focus_changed_cb, NULL);
- g_focus_out_handler = ecore_event_handler_add(ECORE_WL2_EVENT_FOCUS_OUT, __focus_changed_cb, NULL);
- ecore_thread_main_loop_end();
-
- char appid[1024] = {'\0',};
- ret = aul_app_get_appid_bypid(getpid(), appid, sizeof(appid) - 1);
- if (ret != AUL_R_OK)
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to get aul_app_get_appid_bypid : %d", ret);
-
- int status = aul_app_get_status(appid);
- if (STATUS_FOCUS == status) {
- SLOG(LOG_DEBUG, TAG_VCC, "@@@ Set foreground"); //LCOV_EXCL_LINE
- ret = vc_tidl_request_set_foreground(getpid(), true);
- if (0 != ret) {
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to set foreground (true) : %d", ret); //LCOV_EXCL_LINE
- }
+ if (NULL != service_changed_callback) {
+ vc_client_use_callback();
+ service_changed_callback(previous_service_state, service_state, user_data);
+ vc_client_not_use_callback();
+ SLOG(LOG_DEBUG, TAG_VCC, "Service state changed callback is called"); //LCOV_EXCL_LINE
+ } else {
+ SLOG(LOG_WARN, TAG_VCC, "[WARNING] Service state changed callback is null"); //LCOV_EXCL_LINE
+ }
- ret = vc_client_set_is_foreground(true);
- if (0 != ret) {
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to save is_foreground (true) : %d", ret); //LCOV_EXCL_LINE
- }
+ /* Register focus handler */
+ ecore_thread_main_loop_begin();
+ g_focus_in_handler = ecore_event_handler_add(ECORE_WL2_EVENT_FOCUS_IN, __focus_changed_cb, NULL);
+ g_focus_out_handler = ecore_event_handler_add(ECORE_WL2_EVENT_FOCUS_OUT, __focus_changed_cb, NULL);
+ ecore_thread_main_loop_end();
- /* set authority valid */
- vc_auth_state_e state = VC_AUTH_STATE_NONE;
- if (0 != vc_client_get_auth_state(&state)) {
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to get auth state"); //LCOV_EXCL_LINE
- }
- if (VC_AUTH_STATE_INVALID == state) {
- vc_client_set_auth_state(VC_AUTH_STATE_VALID);
+ char appid[1024] = {'\0',};
+ ret = aul_app_get_appid_bypid(getpid(), appid, sizeof(appid) - 1);
+ if (ret != AUL_R_OK)
+ SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to get aul_app_get_appid_bypid : %d", ret);
- /* notify auth changed cb */
- ecore_idler_add(__notify_auth_changed_cb, NULL);
- }
+ int status = aul_app_get_status(appid);
+ if (STATUS_FOCUS == status) {
+ SLOG(LOG_DEBUG, TAG_VCC, "@@@ Set foreground"); //LCOV_EXCL_LINE
+ ret = vc_tidl_request_set_foreground(getpid(), true);
+ if (0 != ret) {
+ SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to set foreground (true) : %d", ret); //LCOV_EXCL_LINE
}
- vc_client_set_client_state(VC_STATE_READY);
- ecore_main_loop_thread_safe_call_async(__vc_notify_state_changed, NULL);
+ ret = vc_client_set_is_foreground(true);
+ if (0 != ret) {
+ SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to save is_foreground (true) : %d", ret); //LCOV_EXCL_LINE
+ }
- vc_client_set_mgr_pid(mgr_pid);
- } else {
- SLOG(LOG_ERROR, TAG_VCC, "[Not ERROR] The current client is not valid. It is destroyed."); //LCOV_EXCL_LINE
- return EINA_FALSE;
+ /* set authority valid */
+ vc_auth_state_e state = VC_AUTH_STATE_NONE;
+ if (0 != vc_client_get_auth_state(&state)) {
+ SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to get auth state"); //LCOV_EXCL_LINE
+ }
+ if (VC_AUTH_STATE_INVALID == state) {
+ vc_client_set_auth_state(VC_AUTH_STATE_VALID);
+
+ /* notify auth changed cb */
+ ecore_idler_add(__notify_auth_changed_cb, NULL);
+ }
}
+
+ vc_client_set_client_state(VC_STATE_READY);
+ ecore_main_loop_thread_safe_call_async(__vc_notify_state_changed, NULL);
+
+ vc_client_set_mgr_pid(mgr_pid);
+
/* TODO set_start_listening should be move to proper place */
vc_client_set_start_listening(true);
while (0 != ret) {
pthread_mutex_lock(&g_prepare_thread_mutex);
if (EINA_TRUE == ecore_thread_check(thread)) {
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to request hello !!"); //LCOV_EXCL_LINE
+ SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to request hello !!");
pthread_mutex_unlock(&g_prepare_thread_mutex);
return;
}
if (retry_count == VC_TIDL_RETRY_COUNT) { // 200 ms * 20 = 4 sec
SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to request hello !!"); //LCOV_EXCL_LINE
- pthread_mutex_unlock(&g_prepare_thread_mutex);
- return;
+ pthread_mutex_unlock(&g_prepare_thread_mutex); //LCOV_EXCL_LINE
+ return; //LCOV_EXCL_LINE
}
ret = vc_tidl_request_hello();
pthread_mutex_lock(&g_prepare_thread_mutex);
if (EINA_TRUE == ecore_thread_check(thread)) {
SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to request hello !!"); //LCOV_EXCL_LINE
- pthread_mutex_unlock(&g_prepare_thread_mutex);
- return;
+ pthread_mutex_unlock(&g_prepare_thread_mutex); //LCOV_EXCL_LINE
+ return; //LCOV_EXCL_LINE
}
if (retry_count == 10) {
SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to connect daemon !!"); //LCOV_EXCL_LINE
- pthread_mutex_unlock(&g_prepare_thread_mutex);
- return;
+ pthread_mutex_unlock(&g_prepare_thread_mutex); //LCOV_EXCL_LINE
+ return; //LCOV_EXCL_LINE
}
- ret = __vc_connect_daemon(NULL);
+ ret = connect_service(NULL);
pthread_mutex_unlock(&g_prepare_thread_mutex);
if (ret == 0)
break;
}
cnt = 0;
- while (EINA_TRUE == __vc_connect_daemon(NULL) && VC_CONNECTION_RETRY_COUNT > cnt) {
+ while (EINA_TRUE == connect_service(NULL) && VC_CONNECTION_RETRY_COUNT > cnt) {
cnt++;
}
ret = vc_config_mgr_get_language_list(callback, user_data);
if (0 != ret) {
- ret = vc_config_convert_error_code((vc_config_error_e)ret);
+ ret = vc_config_convert_error_code((vc_config_error_e)ret); //LCOV_EXCL_LINE
SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to get languages : %s", __vc_get_error_code(ret)); //LCOV_EXCL_LINE
}
return VC_ERROR_INVALID_STATE;
}
-
SLOG(LOG_DEBUG, TAG_VCC, "@@@ [Client] Get Current Language");
ret = vc_config_mgr_get_default_language(language);
if (0 != ret) {
- ret = vc_config_convert_error_code((vc_config_error_e)ret);
+ ret = vc_config_convert_error_code((vc_config_error_e)ret); //LCOV_EXCL_LINE
SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to get current languages : %s", __vc_get_error_code(ret)); //LCOV_EXCL_LINE
}
case VC_STATE_NONE: SLOG(LOG_DEBUG, TAG_VCC, "Current state is 'None'"); break;
case VC_STATE_INITIALIZED: SLOG(LOG_DEBUG, TAG_VCC, "Current state is 'Created'"); break;
case VC_STATE_READY: SLOG(LOG_DEBUG, TAG_VCC, "Current state is 'Ready'"); break;
- default:
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Invalid state. Return state as 'None'.");
- temp = VC_STATE_NONE;
+ default: //LCOV_EXCL_LINE
+ SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Invalid state. Return state as 'None'."); //LCOV_EXCL_LINE
+ temp = VC_STATE_NONE; //LCOV_EXCL_LINE
}
*state = temp;
vc_service_state_e service_state;
if (0 != vc_client_get_service_state(&service_state)) {
SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to get service state"); //LCOV_EXCL_LINE
- return VC_ERROR_OPERATION_FAILED;
+ return VC_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
}
SLOG(LOG_DEBUG, TAG_VCC, "@@@ [Client] Get Service State");
*state = service_state;
switch (*state) {
- case VC_SERVICE_STATE_NONE: SLOG(LOG_DEBUG, TAG_VCC, "Current service state is 'None'"); break;
+ case VC_SERVICE_STATE_NONE: SLOG(LOG_DEBUG, TAG_VCC, "Current service state is 'None'"); break; //LCOV_EXCL_LINE
case VC_SERVICE_STATE_READY: SLOG(LOG_DEBUG, TAG_VCC, "Current service state is 'Ready'"); break;
case VC_SERVICE_STATE_RECORDING: SLOG(LOG_DEBUG, TAG_VCC, "Current service state is 'Recording'"); break;
case VC_SERVICE_STATE_PROCESSING: SLOG(LOG_DEBUG, TAG_VCC, "Current service state is 'Processing'"); break;
- default: SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Invalid state");
+ default: SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Invalid state"); //LCOV_EXCL_LINE
}
SLOG(LOG_DEBUG, TAG_VCC, "@@@ [Client] Get Service State DONE");
ret = vc_client_get_mgr_pid(&mgr_pid);
if (0 != ret) {
SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to get the manager pid"); //LCOV_EXCL_LINE
- return VC_ERROR_OPERATION_FAILED;
+ return VC_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
}
if (true == is_sys_cmd_valid) {
ret = vc_cmd_list_create((vc_cmd_list_h*)&list);
if (0 != ret) {
SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to create command list"); //LCOV_EXCL_LINE
- return ret;
+ return ret; //LCOV_EXCL_LINE
}
ret = vc_cmd_parser_get_commands(mgr_pid, VC_COMMAND_TYPE_SYSTEM, &(list->list));
if (0 != ret) {
SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to get parsing commands"); //LCOV_EXCL_LINE
- vc_cmd_list_destroy((vc_cmd_list_h)list, true);
- return ret;
+ vc_cmd_list_destroy((vc_cmd_list_h)list, true); //LCOV_EXCL_LINE
+ return ret; //LCOV_EXCL_LINE
}
ret = vc_cmd_parser_get_commands(mgr_pid, VC_COMMAND_TYPE_SYSTEM_BACKGROUND, &(list->list));
if (0 != ret) {
SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to get parsing commands"); //LCOV_EXCL_LINE
- vc_cmd_list_destroy((vc_cmd_list_h)list, true);
- return ret;
+ vc_cmd_list_destroy((vc_cmd_list_h)list, true); //LCOV_EXCL_LINE
+ return ret; //LCOV_EXCL_LINE
}
*vc_sys_cmd_list = (vc_cmd_list_h)list;
} else {
- SLOG(LOG_WARN, TAG_VCC, "[WARNING] No system commands"); //LCOV_EXCL_LINE
+ SLOG(LOG_WARN, TAG_VCC, "[WARNING] No system commands");
return VC_ERROR_NONE;
}
ret = app_manager_get_app_id(getpid(), &appid);
if (0 != ret || NULL == appid) {
//LCOV_EXCL_START
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to get appid, ret(%d)", ret); //LCOV_EXCL_LINE
+ SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to get appid, ret(%d)", ret);
FREE(appid);
return VC_ERROR_OPERATION_FAILED;
//LCOV_EXCL_STOP
ret = vc_get_current_language(&lang);
if (0 != ret || NULL == lang) {
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to get current language, ret(%d)", ret); //LCOV_EXCL_LINE
+ //LCOV_EXCL_START
+ SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to get current language, ret(%d)", ret);
FREE(appid);
FREE(lang);
return VC_ERROR_OPERATION_FAILED;
+ //LCOV_EXCL_STOP
}
ret = app_info_get_localed_label(appid, lang, &temp_label);
if (0 != ret || NULL == temp_label) {
//LCOV_EXCL_START
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to get localed label, ret(%d) appid(%s) lang(%s)", ret, appid, lang); //LCOV_EXCL_LINE
+ SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to get localed label, ret(%d) appid(%s) lang(%s)", ret, appid, lang);
FREE(appid);
FREE(lang);
FREE(temp_label);
*invocation_name = strdup(temp_label);
if (NULL == *invocation_name) {
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to allocate memory"); //LCOV_EXCL_LINE
+ //LCOV_EXCL_START
+ SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to allocate memory");
FREE(appid);
FREE(lang);
FREE(temp_label);
return VC_ERROR_OUT_OF_MEMORY;
+ //LCOV_EXCL_STOP
}
FREE(appid);
//LCOV_EXCL_STOP
}
} while (0 != ret);
-
- return;
}
int vc_set_command_list(vc_cmd_list_h vc_cmd_list, int type)
/* check type */
if ((VC_COMMAND_TYPE_FOREGROUND != type) && (VC_COMMAND_TYPE_BACKGROUND != type)) {
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Invalid command type: input type is %d", type); //LCOV_EXCL_LINE
+ SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Invalid command type: input type is %d", type);
return VC_ERROR_INVALID_PARAMETER;
}
ret = __vc_get_invocation_name(&invocation_name);
if (0 != ret || NULL == invocation_name) {
SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to get invocation name, ret(%d)", ret); //LCOV_EXCL_LINE
- return ret;
+ return ret;//LCOV_EXCL_LINE
}
}
ret = vc_cmd_parser_delete_file(getpid(), (vc_cmd_type_e)type);
if (0 != ret) {
- ret = vc_config_convert_error_code((vc_config_error_e)ret);
+ ret = vc_config_convert_error_code((vc_config_error_e)ret); //LCOV_EXCL_LINE
SLOG(LOG_ERROR, TAG_VCC, "[ERROR] cmd_type(%d), Fail to delete command list : %s", type, __vc_get_error_code(ret)); //LCOV_EXCL_LINE
}
return ret;
}
-#if 0
-int vc_get_exclusive_command_option(bool* value)
-{
- SLOG(LOG_DEBUG, TAG_VCC, "@@@ [Client] Get exclusive command");
-
- vc_state_e state;
- if (0 != vc_client_get_client_state(g_vc, &state)) {
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] A handle is not available");
- SLOG(LOG_DEBUG, TAG_VCC, "@@@");
- return VC_ERROR_INVALID_STATE;
- }
-
- /* check state */
- if (state != VC_STATE_READY) {
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Invalid State: Current state is not 'READY'");
- SLOG(LOG_DEBUG, TAG_VCC, "@@@");
- return VC_ERROR_INVALID_STATE;
- }
-
- int ret = vc_client_get_exclusive_cmd(g_vc, value);
- if (0 != ret) {
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to set exclusive option : %d", ret);
- SLOG(LOG_DEBUG, TAG_VCC, "@@@");
- return ret;
- }
-
- SLOG(LOG_DEBUG, TAG_VCC, "@@@");
-
- return ret;
-}
-
-int vc_set_exclusive_command_option(bool value)
-{
- if (0 != __vc_get_feature_enabled()) {
- return VC_ERROR_NOT_SUPPORTED;
- }
- if (0 != __vc_check_privilege()) {
- return VC_ERROR_PERMISSION_DENIED;
- }
-
- SLOG(LOG_DEBUG, TAG_VCC, "@@@ [Client] Set exclusive command");
-
- vc_state_e state;
- if (0 != vc_client_get_client_state(g_vc, &state)) {
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] A handle is not available");
- SLOG(LOG_DEBUG, TAG_VCC, "@@@");
- return VC_ERROR_INVALID_STATE;
- }
-
- /* check state */
- if (state != VC_STATE_READY) {
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Invalid State: Current state is not 'READY'");
- SLOG(LOG_DEBUG, TAG_VCC, "@@@");
- return VC_ERROR_INVALID_STATE;
- }
-
- int ret = vc_client_set_exclusive_cmd(g_vc, value);
- if (0 != ret) {
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to set exclusive option : %d", ret);
- SLOG(LOG_DEBUG, TAG_VCC, "@@@");
- return ret;
- }
-
- int count = 0;
- do {
- ret = vc_dbus_request_set_exclusive_command(g_vc->handle, value);
- if (0 != ret) {
- if (VC_ERROR_TIMED_OUT != ret) {
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to request set exclusive command to daemon : %s", __vc_get_error_code(ret));
- break;
- } else {
- SLOG(LOG_WARN, TAG_VCC, "[WARNING] retry request set exclusive command : %s", __vc_get_error_code(ret));
- usleep(10000);
- count++;
- if (VC_RETRY_COUNT == count) {
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to request");
- break;
- }
- }
- }
- } while (0 != ret);
-
- SLOG(LOG_DEBUG, TAG_VCC, "@@@");
-
- return ret;
-}
-#endif
-
-#if 0
-int vc_request_start(bool stop_by_silence)
-{
- SLOG(LOG_DEBUG, TAG_VCC, "@@@ [Client] Request start");
-
- vc_state_e state;
- if (0 != vc_client_get_client_state(g_vc, &state)) {
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] A handle is not available");
- SLOG(LOG_DEBUG, TAG_VCC, "@@@");
- return VC_ERROR_INVALID_STATE;
- }
-
- /* check state */
- if (state != VC_STATE_READY) {
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Invalid State: client state is not 'READY'");
- SLOG(LOG_DEBUG, TAG_VCC, "@@@");
- return VC_ERROR_INVALID_STATE;
- }
-
- /* Check service state */
- vc_service_state_e service_state = -1;
- vc_client_get_service_state(g_vc, &service_state);
- if (service_state != VC_SERVICE_STATE_READY) {
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Invalid State: service state is not 'READY'");
- SLOG(LOG_DEBUG, TAG_VCC, "@@@");
- return VC_ERROR_INVALID_STATE;
- }
-
- int ret;
- int count = 0;
-
- /* Request */
- ret = -1;
- count = 0;
- while (0 != ret) {
- ret = vc_dbus_request_start(g_vc->handle, stop_by_silence);
- if (0 != ret) {
- if (VC_ERROR_TIMED_OUT != ret) {
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to start request start : %s", __vc_get_error_code(ret));
- break;
- } else {
- SLOG(LOG_WARN, TAG_VCC, "[WARNING] retry start request start : %s", __vc_get_error_code(ret));
- usleep(10000);
- count++;
- if (VC_RETRY_COUNT == count) {
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to request");
- break;
- }
- }
- } else {
- SLOG(LOG_DEBUG, TAG_VCC, "[SUCCESS] start interrupt");
- }
- }
-
- SLOG(LOG_DEBUG, TAG_VCC, "@@@");
-
- return ret;
-}
-
-int vc_request_stop(void)
-{
- SLOG(LOG_DEBUG, TAG_VCC, "@@@ [Client] Request stop");
-
- vc_state_e state;
- if (0 != vc_client_get_client_state(g_vc, &state)) {
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] A handle is not available");
- SLOG(LOG_DEBUG, TAG_VCC, "@@@");
- return VC_ERROR_INVALID_STATE;
- }
-
- /* check state */
- if (state != VC_STATE_READY) {
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Invalid State: client state is not 'Ready'");
- SLOG(LOG_DEBUG, TAG_VCC, "@@@");
- return VC_ERROR_INVALID_STATE;
- }
-
- /* Check service state */
- vc_service_state_e service_state = -1;
- vc_client_get_service_state(g_vc, &service_state);
- if (service_state != VC_SERVICE_STATE_RECORDING) {
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Invalid State: service state is not 'RECORDING'");
- SLOG(LOG_DEBUG, TAG_VCC, "@@@");
- return VC_ERROR_INVALID_STATE;
- }
-
- int ret = -1;
- int count = 0;
- /* do request */
- while (0 != ret) {
- ret = vc_dbus_request_stop(g_vc->handle);
- if (0 != ret) {
- if (VC_ERROR_TIMED_OUT != ret) {
- SLOG(LOG_DEBUG, TAG_VCC, "[ERROR] Fail to stop request : %s", __vc_get_error_code(ret));
- break;
- } else {
- SLOG(LOG_WARN, TAG_VCC, "[WARNING] retry stop request : %s", __vc_get_error_code(ret));
- usleep(10000);
- count++;
- if (VC_RETRY_COUNT == count) {
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to request");
- break;
- }
- }
- } else {
- SLOG(LOG_DEBUG, TAG_VCC, "[SUCCESS] Stop interrupt");
- }
- }
-
- SLOG(LOG_DEBUG, TAG_VCC, "@@@");
-
- return ret;
-}
-
-int vc_request_cancel(void)
-{
- SLOG(LOG_DEBUG, TAG_VCC, "@@@ [Client] Request cancel Interrupt");
-
- vc_state_e state;
- if (0 != vc_client_get_client_state(g_vc, &state)) {
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] A handle is not available");
- SLOG(LOG_DEBUG, TAG_VCC, "@@@");
- return VC_ERROR_INVALID_STATE;
- }
-
- /* check state */
- if (state != VC_STATE_READY) {
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Invalid State: Current state is not 'Ready'");
- SLOG(LOG_DEBUG, TAG_VCC, "@@@");
- return VC_ERROR_INVALID_STATE;
- }
-
- /* Check service state */
- vc_service_state_e service_state = -1;
- vc_client_get_service_state(g_vc, &service_state);
- if (service_state != VC_SERVICE_STATE_RECORDING && service_state != VC_SERVICE_STATE_PROCESSING) {
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Invalid State: service state is not 'RECORDING' or 'PROCESSING'");
- SLOG(LOG_DEBUG, TAG_VCC, "@@@");
- return VC_ERROR_INVALID_STATE;
- }
-
- int ret = -1;
- int count = 0;
- while (0 != ret) {
- ret = vc_dbus_request_cancel(g_vc->handle);
- if (0 != ret) {
- if (VC_ERROR_TIMED_OUT != ret) {
- SLOG(LOG_DEBUG, TAG_VCC, "[ERROR] Fail to cancel request : %s", __vc_get_error_code(ret));
- break;
- } else {
- SLOG(LOG_WARN, TAG_VCC, "[WARNING] retry cancel request : %s", __vc_get_error_code(ret));
- usleep(10000);
- count++;
- if (VC_RETRY_COUNT == count) {
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to request");
- break;
- }
- }
- } else {
- SLOG(LOG_DEBUG, TAG_VCC, "[SUCCESS] Cancel interrupt");
- }
- }
-
- SLOG(LOG_DEBUG, TAG_VCC, "@@@");
-
- return ret;
-}
-#endif
-
static void __vc_notify_error(void *data)
{
vc_error_cb callback = NULL;
void __vc_cb_result(void)
{
ecore_timer_add(0, __vc_notify_result, NULL);
-
- return;
}
//LCOV_EXCL_STOP
RETVM_IF(NULL == callback, VC_ERROR_INVALID_PARAMETER, TAG_VCC, "[ERROR] Client result callback is NULL");
-
SLOG(LOG_DEBUG, TAG_VCC, "@@@ [Client] Get result");
char* temp_text = NULL;
if (0 != vc_cmd_list_create(&vc_cmd_list)) {
SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to create command list"); //LCOV_EXCL_LINE
- return VC_ERROR_INVALID_PARAMETER;
+ return VC_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
}
ret = vc_info_parser_get_result(&temp_text, &event, NULL, getpid(), vc_cmd_list, false);
if (0 != ret || NULL == temp_text) {
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to get result, ret(%d) temp_text(%s)", ret, temp_text); //LCOV_EXCL_LINE
+ SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to get result, ret(%d) temp_text(%s)", ret, temp_text);
return ret;
}
+ //LCOV_EXCL_START
SLOG(LOG_DEBUG, TAG_VCC, "Result info : result text(%s) event(%d)", temp_text, event); //LCOV_EXCL_LINE
vc_cmd_print_list(vc_cmd_list);
SLOG(LOG_DEBUG, TAG_VCC, "@@@ [Client] Get result DONE");
return VC_ERROR_NONE;
+ //LCOV_EXCL_STOP
}
int vc_set_result_cb(vc_result_cb callback, void* user_data)
int __vc_cb_manager_pid(int manager_pid)
{
- SLOG(LOG_DEBUG, TAG_VCC, "Manager pid is changed : %d", manager_pid); //LCOV_EXCL_LINE
+ SLOG(LOG_DEBUG, TAG_VCC, "Manager pid is changed : %d", manager_pid);
/* Save service state */
vc_client_set_mgr_pid(manager_pid);
if (VC_ERROR_NONE != ret)
return ret;
- vc_state_e state;
SLOG(LOG_DEBUG, TAG_VCC, "@@@ Set invocation name");
- ret = vc_client_get_client_state(&state);
- if (0 != ret) {
+ vc_state_e state;
+ if (0 != vc_client_get_client_state(&state)) {
SLOG(LOG_ERROR, TAG_VCC, "[ERROR] A handle is not valid");
- return ret;
+ return VC_ERROR_INVALID_STATE;
}
/* check state */
return ret;
}
+//LCOV_EXCL_STOP
int vc_tts_request(const char* text, const char* language, bool to_vc_manager, int* utt_id)
{
do {
ret = vc_tidl_request_request_tts(pid, text, language, to_vc_manager, utt_id);
if (0 != ret) {
+ //LCOV_EXCL_START
if (VC_ERROR_INVALID_PARAMETER == ret && false == is_prepared) {
vc_client_set_client_state(VC_STATE_INITIALIZED);
if (0 == vc_prepare_sync()) {
break;
}
}
+ //LCOV_EXCL_STOP
}
} while (0 != ret);
do {
ret = vc_tidl_request_cancel_tts(pid, utt_id);
if (0 != ret) {
+ //LCOV_EXCL_START
if (VC_ERROR_INVALID_PARAMETER == ret && false == is_prepared) {
vc_client_set_client_state(VC_STATE_INITIALIZED);
if (0 == vc_prepare_sync()) {
break;
}
}
+ //LCOV_EXCL_STOP
}
} while (0 != ret);
return ret;
}
+//LCOV_EXCL_START
int vc_tts_get_synthesized_audio_details(int* rate, vc_audio_channel_e* channel, vc_audio_type_e* audio_type)
{
vc_state_e state;
static Eina_Bool __vc_mgr_notify_state_changed(void *data);
+//LCOV_EXCL_START
static const char* __vc_mgr_get_error_code(vc_error_e err)
{
switch (err) {
}
return NULL;
}
+//LCOV_EXCL_STOP
static void __vc_mgr_lang_changed_cb(const char* previous_lang, const char* current_lang)
{
} else {
SLOG(LOG_WARN, TAG_VCM, "[WARNING] Language changed callback is null");
}
-
- return;
}
static int __vc_mgr_get_feature_enabled()
{
if (0 == g_feature_enabled) {
+ //LCOV_EXCL_START
SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Voice control feature NOT supported");
return VC_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
} else if (-1 == g_feature_enabled) {
- bool vc_supported = false;
+ bool vc_mgr_supported = false;
bool mic_supported = false;
- if (0 == system_info_get_platform_bool(VC_MGR_FEATURE_PATH, &vc_supported)) {
- if (0 == system_info_get_platform_bool(VC_MIC_FEATURE_PATH, &mic_supported)) {
- if (false == vc_supported || false == mic_supported) {
- SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Voice control feature NOT supported");
- g_feature_enabled = 0;
- return VC_ERROR_NOT_SUPPORTED;
- }
+ if (SYSTEM_INFO_ERROR_NONE != system_info_get_platform_bool(VC_MGR_FEATURE_PATH, &vc_mgr_supported)) {
+ //LCOV_EXCL_START
+ SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Fail to get feature value");
+ return VC_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
+ }
- g_feature_enabled = 1;
- }
+ if (SYSTEM_INFO_ERROR_NONE != system_info_get_platform_bool(VC_MIC_FEATURE_PATH, &mic_supported)) {
+ //LCOV_EXCL_START
+ SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Fail to get feature value");
+ return VC_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
+ }
+
+ if (false == vc_mgr_supported || false == mic_supported) {
+ //LCOV_EXCL_START
+ SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Voice control feature NOT supported");
+ g_feature_enabled = 0;
+ return VC_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
}
+
+ g_feature_enabled = 1;
}
return VC_ERROR_NONE;
{
int ret = cynara_initialize(&p_cynara, NULL);
if (NULL == p_cynara || CYNARA_API_SUCCESS != ret) {
- SLOG(LOG_ERROR, TAG_VCM, "[ERROR] fail to initialize(%d)", ret);
+ SLOG(LOG_ERROR, TAG_VCM, "[ERROR] fail to initialize(%d)", ret); //LCOV_EXCL_LINE
return ret;
}
pid_t pid = getpid();
char *session = cynara_session_from_pid(pid);
int ret = cynara_check(p_cynara, smack_label, session, uid, privilege);
- if (session)
- free(session);
+ free(session);
session = NULL;
if (ret != CYNARA_API_ACCESS_ALLOWED) {
bool ret = true;
ret = __check_privilege_initialize();
if (false == ret) {
+ //LCOV_EXCL_START
SLOG(LOG_ERROR, TAG_VCM, "[ERROR] privilege initialize is failed");
g_privilege_allowed = false;
pthread_mutex_unlock(&g_cynara_mutex);
return VC_ERROR_PERMISSION_DENIED;
+ //LCOV_EXCL_STOP
}
char uid[32];
ret = true;
ret = __check_privilege(uid, VC_PRIVILEGE_RECORDER);
if (false == ret) {
+ //LCOV_EXCL_START
SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Permission is denied(%s)(%s)", VC_PRIVILEGE_RECORDER, uid);
__check_privilege_deinitialize();
g_privilege_allowed = false;
pthread_mutex_unlock(&g_cynara_mutex);
return VC_ERROR_PERMISSION_DENIED;
+ //LCOV_EXCL_STOP
}
ret = __check_privilege(uid, VC_MGR_PRIVILEGE);
if (false == ret) {
+ //LCOV_EXCL_START
SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Permission is denied(%s)(%s)", VC_MGR_PRIVILEGE, uid);
__check_privilege_deinitialize();
g_privilege_allowed = false;
pthread_mutex_unlock(&g_cynara_mutex);
return VC_ERROR_PERMISSION_DENIED;
+ //LCOV_EXCL_STOP
}
__check_privilege_deinitialize();
}
vc_mgr_client_set_internal_state(VC_INTERNAL_STATE_NONE);
- return;
}
int vc_mgr_deinitialize(void)
return VC_ERROR_NONE;
}
+//LCOV_EXCL_START
static void __notify_error(void *data)
{
vc_mgr_core_notify_error();
}
+//LCOV_EXCL_STOP
static Eina_Bool __request_initialize(void *data)
{
ret = vc_mgr_tidl_request_initialize(g_pid, (int)streaming_mode, &service_state, &foreground, &g_daemon_pid);
if (VC_ERROR_ENGINE_NOT_FOUND == ret) {
+ //LCOV_EXCL_START
SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Fail to initialize : %s", __vc_mgr_get_error_code(ret));
vc_mgr_client_set_error(VC_ERROR_ENGINE_NOT_FOUND);
SLOG(LOG_DEBUG, TAG_VCM, "@@@");
g_request_init_timer = NULL;
return EINA_FALSE;
+ //LCOV_EXCL_STOP
} else if (0 != ret) {
SLOG(LOG_ERROR, TAG_VCM, "[WARNING] Fail to connection. Retry to connect : %s", __vc_mgr_get_error_code(ret));
case VC_STATE_NONE: SLOG(LOG_INFO, TAG_VCM, "Current state is 'None'"); break;
case VC_STATE_INITIALIZED: SLOG(LOG_INFO, TAG_VCM, "Current state is 'Created'"); break;
case VC_STATE_READY: SLOG(LOG_INFO, TAG_VCM, "Current state is 'Ready'"); break;
- default: SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Invalid state");
+ default: SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Invalid state"); //LCOV_EXCL_LINE
}
SLOG(LOG_DEBUG, TAG_VCM, "@@@ [Manager] Get State DONE");
case VC_SERVICE_STATE_READY: SLOG(LOG_DEBUG, TAG_VCM, "Current service state is 'Ready'"); break;
case VC_SERVICE_STATE_RECORDING: SLOG(LOG_DEBUG, TAG_VCM, "Current service state is 'Recording'"); break;
case VC_SERVICE_STATE_PROCESSING: SLOG(LOG_DEBUG, TAG_VCM, "Current service state is 'Processing'"); break;
- default: SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Invalid state");
+ default: SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Invalid state"); //LCOV_EXCL_LINE
}
SLOG(LOG_DEBUG, TAG_VCM, "@@@ [Manager] Get Service State DONE");
vc_cmd_list_h temp_list = NULL;
if (0 != vc_cmd_list_create(&temp_list)) {
SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Fail to create list");
- return VC_ERROR_INVALID_PARAMETER;
+ return VC_ERROR_OUT_OF_MEMORY;
}
*vc_cmd_list = temp_list;
return VC_ERROR_NONE;
}
+ //LCOV_EXCL_START
if (VC_NO_FOREGROUND_PID != fg_pid) {
iter = g_slist_nth(client_info_list, 0);
while (NULL != iter) {
while (NULL != iter) {
client_info = iter->data;
- if (NULL != client_info) {
- free(client_info);
- }
+ free(client_info);
client_info_list = g_slist_remove_link(client_info_list, iter);
iter = g_slist_nth(client_info_list, 0);
}
// TODO: check return value correct or not
return VC_ERROR_NONE;
+ //LCOV_EXCL_STOP
}
int vc_mgr_set_recognition_mode(vc_recognition_mode_e mode)
/* Check internal state for async */
vc_internal_state_e internal_state = -1;
vc_mgr_client_get_internal_state(&internal_state);
- if (VC_INTERNAL_STATE_STARTING == internal_state) {
- SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Invalid State : Internal state is STARTING");
- return VC_ERROR_IN_PROGRESS_TO_RECORDING;
- } else if (VC_INTERNAL_STATE_STOPPING == internal_state) {
+ if (VC_INTERNAL_STATE_STOPPING == internal_state) {
SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Invalid State : Internal state is STOPPING");
return VC_ERROR_IN_PROGRESS_TO_PROCESSING;
} else if (VC_INTERNAL_STATE_CANCELING == internal_state) {
return VC_ERROR_NONE;
}
+//LCOV_EXCL_START
static void __tts_feedback_thread(void* data, Ecore_Thread* thread)
{
SLOG(LOG_INFO, TAG_VCM, "[SUCCESS] Start thread");
SLOG(LOG_INFO, TAG_VCM, "[SUCCESS] Cancel thread");
g_feedback_thread = NULL;
}
+//LCOV_EXCL_STOP
int vc_mgr_start_feedback(void)
{
return VC_ERROR_NONE;
}
+//LCOV_EXCL_START
//TODO it's internal api, so will remove it.
int vc_mgr_change_system_volume(vc_system_volume_event_e event)
{
{
return vc_mgr_reset_background_volume();
}
+//LCOV_EXCL_STOP
int vc_mgr_change_background_volume(vc_background_volume_event_e event)
{
return VC_ERROR_INVALID_STATE;
}
- if (state != VC_STATE_READY && state != VC_STATE_INITIALIZED) {
- SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Invalid State: Current state is not 'READY' and not 'INITIALIZED', state(%d)", state);
- return VC_ERROR_INVALID_STATE;
- }
-
double ratio = 0.0;
if (VC_BACKGROUND_VOLUME_EVENT_CHANGE_FOR_FARFIELD == event)
ratio = VC_MGR_DEFAULT_FARFIELD_DUCKING_RATIO;
return VC_ERROR_INVALID_STATE;
}
- if (state != VC_STATE_READY && state != VC_STATE_INITIALIZED) {
- SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Invalid State: Current state is not 'READY' and not 'INITIALIZED', state(%d)", state);
- return VC_ERROR_INVALID_STATE;
- }
-
ret = vc_mgr_ducking_activate(ratio);
if (VC_ERROR_NONE != ret)
SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Fail to set ratio");
return VC_ERROR_INVALID_STATE;
}
- if (state != VC_STATE_READY && state != VC_STATE_INITIALIZED) {
- SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Invalid State: Current state is not 'READY' and not 'INITIALIZED', state(%d)", state);
- return VC_ERROR_INVALID_STATE;
- }
-
ret = vc_mgr_ducking_deactivate();
if (VC_ERROR_NONE != ret)
SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Fail to recover volume");