const char* stt_tag()
{
+ //LCOV_EXCL_START
return "sttc";
+ //LCOV_EXCL_STOP
}
static int __stt_get_feature_enabled()
{
if (0 == g_feature_enabled) {
+ //LCOV_EXCL_START
SLOG(LOG_ERROR, TAG_STTC, "[ERROR] STT NOT supported");
return STT_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
} else if (-1 == g_feature_enabled) {
bool stt_supported = false;
bool mic_supported = false;
if (0 == system_info_get_platform_bool(STT_FEATURE_PATH, &stt_supported)) {
if (0 == system_info_get_platform_bool(STT_MIC_FEATURE_PATH, &mic_supported)) {
if (false == stt_supported || false == mic_supported) {
+ //LCOV_EXCL_START
SLOG(LOG_ERROR, TAG_STTC, "[ERROR] STT NOT supported");
g_feature_enabled = 0;
return STT_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
}
g_feature_enabled = 1;
} else {
+ //LCOV_EXCL_START
SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to get feature value");
return STT_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
}
} else {
+ //LCOV_EXCL_START
SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to get feature value");
return STT_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
}
}
{
int ret = cynara_initialize(&p_cynara, NULL);
if (CYNARA_API_SUCCESS != ret)
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] fail to initialize");
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] fail to initialize"); //LCOV_EXCL_LINE
return ret == CYNARA_API_SUCCESS;
}
char smack_label[1024] = {'\0',};
if (!p_cynara) {
- return false;
+ return false;
}
fp = fopen(label_path, "r");
if (fp != NULL) {
- if (fread(smack_label, 1, sizeof(smack_label), fp) <= 0)
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] fail to fread");
+ if (0 >= fread(smack_label, 1, sizeof(smack_label), fp))
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] fail to fread"); //LCOV_EXCL_LINE
- fclose(fp);
+ fclose(fp);
}
pid_t pid = getpid();
}
if (ret != CYNARA_API_ACCESS_ALLOWED)
- return false;
+ return false;
return true;
}
char uid[16];
if (0 == g_privilege_allowed) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Permission is denied");
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Permission is denied"); //LCOV_EXCL_LINE
return STT_ERROR_PERMISSION_DENIED;
} else if (-1 == g_privilege_allowed) {
if (false == __check_privilege_initialize()) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] privilege initialize is failed");
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] privilege initialize is failed"); //LCOV_EXCL_LINE
return STT_ERROR_PERMISSION_DENIED;
}
snprintf(uid, 16, "%d", getuid());
if (false == __check_privilege(uid, STT_PRIVILEGE_RECORDER)) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Permission is denied");
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Permission is denied"); //LCOV_EXCL_LINE
g_privilege_allowed = 0;
__check_privilege_deinitialize();
return STT_ERROR_PERMISSION_DENIED;
char uid[16];
if (0 == g_privilege_applaunch_allowed) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Permission for applaunch is denied");
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Permission for applaunch is denied"); //LCOV_EXCL_LINE
return STT_ERROR_PERMISSION_DENIED;
} else if (-1 == g_privilege_applaunch_allowed) {
if (false == __check_privilege_initialize()) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] privilege initialize is failed (applaunch)");
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] privilege initialize is failed (applaunch)"); //LCOV_EXCL_LINE
return STT_ERROR_PERMISSION_DENIED;
}
snprintf(uid, 16, "%d", getuid());
if (false == __check_privilege(uid, STT_PRIVILEGE_APPLAUNCH)) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Permission is denied : appmanager.launch");
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Permission is denied : appmanager.launch"); //LCOV_EXCL_LINE
g_privilege_applaunch_allowed = 0;
__check_privilege_deinitialize();
return STT_ERROR_PERMISSION_DENIED;
static const char* __stt_get_error_code(stt_error_e err)
{
+ //LCOV_EXCL_START
switch (err) {
case STT_ERROR_NONE: return "STT_ERROR_NONE";
case STT_ERROR_OUT_OF_MEMORY: return "STT_ERROR_OUT_OF_MEMORY";
default:
return "Invalid error code";
}
+ //LCOV_EXCL_STOP
}
static int __stt_convert_config_error_code(stt_config_error_e code)
{
+ //LCOV_EXCL_START
if (code == STT_CONFIG_ERROR_NONE) return STT_ERROR_NONE;
if (code == STT_CONFIG_ERROR_OUT_OF_MEMORY) return STT_ERROR_OUT_OF_MEMORY;
if (code == STT_CONFIG_ERROR_IO_ERROR) return STT_ERROR_IO_ERROR;
if (code == STT_CONFIG_ERROR_OPERATION_FAILED) return STT_ERROR_OPERATION_FAILED;
return code;
+ //LCOV_EXCL_STOP
}
void __stt_config_lang_changed_cb(const char* before_language, const char* current_language, void* user_data)
if (NULL == client->current_engine_id) {
if (STT_STATE_RECORDING == client->current_state || STT_STATE_PROCESSING == client->current_state) {
+ SLOG(LOG_INFO, TAG_STTC, "[INFO] stt cancel is invoked by engine_changed_cb, state(%d)", client->current_state);
ret = stt_cancel(stt);
if (0 != ret) {
- SLOG(LOG_DEBUG, TAG_STTC, "[DEBUG] STT client canceling...");
+ SLOG(LOG_DEBUG, TAG_STTC, "[DEBUG] STT client cancelling...");
}
ecore_idler_add(__reconnect_by_engine_changed, (void*)stt);
return STT_ERROR_PERMISSION_DENIED;
}
- SLOG(LOG_DEBUG, TAG_STTC, "===== Create STT");
+ SLOG(LOG_INFO, TAG_STTC, "===== Create STT");
if (NULL == stt) {
SLOG(LOG_ERROR, TAG_STTC, "[ERROR] A handle is null");
if (0 == stt_client_get_size()) {
if (0 != stt_dbus_open_connection()) {
+ //LCOV_EXCL_START
SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to open connection");
return STT_ERROR_OPERATION_FAILED;
+ //LCOV_EXCL_STOP
}
}
if (0 != stt_client_new(stt)) {
+ //LCOV_EXCL_START
SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to create client!");
return STT_ERROR_OUT_OF_MEMORY;
+ //LCOV_EXCL_STOP
}
stt_client_s* client = stt_client_get(*stt);
if (NULL == client) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to create client");
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to create client"); //LCOV_EXCL_LINE
stt_client_destroy(*stt);
return STT_ERROR_OPERATION_FAILED;
}
int ret = stt_config_mgr_initialize(client->uid);
ret = __stt_convert_config_error_code(ret);
if (0 != ret) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to init config manager : %s", __stt_get_error_code(ret));
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to init config manager : %s", __stt_get_error_code(ret)); //LCOV_EXCL_LINE
stt_client_destroy(*stt);
return ret;
}
ret = stt_config_mgr_set_callback(client->uid, __stt_config_engine_changed_cb, __stt_config_lang_changed_cb, NULL, client->stt);
ret = __stt_convert_config_error_code(ret);
if (0 != ret) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to set config changed : %s", __stt_get_error_code(ret));
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to set config changed : %s", __stt_get_error_code(ret)); //LCOV_EXCL_LINE
stt_client_destroy(*stt);
return ret;
}
- SLOG(LOG_DEBUG, TAG_STTC, "[Success] uid(%d)", (*stt)->handle);
+ SLOG(LOG_INFO, TAG_STTC, "[Success] uid(%d)", (*stt)->handle);
SLOG(LOG_DEBUG, TAG_STTC, "=====");
SLOG(LOG_DEBUG, TAG_STTC, " ");
return STT_ERROR_INVALID_PARAMETER;
}
- SLOG(LOG_DEBUG, TAG_STTC, "===== Destroy STT");
+ SLOG(LOG_INFO, TAG_STTC, "===== Destroy STT");
/* check used callback */
if (0 != stt_client_get_use_callback(client)) {
case STT_STATE_READY:
ret = stt_dbus_request_finalize(client->uid);
if (0 != ret) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to request finalize : %s", __stt_get_error_code(ret));
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to request finalize : %s", __stt_get_error_code(ret)); //LCOV_EXCL_LINE
}
case STT_STATE_CREATED:
if (NULL != g_connect_timer) {
if (0 == stt_client_get_size()) {
if (0 != stt_dbus_close_connection()) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to close connection");
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to close connection"); //LCOV_EXCL_LINE
}
}
stt = NULL;
- SLOG(LOG_DEBUG, TAG_STTC, "=====");
+ SLOG(LOG_INFO, TAG_STTC, "=====");
SLOG(LOG_DEBUG, TAG_STTC, " ");
return STT_ERROR_NONE;
stt_client_s* client = stt_client_get(stt);
if (NULL == client) {
+ //LCOV_EXCL_START
SLOG(LOG_ERROR, TAG_STTC, "[WARNING] A handle is not valid");
return false;
+ //LCOV_EXCL_STOP
}
/* call callback function */
if (NULL != client->supported_engine_cb) {
return client->supported_engine_cb(stt, engine_id, engine_name, client->supported_engine_user_data);
} else {
- SLOG(LOG_WARN, TAG_STTC, "No registered callback function of supported engine");
+ SLOG(LOG_WARN, TAG_STTC, "No registered callback function of supported engine"); //LCOV_EXCL_LINE
}
return false;
return STT_ERROR_INVALID_PARAMETER;
}
- SLOG(LOG_DEBUG, TAG_STTC, "===== Foreach Supported engine");
+ SLOG(LOG_INFO, TAG_STTC, "===== Foreach Supported engine");
if (NULL == callback) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Input parameter is NULL");
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Input parameter is NULL"); //LCOV_EXCL_LINE
return STT_ERROR_INVALID_PARAMETER;
}
ret = stt_config_mgr_get_engine_list(__stt_config_supported_engine_cb, client->stt);
ret = __stt_convert_config_error_code(ret);
if (0 != ret) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to get engines : %s", __stt_get_error_code(ret));
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to get engines : %s", __stt_get_error_code(ret)); //LCOV_EXCL_LINE
}
client->supported_engine_cb = NULL;
client->supported_engine_user_data = NULL;
- SLOG(LOG_DEBUG, TAG_STTC, "=====");
+ SLOG(LOG_INFO, TAG_STTC, "=====");
SLOG(LOG_DEBUG, TAG_STTC, " ");
return ret;
return STT_ERROR_INVALID_PARAMETER;
}
- SLOG(LOG_DEBUG, TAG_STTC, "===== Get current engine");
+ SLOG(LOG_INFO, TAG_STTC, "===== Get current engine");
if (NULL == engine_id) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Input parameter is NULL");
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Input parameter is NULL"); //LCOV_EXCL_LINE
return STT_ERROR_INVALID_PARAMETER;
}
ret = stt_config_mgr_get_engine(engine_id);
ret = __stt_convert_config_error_code(ret);
if (0 != ret) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to request get current engine : %s", __stt_get_error_code(ret));
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to request get current engine : %s", __stt_get_error_code(ret)); //LCOV_EXCL_LINE
} else {
SLOG(LOG_DEBUG, TAG_STTC, "[SUCCESS] Current engine uuid = %s", *engine_id);
}
}
- SLOG(LOG_DEBUG, TAG_STTC, "=====");
+ SLOG(LOG_INFO, TAG_STTC, "=====");
SLOG(LOG_DEBUG, TAG_STTC, " ");
return ret;
int ret = buxton_open(&bux_cli, NULL, NULL);
if (0 != ret) {
- SLOG(LOG_ERROR, stt_tag(), "[DBUS-BUXTON2] Fail to open buxton client");
+ SLOG(LOG_ERROR, stt_tag(), "[DBUS-BUXTON2] Fail to open buxton client"); //LCOV_EXCL_LINE
return STT_ERROR_OPERATION_FAILED;
}
SLOG(LOG_DEBUG, stt_tag(), "[DBUS-BUXTON2] buxton_open: %d", ret);
bux_layer = buxton_create_layer("system");
if (NULL == bux_layer) {
+ //LCOV_EXCL_START
SLOG(LOG_ERROR, stt_tag(), "[DBUS-BUXTON2] buxton_create_layer FAIL");
buxton_close(bux_cli);
bux_cli = NULL;
return STT_ERROR_OPERATION_FAILED;
+ //LCOV_EXCL_STOP
}
bux_val = buxton_value_create_string(engine_id);
if (NULL == bux_val) {
+ //LCOV_EXCL_START
SLOG(LOG_ERROR, stt_tag(), "[DBUS-BUXTON2] buxton_value_create_string FAIL");
buxton_free_layer(bux_layer);
buxton_close(bux_cli);
bux_layer = NULL;
bux_cli = NULL;
return STT_ERROR_OPERATION_FAILED;
+ //LCOV_EXCL_STOP
}
ret = buxton_set_value_sync(bux_cli, bux_layer, STT_ENGINE_DB_CUSTOM, bux_val);
if (0 != ret) {
+ //LCOV_EXCL_START
SLOG(LOG_ERROR, stt_tag(), "[DBUS-BUXTON2] Fail to set value sync");
buxton_value_free(bux_val);
buxton_free_layer(bux_layer);
bux_layer = NULL;
bux_val = NULL;
return STT_ERROR_OPERATION_FAILED;
+ //LCOV_EXCL_STOP
}
SLOG(LOG_DEBUG, stt_tag(), "[DBUS-BUXTON2] buxton_set_value_sync: %d, %s", ret, STT_ENGINE_DB_CUSTOM);
return STT_ERROR_INVALID_PARAMETER;
}
- SLOG(LOG_DEBUG, TAG_STTC, "===== Set current engine");
+ SLOG(LOG_INFO, TAG_STTC, "===== Set current engine");
if (NULL == engine_id) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Input parameter is NULL");
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Input parameter is NULL"); //LCOV_EXCL_LINE
return STT_ERROR_INVALID_PARAMETER;
}
client->current_engine_id = NULL;
}
- SLOG(LOG_DEBUG, TAG_STTC, "===== engined_id(%s)", engine_id);
+ SLOG(LOG_INFO, TAG_STTC, "===== engined_id(%s)", engine_id);
client->current_engine_id = strdup(engine_id);
/* Set vconfkey */
int ret = __stt_set_buxtonkey(engine_id);
if (0 != ret) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] set buxtonkey Failed!!!");
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] set buxtonkey Failed!!!"); //LCOV_EXCL_LINE
return ret;
}
- SLOG(LOG_DEBUG, TAG_STTC, "=====");
+ SLOG(LOG_INFO, TAG_STTC, "=====");
SLOG(LOG_DEBUG, TAG_STTC, " ");
return 0;
return STT_ERROR_INVALID_PARAMETER;
}
- SLOG(LOG_DEBUG, TAG_STTC, "===== Set credential");
+ SLOG(LOG_INFO, TAG_STTC, "===== Set credential");
if (NULL == credential) {
SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Input parameter is NULL");
/* check state */
if (client->current_state != STT_STATE_CREATED && client->current_state != STT_STATE_READY) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid State: Current state(%d) is not CREATED or READY", client->current_state);
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid State: Current state(%d) is not CREATED or READY", client->current_state); //LCOV_EXCL_LINE
return STT_ERROR_INVALID_STATE;
}
}
client->credential = strdup(credential);
- SLOG(LOG_DEBUG, TAG_STTC, "=====");
+ SLOG(LOG_INFO, TAG_STTC, "=====");
SLOG(LOG_DEBUG, TAG_STTC, " ");
return STT_ERROR_NONE;
return STT_ERROR_INVALID_PARAMETER;
}
- SLOG(LOG_DEBUG, TAG_STTC, "===== Set private data");
+ SLOG(LOG_INFO, TAG_STTC, "===== Set private data");
if (NULL == key || NULL == data) {
SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid parameter");
}
if (true != client->internal && (0 == strcmp(key, "server") || 0 == strcmp(key, "rampcode") || 0 == strcmp(key, "epd"))) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] This is not an internal app");
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] This is not an internal app"); //LCOV_EXCL_LINE
return STT_ERROR_INVALID_PARAMETER;
}
while (0 != ret) {
ret = stt_dbus_request_set_private_data(client->uid, key, data);
if (0 != ret) {
+ //LCOV_EXCL_START
if (STT_ERROR_TIMED_OUT != ret) {
SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to set private data : %s", __stt_get_error_code(ret));
return ret;
return ret;
}
}
+ //LCOV_EXCL_STOP
}
}
- SLOG(LOG_DEBUG, TAG_STTC, "=====");
+ SLOG(LOG_INFO, TAG_STTC, "=====");
SLOG(LOG_DEBUG, TAG_STTC, "");
return STT_ERROR_NONE;
return STT_ERROR_INVALID_PARAMETER;
}
- SLOG(LOG_DEBUG, TAG_STTC, "===== Get private data");
+ SLOG(LOG_INFO, TAG_STTC, "===== Get private data");
if (NULL == key || NULL == data) {
SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid parameter");
while (0 != ret) {
ret = stt_dbus_request_get_private_data(client->uid, key, data);
if (0 != ret) {
+ //LCOV_EXCL_START
if (STT_ERROR_TIMED_OUT != ret) {
SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to get private data : %s", __stt_get_error_code(ret));
return ret;
return ret;
}
}
+ //LCOV_EXCL_STOP
}
}
*data = NULL;
}
- SLOG(LOG_DEBUG, TAG_STTC, "=====");
+ SLOG(LOG_INFO, TAG_STTC, "=====");
SLOG(LOG_DEBUG, TAG_STTC, "");
return STT_ERROR_NONE;
}
+//LCOV_EXCL_START
int stt_set_server_stt(stt_h stt, const char* key, char* user_data)
{
int ret = -1;
return STT_ERROR_INVALID_PARAMETER;
}
- SLOG(LOG_DEBUG, TAG_STTC, "===== Set STT server");
+ SLOG(LOG_INFO, TAG_STTC, "===== Set STT server");
if (NULL == key || NULL == user_data) {
SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid parameter");
free(private_key);
private_key = NULL;
- SLOG(LOG_DEBUG, TAG_STTC, "======");
+ SLOG(LOG_INFO, TAG_STTC, "======");
SLOG(LOG_DEBUG, TAG_STTC, " ");
return ret;
}
+//LCOV_EXCL_STOP
static Eina_Bool __stt_connect_daemon(void *data)
{
int ret = -1;
if (NULL == client) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] A handle is not available");
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] A handle is not available"); //LCOV_EXCL_LINE
g_connect_timer = NULL;
return EINA_FALSE;
}
if (0 == stt_client_get_size() || NULL == stt_client_get_by_uid(client->uid)) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Client has been already destroyed");
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Client has been already destroyed"); //LCOV_EXCL_LINE
return EINA_FALSE;
}
if (1 == g_privilege_applaunch_allowed && NULL != client->current_engine_id) {
/* Set vconfkey */
ret = __stt_set_buxtonkey(client->current_engine_id);
+ //LCOV_EXCL_START
if (0 != ret) {
SLOG(LOG_DEBUG, TAG_STTC, "[DEBUG] set buxtonkey Failed!!! (inside __stt_connect_daemon)");
return EINA_TRUE;
}
+ //LCOV_EXCL_STOP
}
/* Send hello */
}
g_connect_timer = NULL;
- SLOG(LOG_DEBUG, TAG_STTC, "===== Connect stt-service");
+ SLOG(LOG_INFO, TAG_STTC, "===== Connect stt-service");
/* request initialization */
bool silence_supported = false;
ret = stt_dbus_request_initialize(client->uid, &silence_supported, &credential_needed);
if (STT_ERROR_ENGINE_NOT_FOUND == ret) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to initialize : %s", __stt_get_error_code(ret));
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to initialize : %s", __stt_get_error_code(ret)); //LCOV_EXCL_LINE
client->reason = STT_ERROR_ENGINE_NOT_FOUND;
ecore_main_loop_thread_safe_call_async(__stt_notify_error, (void*)client);
return EINA_FALSE;
} else if (STT_ERROR_NONE != ret) {
- SLOG(LOG_ERROR, TAG_STTC, "[WARNING] Fail to connection. Retry to connect");
+ SLOG(LOG_ERROR, TAG_STTC, "[WARNING] Fail to connection. Retry to connect"); //LCOV_EXCL_LINE
return EINA_TRUE;
} else {
/* success to connect stt-service */
SLOG(LOG_DEBUG, TAG_STTC, "Supported options : silence(%s), credential(%s)", silence_supported ? "support" : "no support", credential_needed ? "need" : "no need");
}
+//LCOV_EXCL_START
#ifdef __UNUSED_CODES__
if (NULL != client->current_engine_id) {
ret = -1;
}
}
#endif
- SLOG(LOG_DEBUG, TAG_STTC, "[SUCCESS] uid(%d)", client->uid);
+//LCOV_EXCL_STOP
+ SLOG(LOG_INFO, TAG_STTC, "[SUCCESS] uid(%d)", client->uid);
client->before_state = client->current_state;
client->current_state = STT_STATE_READY;
SLOG(LOG_WARN, TAG_STTC, "[WARNING] State changed callback is null");
}
- SLOG(LOG_DEBUG, TAG_STTC, "=====");
+ SLOG(LOG_INFO, TAG_STTC, "=====");
SLOG(LOG_DEBUG, TAG_STTC, " ");
return EINA_FALSE;
return STT_ERROR_INVALID_PARAMETER;
}
+ SLOG(LOG_INFO, TAG_STTC, "===== Prepare STT");
+
/* check state */
if (client->current_state != STT_STATE_CREATED) {
SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid State: Current state(%d) is not 'CREATED'", client->current_state);
return STT_ERROR_INVALID_STATE;
}
- g_connect_timer = ecore_timer_add(0, __stt_connect_daemon, (void*)client);
+ ecore_thread_main_loop_begin();
+ g_connect_timer = ecore_timer_add(0.02, __stt_connect_daemon, (void*)client);
+ ecore_thread_main_loop_end();
- SLOG(LOG_DEBUG, TAG_STTC, "=====");
+ SLOG(LOG_INFO, TAG_STTC, "=====");
SLOG(LOG_DEBUG, TAG_STTC, " ");
return STT_ERROR_NONE;
return STT_ERROR_INVALID_PARAMETER;
}
- SLOG(LOG_DEBUG, TAG_STTC, "===== Unprepare STT");
+ SLOG(LOG_INFO, TAG_STTC, "===== Unprepare STT");
/* check state */
if (client->current_state != STT_STATE_READY) {
while (0 != ret) {
ret = stt_dbus_request_finalize(client->uid);
if (0 != ret) {
+ //LCOV_EXCL_START
if (STT_ERROR_TIMED_OUT != ret) {
SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to request finalize : %s", __stt_get_error_code(ret));
break;
break;
}
}
+ //LCOV_EXCL_STOP
}
}
g_connect_timer = NULL;
}
- SLOG(LOG_DEBUG, TAG_STTC, "=====");
+ SLOG(LOG_INFO, TAG_STTC, "=====");
SLOG(LOG_DEBUG, TAG_STTC, " ");
return STT_ERROR_NONE;
stt_client_s* client = stt_client_get(stt);
if (NULL == client) {
- SLOG(LOG_ERROR, TAG_STTC, "[WARNING] A handle is not valid");
+ SLOG(LOG_ERROR, TAG_STTC, "[WARNING] A handle is not valid"); //LCOV_EXCL_LINE
return false;
}
+ SLOG(LOG_INFO, TAG_STTC, "===== supported language callback");
+
/* call callback function */
if (NULL != client->supported_lang_cb) {
return client->supported_lang_cb(stt, language, client->supported_lang_user_data);
} else {
- SLOG(LOG_WARN, TAG_STTC, "No registered callback function of supported languages");
+ SLOG(LOG_WARN, TAG_STTC, "No registered callback function of supported languages"); //LCOV_EXCL_LINE
}
return false;
return STT_ERROR_INVALID_PARAMETER;
}
- SLOG(LOG_DEBUG, TAG_STTC, "===== Foreach Supported Language");
+ SLOG(LOG_INFO, TAG_STTC, "===== Foreach Supported Language");
if (NULL == callback) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Input parameter is NULL");
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Input parameter is NULL"); //LCOV_EXCL_LINE
return STT_ERROR_INVALID_PARAMETER;
}
ret = stt_config_mgr_get_engine(¤t_engine_id);
ret = __stt_convert_config_error_code(ret);
if (0 != ret) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to get default engine id : %s", __stt_get_error_code(ret));
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to get default engine id : %s", __stt_get_error_code(ret)); //LCOV_EXCL_LINE
return ret;
}
} else {
current_engine_id = strdup(client->current_engine_id);
+ //LCOV_EXCL_START
if (NULL == current_engine_id) {
SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to allocate memory");
return STT_ERROR_OUT_OF_MEMORY;
}
+ //LCOV_EXCL_STOP
}
client->supported_lang_cb = callback;
ret = stt_config_mgr_get_language_list(current_engine_id, __stt_config_supported_language_cb, client->stt);
ret = __stt_convert_config_error_code(ret);
if (0 != ret) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to get languages : %s", __stt_get_error_code(ret));
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to get languages : %s", __stt_get_error_code(ret)); //LCOV_EXCL_LINE
}
if (NULL != current_engine_id) {
client->supported_lang_cb = NULL;
client->supported_lang_user_data = NULL;
- SLOG(LOG_DEBUG, TAG_STTC, "=====");
+ SLOG(LOG_INFO, TAG_STTC, "=====");
SLOG(LOG_DEBUG, TAG_STTC, " ");
return ret;
return STT_ERROR_INVALID_PARAMETER;
}
- SLOG(LOG_DEBUG, TAG_STTC, "===== Get Default Language");
+ SLOG(LOG_INFO, TAG_STTC, "===== Get Default Language");
if (NULL == language) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Input parameter is NULL");
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Input parameter is NULL"); //LCOV_EXCL_LINE
return STT_ERROR_INVALID_PARAMETER;
}
ret = stt_config_mgr_get_default_language(language);
ret = __stt_convert_config_error_code(ret);
if (0 != ret) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to get default language : %s", __stt_get_error_code(ret));
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to get default language : %s", __stt_get_error_code(ret)); //LCOV_EXCL_LINE
} else {
SLOG(LOG_DEBUG, TAG_STTC, "[SUCCESS] Current language = %s", *language);
}
- SLOG(LOG_DEBUG, TAG_STTC, "=====");
+ SLOG(LOG_INFO, TAG_STTC, "=====");
SLOG(LOG_DEBUG, TAG_STTC, " ");
return ret;
}
if (NULL == state) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Input parameter is NULL");
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Input parameter is NULL"); //LCOV_EXCL_LINE
return STT_ERROR_INVALID_PARAMETER;
}
*state = client->current_state;
+ SLOG(LOG_INFO, TAG_STTC, "===== Get state(%d)", *state);
+
switch (*state) {
case STT_STATE_CREATED: SLOG(LOG_DEBUG, TAG_STTC, "Current state is 'CREATED'"); break;
case STT_STATE_READY: SLOG(LOG_DEBUG, TAG_STTC, "Current state is 'Ready'"); break;
if (NULL != client->err_msg) {
*err_msg = strdup(client->err_msg);
- SLOG(LOG_DEBUG, TAG_STTC, "[SUCCESS] Error msg (%s)", *err_msg);
+ SLOG(LOG_INFO, TAG_STTC, "[SUCCESS] Error msg (%s)", *err_msg); //LCOV_EXCL_LINE
} else {
- SLOG(LOG_DEBUG, TAG_STTC, "[SUCCESS] Error msg (NULL)");
+ SLOG(LOG_INFO, TAG_STTC, "[SUCCESS] Error msg (NULL)"); //LCOV_EXCL_LINE
}
- SLOG(LOG_DEBUG, TAG_STTC, "=====");
- SLOG(LOG_DEBUG, TAG_STTC, " ");
+ SLOG(LOG_INFO, TAG_STTC, "====="); //LCOV_EXCL_LINE
+ SLOG(LOG_DEBUG, TAG_STTC, " "); //LCOV_EXCL_LINE
return STT_ERROR_NONE;
}
}
if (NULL == type || NULL == support) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Input parameter is NULL");
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Input parameter is NULL"); //LCOV_EXCL_LINE
return STT_ERROR_INVALID_PARAMETER;
}
while (0 != ret) {
ret = stt_dbus_request_is_recognition_type_supported(client->uid, type, support);
if (0 != ret) {
+ //LCOV_EXCL_START
if (STT_ERROR_TIMED_OUT != ret) {
SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to get recognition type supported : %s", __stt_get_error_code(ret));
return ret;
return ret;
}
}
+ //LCOV_EXCL_STOP
} else {
- SLOG(LOG_DEBUG, TAG_STTC, "[SUCCESS] recognition type is %s", *support ? "true " : "false");
+ SLOG(LOG_INFO, TAG_STTC, "[SUCCESS] recognition type is %s", *support ? "true " : "false");
break;
}
}
return STT_ERROR_INVALID_STATE;
}
+ SLOG(LOG_INFO, TAG_STTC, "===== Set silence detection, supported(%d), type(%d)", client->silence_supported, type);
+
if (true == client->silence_supported) {
if (type >= STT_OPTION_SILENCE_DETECTION_FALSE && type <= STT_OPTION_SILENCE_DETECTION_AUTO) {
client->silence = type;
return STT_ERROR_INVALID_PARAMETER;
}
- SLOG(LOG_DEBUG, TAG_STTC, "===== STT SET START SOUND");
+ SLOG(LOG_INFO, TAG_STTC, "===== STT SET START SOUND");
if (NULL == filename) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Input parameter is NULL");
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Input parameter is NULL"); //LCOV_EXCL_LINE
return STT_ERROR_INVALID_PARAMETER;
}
if (0 != access(filename, F_OK)) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] File does not exist");
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] File does not exist"); //LCOV_EXCL_LINE
return STT_ERROR_INVALID_PARAMETER;
}
/* check state */
if (client->current_state != STT_STATE_READY) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid State: Current state(%d) is not READY", client->current_state);
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid State: Current state(%d) is not READY", client->current_state); //LCOV_EXCL_LINE
return STT_ERROR_INVALID_STATE;
}
while (0 != ret) {
ret = stt_dbus_request_set_start_sound(client->uid, filename);
if (0 != ret) {
+ //LCOV_EXCL_START
if (STT_ERROR_TIMED_OUT != ret) {
SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to set start sound : %s", __stt_get_error_code(ret));
return ret;
return ret;
}
}
+ //LCOV_EXCL_STOP
} else {
- SLOG(LOG_DEBUG, TAG_STTC, "[SUCCESS] Set start sound : %s", filename);
+ SLOG(LOG_INFO, TAG_STTC, "[SUCCESS] Set start sound : %s", filename);
break;
}
}
return STT_ERROR_INVALID_PARAMETER;
}
- SLOG(LOG_DEBUG, TAG_STTC, "===== STT UNSET START SOUND");
+ SLOG(LOG_INFO, TAG_STTC, "===== STT UNSET START SOUND");
/* check state */
if (client->current_state != STT_STATE_READY) {
while (0 != ret) {
ret = stt_dbus_request_unset_start_sound(client->uid);
if (0 != ret) {
+ //LCOV_EXCL_START
if (STT_ERROR_TIMED_OUT != ret) {
SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to unset start sound : %s", __stt_get_error_code(ret));
return ret;
return ret;
}
}
+ //LCOV_EXCL_STOP
} else {
- SLOG(LOG_DEBUG, TAG_STTC, "[SUCCESS] Unset start sound");
+ SLOG(LOG_INFO, TAG_STTC, "[SUCCESS] Unset start sound");
break;
}
}
return STT_ERROR_INVALID_PARAMETER;
}
- SLOG(LOG_DEBUG, TAG_STTC, "===== STT SET STOP SOUND");
+ SLOG(LOG_INFO, TAG_STTC, "===== STT SET STOP SOUND");
if (NULL == filename) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Input parameter is NULL");
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Input parameter is NULL"); //LCOV_EXCL_LINE
return STT_ERROR_INVALID_PARAMETER;
}
if (0 != access(filename, F_OK)) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] File does not exist");
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] File does not exist"); //LCOV_EXCL_LINE
return STT_ERROR_INVALID_PARAMETER;
}
/* check state */
if (client->current_state != STT_STATE_READY) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid State: Current state(%d) is not READY", client->current_state);
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid State: Current state(%d) is not READY", client->current_state); //LCOV_EXCL_LINE
return STT_ERROR_INVALID_STATE;
}
while (0 != ret) {
ret = stt_dbus_request_set_stop_sound(client->uid, filename);
if (0 != ret) {
+ //LCOV_EXCL_START
if (STT_ERROR_TIMED_OUT != ret) {
SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to set stop sound : %s", __stt_get_error_code(ret));
return ret;
return ret;
}
}
+ //LCOV_EXCL_STOP
} else {
- SLOG(LOG_DEBUG, TAG_STTC, "[SUCCESS] Set stop sound : %s", filename);
+ SLOG(LOG_INFO, TAG_STTC, "[SUCCESS] Set stop sound : %s", filename);
break;
}
}
return STT_ERROR_INVALID_PARAMETER;
}
- SLOG(LOG_DEBUG, TAG_STTC, "===== STT UNSET STOP SOUND");
+ SLOG(LOG_INFO, TAG_STTC, "===== STT UNSET STOP SOUND");
/* check state */
if (client->current_state != STT_STATE_READY) {
while (0 != ret) {
ret = stt_dbus_request_unset_stop_sound(client->uid);
if (0 != ret) {
+ //LCOV_EXCL_START
if (STT_ERROR_TIMED_OUT != ret) {
SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to unset stop sound : %s", __stt_get_error_code(ret));
return ret;
return ret;
}
}
+ //LCOV_EXCL_STOP
} else {
- SLOG(LOG_DEBUG, TAG_STTC, "[SUCCESS] Unset stop sound");
+ SLOG(LOG_INFO, TAG_STTC, "[SUCCESS] Unset stop sound");
break;
}
}
return STT_ERROR_INVALID_PARAMETER;
}
- SLOG(LOG_DEBUG, TAG_STTC, "===== STT START");
+ SLOG(LOG_INFO, TAG_STTC, "===== STT START");
/* check state */
if (client->current_state != STT_STATE_READY) {
}
if (STT_INTERNAL_STATE_NONE != client->internal_state) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid State : Internal state is NOT none : %d", client->internal_state);
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid State : Internal state is NOT none : %d", client->internal_state); //LCOV_EXCL_LINE
return STT_ERROR_IN_PROGRESS_TO_RECORDING;
}
int ret = -1;
- char appid[128] = {0, };
- ret = aul_app_get_appid_bypid(getpid(), appid, sizeof(appid));
+ char appid[1024] = {0, };
+ ret = aul_app_get_appid_bypid(getpid(), appid, sizeof(appid) - 1);
if ((AUL_R_OK != ret) || (0 == strlen(appid))) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to get application ID");
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to get application ID"); //LCOV_EXCL_LINE
} else {
SLOG(LOG_DEBUG, TAG_STTC, "[DEBUG] Current app id is %s", appid);
}
}
if (true == client->credential_needed && NULL == client->credential) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Do not have app credential for this engine(%s)", client->current_engine_id);
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Do not have app credential for this engine(%s)", client->current_engine_id); //LCOV_EXCL_LINE
free(temp);
temp = NULL;
return STT_ERROR_PERMISSION_DENIED;
client->internal_state = STT_INTERNAL_STATE_STARTING;
ret = stt_dbus_request_start(client->uid, temp, type, client->silence, appid, client->credential);
if (0 != ret) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to start : %s", __stt_get_error_code(ret));
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to start : %s", __stt_get_error_code(ret)); //LCOV_EXCL_LINE
client->internal_state = STT_INTERNAL_STATE_NONE;
} else {
- SLOG(LOG_DEBUG, TAG_STTC, "[SUCCESS] Start is successful but not done");
+ SLOG(LOG_INFO, TAG_STTC, "[SUCCESS] Start is successful but not done");
}
free(temp);
temp = NULL;
- SLOG(LOG_DEBUG, TAG_STTC, "=====");
+ SLOG(LOG_INFO, TAG_STTC, "=====");
SLOG(LOG_DEBUG, TAG_STTC, " ");
return ret;
return STT_ERROR_INVALID_PARAMETER;
}
- SLOG(LOG_DEBUG, TAG_STTC, "===== STT STOP");
+ SLOG(LOG_INFO, TAG_STTC, "===== STT STOP");
/* check state */
if (client->current_state != STT_STATE_RECORDING) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid State : Current state(%d) is NOT RECORDING", client->current_state);
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid State : Current state(%d) is NOT RECORDING", client->current_state); //LCOV_EXCL_LINE
return STT_ERROR_INVALID_STATE;
}
if (STT_INTERNAL_STATE_STARTING == client->internal_state) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid State : Internal state is STARTING : %d", client->internal_state);
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid State : Internal state is STARTING : %d", client->internal_state); //LCOV_EXCL_LINE
return STT_ERROR_IN_PROGRESS_TO_RECORDING;
} else if (STT_INTERNAL_STATE_CANCELING == client->internal_state) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid State : Internal state is CANCELING : %d", client->internal_state);
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid State : Internal state is CANCELING : %d", client->internal_state); //LCOV_EXCL_LINE
return STT_ERROR_IN_PROGRESS_TO_READY;
} else if (STT_INTERNAL_STATE_STOPPING == client->internal_state) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid State : Internal state is STOPPING : %d", client->internal_state);
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid State : Internal state is STOPPING : %d", client->internal_state); //LCOV_EXCL_LINE
return STT_ERROR_IN_PROGRESS_TO_PROCESSING;
}
client->internal_state = STT_INTERNAL_STATE_STOPPING;
int ret = stt_dbus_request_stop(client->uid);
if (0 != ret) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to stop : %s", __stt_get_error_code(ret));
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to stop : %s", __stt_get_error_code(ret)); //LCOV_EXCL_LINE
client->internal_state = STT_INTERNAL_STATE_NONE;
} else {
- SLOG(LOG_DEBUG, TAG_STTC, "[SUCCESS] Stop is successful but not done");
+ SLOG(LOG_INFO, TAG_STTC, "[SUCCESS] Stop is successful but not done");
}
SLOG(LOG_DEBUG, TAG_STTC, "=====");
return STT_ERROR_INVALID_PARAMETER;
}
- SLOG(LOG_DEBUG, TAG_STTC, "===== STT CANCEL");
+ SLOG(LOG_INFO, TAG_STTC, "===== STT CANCEL");
/* check state */
if (STT_STATE_RECORDING != client->current_state && STT_STATE_PROCESSING != client->current_state) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid state : Current state(%d) is 'Ready'", client->current_state);
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid state : Current state(%d) is 'Ready'", client->current_state); //LCOV_EXCL_LINE
return STT_ERROR_INVALID_STATE;
}
if (STT_INTERNAL_STATE_STARTING == client->internal_state) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid State : Internal state is STARTING : %d", client->internal_state);
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid State : Internal state is STARTING : %d", client->internal_state); //LCOV_EXCL_LINE
return STT_ERROR_IN_PROGRESS_TO_RECORDING;
} else if (STT_INTERNAL_STATE_STOPPING == client->internal_state) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid State : Internal state is STOPPING : %d", client->internal_state);
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid State : Internal state is STOPPING : %d", client->internal_state); //LCOV_EXCL_LINE
return STT_ERROR_IN_PROGRESS_TO_PROCESSING;
} else if (STT_INTERNAL_STATE_CANCELING == client->internal_state) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid State : Internal state is CANCELING : %d", client->internal_state);
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid State : Internal state is CANCELING : %d", client->internal_state); //LCOV_EXCL_LINE
return STT_ERROR_IN_PROGRESS_TO_READY;
}
client->internal_state = STT_INTERNAL_STATE_CANCELING;
int ret = stt_dbus_request_cancel(client->uid);
if (0 != ret) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to cancel : %s", __stt_get_error_code(ret));
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to cancel : %s", __stt_get_error_code(ret)); //LCOV_EXCL_LINE
client->internal_state = STT_INTERNAL_STATE_NONE;
} else {
- SLOG(LOG_DEBUG, TAG_STTC, "[SUCCESS] Cancel is successful but not done");
+ SLOG(LOG_INFO, TAG_STTC, "[SUCCESS] Cancel is successful but not done");
}
SLOG(LOG_DEBUG, TAG_STTC, "=====");
client = stt_client_get_by_uid(uid);
if (NULL == client) {
+ //LCOV_EXCL_START
SLOG(LOG_ERROR, TAG_STTC, "Handle is NOT valid");
return STT_ERROR_INVALID_PARAMETER;
+ //LCOV_EXCL_STOP
}
if (STT_STATE_RECORDING != client->current_state) {
+ //LCOV_EXCL_START
SLOG(LOG_DEBUG, TAG_STTC, "[ERROR] Invalid state : NO 'Recording' state, cur(%d)", client->current_state);
return STT_ERROR_INVALID_STATE;
+ //LCOV_EXCL_STOP
}
g_volume_db = volume;
- SLOG(LOG_DEBUG, TAG_STTC, "Set volume (%f)", g_volume_db);
+ SLOG(LOG_INFO, TAG_STTC, "Set volume (%f)", g_volume_db);
return 0;
}
}
if (NULL == volume) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Input parameter is NULL");
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Input parameter is NULL"); //LCOV_EXCL_LINE
return STT_ERROR_INVALID_PARAMETER;
}
if (STT_STATE_RECORDING != client->current_state) {
- SLOG(LOG_DEBUG, TAG_STTC, "[ERROR] Invalid state : NO 'Recording' state, cur(%d)", client->current_state);
+ SLOG(LOG_DEBUG, TAG_STTC, "[ERROR] Invalid state : NO 'Recording' state, cur(%d)", client->current_state); //LCOV_EXCL_LINE
return STT_ERROR_INVALID_STATE;
}
*volume = g_volume_db;
+ SLOG(LOG_INFO, TAG_STTC, "Get recording volume (%f)", *volume);
+
return STT_ERROR_NONE;
}
+//LCOV_EXCL_START
bool __stt_result_time_cb(int index, int event, const char* text, long start_time, long end_time, void* user_data)
{
stt_client_s* client = (stt_client_s*)user_data;
}
if (NULL != client->result_time_cb) {
- SLOG(LOG_DEBUG, TAG_STTC, "(%d) event(%d) text(%s) start(%ld) end(%ld)",
+ SLOG(LOG_INFO, TAG_STTC, "(%d) event(%d) text(%s) start(%ld) end(%ld)",
index, event, text, start_time, end_time);
client->result_time_cb(client->stt, index, (stt_result_time_event_e)event,
text, start_time, end_time, client->result_time_user_data);
return true;
}
+//LCOV_EXCL_STOP
int stt_foreach_detailed_result(stt_h stt, stt_result_time_cb callback, void* user_data)
{
return STT_ERROR_INVALID_PARAMETER;
}
- SLOG(LOG_DEBUG, TAG_STTC, "===== STT FOREACH DETAILED RESULT");
+ SLOG(LOG_INFO, TAG_STTC, "===== STT FOREACH DETAILED RESULT");
if (NULL == callback) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Input parameter is NULL");
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Input parameter is NULL"); //LCOV_EXCL_LINE
return STT_ERROR_INVALID_PARAMETER;
}
ret = stt_config_mgr_foreach_time_info(__stt_result_time_cb, client);
ret = __stt_convert_config_error_code(ret);
if (0 != ret) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to foreach time info : %s", __stt_get_error_code(ret));
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to foreach time info : %s", __stt_get_error_code(ret)); //LCOV_EXCL_LINE
}
client->result_time_cb = NULL;
client->result_time_user_data = NULL;
- SLOG(LOG_DEBUG, TAG_STTC, "=====");
+ SLOG(LOG_INFO, TAG_STTC, "=====");
SLOG(LOG_DEBUG, TAG_STTC, " ");
return ret;
/* check handle */
if (NULL == client) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to notify error : A handle is not valid");
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to notify error : A handle is not valid"); //LCOV_EXCL_LINE
return;
}
stt_client_not_use_callback(client);
SLOG(LOG_WARN, TAG_STTC, "[WARNING] Error callback is called : reason [%d]", client->reason);
} else {
- SLOG(LOG_WARN, TAG_STTC, "[WARNING] Error callback is null");
+ SLOG(LOG_WARN, TAG_STTC, "[WARNING] Error callback is null"); //LCOV_EXCL_LINE
}
return;
int __stt_cb_error(int uid, int reason, char* err_msg)
{
+ //LCOV_EXCL_START
if (-1 == uid) {
GList* client_list = NULL;
client_list = stt_client_get_client_list();
iter = g_list_next(iter);
}
}
+ //LCOV_EXCL_STOP
} else {
stt_client_s* client = stt_client_get_by_uid(uid);
if (NULL == client) {
- SLOG(LOG_ERROR, TAG_STTC, "Handle not found");
+ SLOG(LOG_ERROR, TAG_STTC, "Handle not found"); //LCOV_EXCL_LINE
return -1;
}
}
if (STT_ERROR_SERVICE_RESET == reason) {
- SLOG(LOG_WARN, TAG_STTC, "[WARNING] Service reset");
+ SLOG(LOG_WARN, TAG_STTC, "[WARNING] Service reset"); //LCOV_EXCL_LINE
client->current_state = STT_STATE_CREATED;
if (0 != stt_prepare(client->stt)) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to prepare");
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to prepare"); //LCOV_EXCL_LINE
}
}
}
/* check handle */
if (NULL == client) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to notify error : A handle is not valid");
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to notify error : A handle is not valid"); //LCOV_EXCL_LINE
return;
}
if (STT_INTERNAL_STATE_STARTING == client->internal_state && STT_STATE_RECORDING == client->current_state) {
client->internal_state = STT_INTERNAL_STATE_NONE;
- SLOG(LOG_DEBUG, TAG_STTC, "Internal state change to NONE");
+ SLOG(LOG_INFO, TAG_STTC, "Internal state change to NONE");
} else if (STT_INTERNAL_STATE_STOPPING == client->internal_state && STT_STATE_PROCESSING == client->current_state) {
client->internal_state = STT_INTERNAL_STATE_NONE;
- SLOG(LOG_DEBUG, TAG_STTC, "Internal state change to NONE");
+ SLOG(LOG_INFO, TAG_STTC, "Internal state change to NONE");
} else if (STT_INTERNAL_STATE_CANCELING == client->internal_state && STT_STATE_READY == client->current_state) {
client->internal_state = STT_INTERNAL_STATE_NONE;
- SLOG(LOG_DEBUG, TAG_STTC, "Internal state change to NONE");
+ SLOG(LOG_INFO, TAG_STTC, "Internal state change to NONE");
}
if (NULL != client->state_changed_cb) {
client->state_changed_cb(client->stt, client->before_state,
client->current_state, client->state_changed_user_data);
stt_client_not_use_callback(client);
- SLOG(LOG_DEBUG, TAG_STTC, "State changed callback is called, State(%d)", client->current_state);
+ SLOG(LOG_INFO, TAG_STTC, "State changed callback is called, State(%d)", client->current_state);
} else {
- SLOG(LOG_WARN, TAG_STTC, "[WARNING] State changed callback is null, State(%d)", client->current_state);
+ SLOG(LOG_WARN, TAG_STTC, "[WARNING] State changed callback is null, State(%d)", client->current_state); //LCOV_EXCL_LINE
}
return;
/* check handle */
if (NULL == client) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to notify error : A handle is not valid");
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to notify error : A handle is not valid"); //LCOV_EXCL_LINE
return EINA_FALSE;
}
client->recognition_result_cb(client->stt, client->event, (const char**)client->data_list, client->data_count,
client->msg, client->recognition_result_user_data);
stt_client_not_use_callback(client);
- SLOG(LOG_DEBUG, TAG_STTC, "client recognition result callback called");
+ SLOG(LOG_INFO, TAG_STTC, "client recognition result callback called");
} else {
SLOG(LOG_WARN, TAG_STTC, "[WARNING] User recognition result callback is NULL");
}
free(temp[i]);
temp[i] = NULL;
} else {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Result data is error");
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Result data is error"); //LCOV_EXCL_LINE
}
}
free(client->data_list);
if (NULL != client->state_changed_cb) {
ecore_main_loop_thread_safe_call_async(__stt_notify_state_changed, client);
} else {
- SLOG(LOG_WARN, TAG_STTC, "[WARNING] State changed callback is null");
+ SLOG(LOG_WARN, TAG_STTC, "[WARNING] State changed callback is null"); //LCOV_EXCL_LINE
}
}
client = stt_client_get_by_uid(uid);
if (NULL == client) {
- SLOG(LOG_ERROR, TAG_STTC, "Handle is NOT valid");
+ SLOG(LOG_ERROR, TAG_STTC, "Handle is NOT valid"); //LCOV_EXCL_LINE
return STT_ERROR_INVALID_PARAMETER;
}
if (NULL != msg)
- SLOG(LOG_DEBUG, TAG_STTC, "Recognition Result Message = %s", msg);
+ SECURE_SLOG(LOG_INFO, TAG_STTC, "Recognition Result Message = %s", msg);
int i = 0;
for (i = 0; i < data_count; i++) {
if (NULL != data[i])
- SLOG(LOG_DEBUG, TAG_STTC, "Recognition Result[%d] = %s", i, data[i]);
+ SECURE_SLOG(LOG_INFO, TAG_STTC, "Recognition Result[%d] = %s", i, data[i]);
}
if (NULL != client->recognition_result_cb) {
char **temp = NULL;
temp = (char**)calloc(data_count, sizeof(char*));
if (NULL == temp) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to allocate memory");
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to allocate memory"); //LCOV_EXCL_LINE
return STT_ERROR_OUT_OF_MEMORY;
}
if (NULL != data[i])
temp[i] = strdup(data[i]);
else
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Result data is error");
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Result data is error"); //LCOV_EXCL_LINE
}
client->data_list = temp;
{
stt_client_s* client = stt_client_get_by_uid(uid);
if (NULL == client) {
- SLOG(LOG_ERROR, TAG_STTC, "Handle not found");
+ SLOG(LOG_ERROR, TAG_STTC, "Handle not found"); //LCOV_EXCL_LINE
return -1;
}
/* check handle */
if (NULL == client) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to notify speech status : A handle is not valid");
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to notify speech status : A handle is not valid"); //LCOV_EXCL_LINE
return;
}
stt_client_use_callback(client);
client->speech_status_cb(client->stt, client->speech_status, client->speech_status_user_data);
stt_client_not_use_callback(client);
- SLOG(LOG_DEBUG, TAG_STTC, "Speech status callback is called");
+ SLOG(LOG_INFO, TAG_STTC, "Speech status callback is called"); //LCOV_EXCL_LINE
} else {
- SLOG(LOG_WARN, TAG_STTC, "[WARNING] Speech status callback is null");
+ SLOG(LOG_WARN, TAG_STTC, "[WARNING] Speech status callback is null"); //LCOV_EXCL_LINE
}
return;
{
stt_client_s* client = stt_client_get_by_uid(uid);
if (NULL == client) {
- SLOG(LOG_ERROR, TAG_STTC, "Handle not found");
+ SLOG(LOG_ERROR, TAG_STTC, "Handle not found"); //LCOV_EXCL_LINE
return -1;
}
return STT_ERROR_INVALID_STATE;
}
+ SLOG(LOG_INFO, TAG_STTC, "[INFO] Set recognition result cb");
+
client->recognition_result_cb = callback;
client->recognition_result_user_data = user_data;
return STT_ERROR_INVALID_STATE;
}
+ SLOG(LOG_INFO, TAG_STTC, "[INFO] Unset recognition result cb");
+
client->recognition_result_cb = NULL;
client->recognition_result_user_data = NULL;
return STT_ERROR_INVALID_STATE;
}
+ SLOG(LOG_INFO, TAG_STTC, "[INFO] Set state changed cb");
+
client->state_changed_cb = callback;
client->state_changed_user_data = user_data;
return STT_ERROR_INVALID_STATE;
}
+ SLOG(LOG_INFO, TAG_STTC, "[INFO] Unset state changed cb");
+
client->state_changed_cb = NULL;
client->state_changed_user_data = NULL;
return STT_ERROR_INVALID_STATE;
}
+ SLOG(LOG_INFO, TAG_STTC, "[INFO] Set error cb");
+
client->error_cb = callback;
client->error_user_data = user_data;
return STT_ERROR_INVALID_STATE;
}
+ SLOG(LOG_INFO, TAG_STTC, "[INFO] Unset error cb");
+
client->error_cb = NULL;
client->error_user_data = NULL;
return STT_ERROR_INVALID_STATE;
}
+ SLOG(LOG_INFO, TAG_STTC, "[INFO] Set default language changed cb");
+
client->default_lang_changed_cb = callback;
client->default_lang_changed_user_data = user_data;
return STT_ERROR_INVALID_STATE;
}
+ SLOG(LOG_INFO, TAG_STTC, "[INFO] Unset default language changed cb");
+
client->default_lang_changed_cb = NULL;
client->default_lang_changed_user_data = NULL;
return STT_ERROR_INVALID_STATE;
}
+ SLOG(LOG_INFO, TAG_STTC, "[INFO] Set engine changed cb");
+
client->engine_changed_cb = callback;
client->engine_changed_user_data = user_data;
return STT_ERROR_INVALID_STATE;
}
+ SLOG(LOG_INFO, TAG_STTC, "[INFO] Unset engine changed cb");
+
client->engine_changed_cb = NULL;
client->engine_changed_user_data = NULL;
return 0;
}
+//LCOV_EXCL_START
int stt_set_speech_status_cb(stt_h stt, stt_speech_status_cb callback, void* user_data)
{
stt_client_s* client = NULL;
return STT_ERROR_INVALID_STATE;
}
+ SLOG(LOG_INFO, TAG_STTC, "[INFO] Set speech status cb");
+
client->speech_status_cb = callback;
client->speech_status_user_data = user_data;
return STT_ERROR_INVALID_STATE;
}
+ SLOG(LOG_INFO, TAG_STTC, "[INFO] Unset speech status cb");
+
client->speech_status_cb = NULL;
client->speech_status_user_data = NULL;
return STT_ERROR_INVALID_PARAMETER;
}
- SLOG(LOG_DEBUG, TAG_STTC, "===== STT START FILE");
+ SLOG(LOG_INFO, TAG_STTC, "===== STT START FILE");
/* check state */
if (client->current_state != STT_STATE_READY) {
}
int ret = -1;
- char appid[128] = {0, };
- ret = aul_app_get_appid_bypid(getpid(), appid, sizeof(appid));
+ char appid[1024] = {0, };
+ ret = aul_app_get_appid_bypid(getpid(), appid, sizeof(appid) - 1);
if ((AUL_R_OK != ret) || (0 == strlen(appid))) {
SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to get application ID");
} else {
- SLOG(LOG_DEBUG, TAG_STTC, "[DEBUG] Current app id is %s", appid);
+ SLOG(LOG_INFO, TAG_STTC, "[DEBUG] Current app id is %s", appid);
}
char* temp = NULL;
SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to start file : %s", __stt_get_error_code(ret));
client->internal_state = STT_INTERNAL_STATE_NONE;
} else {
- SLOG(LOG_DEBUG, TAG_STTC, "[SUCCESS] Start is successful but not done");
+ SLOG(LOG_INFO, TAG_STTC, "[SUCCESS] Start is successful but not done");
}
free(temp);
return STT_ERROR_INVALID_PARAMETER;
}
- SLOG(LOG_DEBUG, TAG_STTC, "===== STT CANCEL FILE");
+ SLOG(LOG_INFO, TAG_STTC, "===== STT CANCEL FILE");
/* check state */
if (STT_STATE_RECORDING != client->current_state && STT_STATE_PROCESSING != client->current_state) {
SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to cancel file : %s", __stt_get_error_code(ret));
client->internal_state = STT_INTERNAL_STATE_NONE;
} else {
- SLOG(LOG_DEBUG, TAG_STTC, "[SUCCESS] Cancel file is successful but not done");
+ SLOG(LOG_INFO, TAG_STTC, "[SUCCESS] Cancel file is successful but not done");
}
SLOG(LOG_DEBUG, TAG_STTC, "=====");
return ret;
}
-
+//LCOV_EXCL_STOP