SLOG(LOG_DEBUG, vc_config_tag(), "Default engine is changed : %s", g_config_info->engine_id);
if (0 != vc_parser_set_engine(g_config_info->engine_id)) {
- SLOG(LOG_ERROR, vc_config_tag(), " Fail to save config");
+ SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Fail to save config");
return -1;
}
engine_info = iter->data;
if (NULL == engine_info) {
- SLOG(LOG_ERROR, vc_config_tag(), "engine info is NULL");
+ SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] engine info is NULL");
return false;
}
/* Check current config info */
if (NULL == g_config_info) {
- SLOG(LOG_ERROR, vc_config_tag(), "Current config info is NULL");
+ SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Current config info is NULL");
return VC_CONFIG_ERROR_OPERATION_FAILED;
}
/* Check current language */
if (NULL == g_config_info->language) {
- SLOG(LOG_ERROR, vc_config_tag(), "Current config language is NULL");
+ SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Current config language is NULL");
return VC_CONFIG_ERROR_OPERATION_FAILED;
}
/* vc default language change */
char* before_lang = NULL;
if (0 != vc_parser_set_language(candidate_lang)) {
- SLOG(LOG_ERROR, vc_config_tag(), "Fail to save default language");
+ SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Fail to save default language");
return -1;
}
int vc_config_mgr_set_enabled_cb(int uid, vc_config_enabled_cb enabled_cb)
{
if (NULL == enabled_cb) {
- SLOG(LOG_ERROR, vc_config_tag(), "enabled cb is NULL : uid(%d) ", uid);
+ SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] enabled cb is NULL : uid(%d) ", uid);
return VC_CONFIG_ERROR_INVALID_PARAMETER;
}
int vc_config_mgr_get_auto_language(bool* value)
{
if (0 >= g_slist_length(g_config_client_list)) {
- SLOG(LOG_ERROR, vc_config_tag(), "Not initialized");
+ SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Not initialized");
return -1;
}
int vc_config_mgr_set_auto_language(bool value)
{
if (0 >= g_slist_length(g_config_client_list)) {
- SLOG(LOG_ERROR, vc_config_tag(), "Not initialized");
+ SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Not initialized");
return -1;
}
if (g_config_info->auto_lang != value) {
/* Check language is valid */
if (0 != vc_parser_set_auto_lang(value)) {
- SLOG(LOG_ERROR, vc_config_tag(), "Fail to save engine id");
+ SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Fail to save engine id");
return -1;
}
g_config_info->auto_lang = value;
int vc_config_mgr_get_language_list(vc_supported_language_cb callback, void* user_data)
{
if (0 >= g_slist_length(g_config_client_list)) {
- SLOG(LOG_ERROR, vc_config_tag(), "Not initialized");
+ SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Not initialized");
return -1;
}
if (0 >= g_slist_length(g_engine_list)) {
- SLOG(LOG_ERROR, vc_config_tag(), "There is no engine");
+ SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] There is no engine");
return -1;
}
int vc_config_mgr_get_default_language(char** language)
{
if (0 >= g_slist_length(g_config_client_list)) {
- SLOG(LOG_ERROR, vc_config_tag(), "Not initialized");
+ SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Not initialized");
return -1;
}
if (NULL != g_config_info->language) {
*language = strdup(g_config_info->language);
} else {
- SLOG(LOG_ERROR, vc_config_tag(), " language is NULL");
+ SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] language is NULL");
return -1;
}
int vc_config_mgr_set_default_language(const char* language)
{
if (0 >= g_slist_length(g_config_client_list)) {
- SLOG(LOG_ERROR, vc_config_tag(), "Not initialized");
+ SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Not initialized");
return -1;
}
/* Check language is valid */
if (NULL != g_config_info->language) {
if (0 != vc_parser_set_language(language)) {
- SLOG(LOG_ERROR, vc_config_tag(), "Fail to save engine id");
+ SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Fail to save engine id");
return -1;
}
free(g_config_info->language);
g_config_info->language = strdup(language);
} else {
- SLOG(LOG_ERROR, vc_config_tag(), " language is NULL");
+ SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] language is NULL");
return -1;
}
int vc_config_mgr_get_enabled(bool* value)
{
if (0 >= g_slist_length(g_config_client_list)) {
- SLOG(LOG_ERROR, vc_config_tag(), "Not initialized");
+ SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Not initialized");
return -1;
}
int vc_config_mgr_set_enabled(bool value)
{
if (0 >= g_slist_length(g_config_client_list)) {
- SLOG(LOG_ERROR, vc_config_tag(), "Not initialized");
+ SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Not initialized");
return -1;
}
if (0 != vc_parser_set_enabled(value)) {
- SLOG(LOG_ERROR, vc_config_tag(), "Fail to set enabled");
+ SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Fail to set enabled");
return -1;
}
int vc_config_mgr_get_nonfixed_support(bool* value)
{
if (0 >= g_slist_length(g_config_client_list)) {
- SLOG(LOG_ERROR, vc_config_tag(), "Not initialized");
+ SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Not initialized");
return -1;
}
if (NULL == value) {
- SLOG(LOG_ERROR, vc_config_tag(), "Input parameter is NULL");
+ SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Input parameter is NULL");
return -1;
}
if (0 >= g_slist_length(g_engine_list)) {
- SLOG(LOG_ERROR, vc_config_tag(), "There is no engine");
+ SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] There is no engine");
return -1;
}
bool vc_config_check_default_engine_is_valid(const char* engine)
{
if (0 >= g_slist_length(g_config_client_list)) {
- SLOG(LOG_ERROR, vc_config_tag(), "Not initialized");
+ SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Not initialized");
return -1;
}
bool vc_config_check_default_language_is_valid(const char* language)
{
if (0 >= g_slist_length(g_config_client_list)) {
- SLOG(LOG_ERROR, vc_config_tag(), "Not initialized");
+ SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Not initialized");
return -1;
}
int vc_config_mgr_set_foreground(int pid, bool value)
{
if (0 >= g_slist_length(g_config_client_list)) {
- SLOG(LOG_ERROR, vc_config_tag(), "Not initialized");
+ SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Not initialized");
return -1;
}
int vc_config_mgr_get_foreground(int* pid)
{
if (0 >= g_slist_length(g_config_client_list)) {
- SLOG(LOG_ERROR, vc_config_tag(), "Not initialized");
+ SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Not initialized");
return -1;
}
j++;
}
} else {
- SLOG(LOG_ERROR, vc_config_tag(), " language is NONE");
+ SLOG(LOG_DEBUG, vc_config_tag(), " language is NONE");
}
SLOG(LOG_DEBUG, vc_config_tag(), " ");
iter = g_slist_next(iter);
SLOG(LOG_DEBUG, vc_config_tag(), "--------------------------------------------");
return 0;
-}
+}
\ No newline at end of file
temp->name = strdup((char*)key);
xmlFree(key);
} else {
- SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] <%s> has no content", VC_TAG_ENGINE_ID);
+ SLOG(LOG_WARN, vc_config_tag(), "[WARNING] <%s> has no content", VC_TAG_ENGINE_ID);
}
} else if (0 == xmlStrcmp(cur->name, (const xmlChar *)VC_TAG_ENGINE_ID)) {
key = xmlNodeGetContent(cur);
temp->uuid = strdup((char*)key);
xmlFree(key);
} else {
- SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] <%s> has no content", VC_TAG_ENGINE_ID);
+ SLOG(LOG_WARN, vc_config_tag(), "[WARNING] <%s> has no content", VC_TAG_ENGINE_ID);
}
} else if (0 == xmlStrcmp(cur->name, (const xmlChar *)VC_TAG_ENGINE_LANGUAGE_SET)) {
xmlNodePtr lang_node = NULL;
temp->languages = g_slist_append(temp->languages, temp_lang);
xmlFree(key);
} else {
- SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] <%s> has no content", VC_TAG_ENGINE_LANGUAGE);
+ SLOG(LOG_WARN, vc_config_tag(), "[WARNING] <%s> has no content", VC_TAG_ENGINE_LANGUAGE);
}
}
} else if (0 == xmlStrcmp(key, (const xmlChar *)"false")) {
temp->non_fixed_support = false;
} else {
- SLOG(LOG_ERROR, vc_config_tag(), "Auto voice is wrong");
+ SLOG(LOG_WARN, vc_config_tag(), "[WARNING] Auto voice is wrong");
temp->non_fixed_support = false;
}
xmlFree(key);
} else {
- SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] <%s> has no content", VC_TAG_ENGINE_NON_FIXED_SUPPORT);
+ SLOG(LOG_WARN, vc_config_tag(), "[WARNING] <%s> has no content", VC_TAG_ENGINE_NON_FIXED_SUPPORT);
}
} else {
i++;
}
} else {
- SLOG(LOG_ERROR, vc_config_tag(), " language is NONE");
+ SLOG(LOG_DEBUG, vc_config_tag(), " language is NONE");
}
SLOG(LOG_DEBUG, vc_config_tag(), "=====================");
temp->engine_id = strdup((char*)key);
xmlFree(key);
} else {
- SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] enable is NULL");
+ SLOG(LOG_WARN, vc_config_tag(), "[WARNING] enable is NULL");
}
} else if (0 == xmlStrcmp(cur->name, (const xmlChar *)VC_TAG_CONFIG_AUTO_LANGUAGE)) {
key = xmlNodeGetContent(cur);
} else if (0 == xmlStrcmp(key, (const xmlChar *)"off")) {
temp->auto_lang = false;
} else {
- SLOG(LOG_ERROR, vc_config_tag(), "Auto voice is wrong");
+ SLOG(LOG_WARN, vc_config_tag(), "[WARNING] Auto voice is wrong");
temp->auto_lang = false;
}
xmlFree(key);
} else {
- SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] voice type is NULL");
+ SLOG(LOG_WARN, vc_config_tag(), "[WARNING] voice type is NULL");
}
} else if (0 == xmlStrcmp(cur->name, (const xmlChar *)VC_TAG_CONFIG_LANGUAGE)) {
key = xmlNodeGetContent(cur);
temp->language = strdup((char*)key);
xmlFree(key);
} else {
- SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] language is NULL");
+ SLOG(LOG_WARN, vc_config_tag(), "[WARNING] language is NULL");
}
} else if (0 == xmlStrcmp(cur->name, (const xmlChar*)VC_TAG_CONFIG_ENABLED)) {
key = xmlNodeGetContent(cur);
} else if (0 == xmlStrcmp(key, (const xmlChar *)"off")) {
temp->enabled = false;
} else {
- SLOG(LOG_ERROR, vc_config_tag(), "Enabled service is wrong");
+ SLOG(LOG_WARN, vc_config_tag(), "[WARNING] Enabled service is wrong");
temp->enabled = false;
}
} else {
- SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Enabled service is NULL");
+ SLOG(LOG_WARN, vc_config_tag(), "[WARNING] Enabled service is NULL");
}
} else {
xmlFree(key_old);
}
} else {
- SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Old config and new config are different");
+ SLOG(LOG_WARN, vc_config_tag(), "[WARNING] Old config and new config are different");
}
} else if (0 == xmlStrcmp(cur_new->name, (const xmlChar*)VC_TAG_CONFIG_LANGUAGE)) {
if (0 == xmlStrcmp(cur_old->name, (const xmlChar*)VC_TAG_CONFIG_LANGUAGE)) {
xmlFree(key_old);
}
} else {
- SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] old config and new config are different");
+ SLOG(LOG_WARN, vc_config_tag(), "[WARNING] old config and new config are different");
}
} else if (0 == xmlStrcmp(cur_new->name, (const xmlChar*)VC_TAG_CONFIG_ENABLED)) {
if (0 == xmlStrcmp(cur_old->name, (const xmlChar*)VC_TAG_CONFIG_ENABLED)) {
xmlFree(key_old);
}
} else {
- SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] old config and new config are different");
+ SLOG(LOG_WARN, vc_config_tag(), "[WARNING] old config and new config are different");
}
} else {
int cur_pid = 0;
/* Get foreground pid */
if (0 != vc_parser_get_foreground(&cur_pid)) {
- SLOG(LOG_DEBUG, vc_config_tag(), "Fail to get pid from info file");
+ SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Fail to get pid from info file");
return -1;
}
cur = xmlDocGetRootElement(doc);
if (cur == NULL) {
SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Empty document");
+ xmlFreeDoc(doc);
return -1;
}
if (xmlStrcmp(cur->name, (const xmlChar *) VC_TAG_INFO_BASE_TAG)) {
SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] The wrong type, root node is NOT %s", VC_TAG_INFO_BASE_TAG);
+ xmlFreeDoc(doc);
return -1;
}
cur = cur->xmlChildrenNode;
if (cur == NULL) {
SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Empty document");
+ xmlFreeDoc(doc);
return -1;
}
int ret = xmlSaveFile(VC_RUNTIME_INFO_FOREGROUND, doc);
if (0 >= ret) {
- SLOG(LOG_DEBUG, vc_config_tag(), "[ERROR] Fail to save foreground info : %d", ret);
+ SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Fail to save foreground info : %d", ret);
+ xmlFreeDoc(doc);
return -1;
}
SLOG(LOG_DEBUG, vc_config_tag(), "[Success] Save foreground info pid(%d)", pid);
+ xmlFreeDoc(doc);
return 0;
}
if (APP_MANAGER_ERROR_NONE != ret) {
SLOG(LOG_ERROR, vc_info_tag(), "[ERROR] fail to get app id, ret(%d)", ret);
} else {
- SLOG(LOG_ERROR, vc_info_tag(), "Background cmd: appid = %s", appid);
+ SLOG(LOG_DEBUG, vc_info_tag(), "Background cmd: appid = %s", appid);
}
}
int ret;
ret = fscanf(fp, "size(%d)\n", &readn);
if (ret <= 0) {
- SLOG(LOG_DEBUG, vc_info_tag(), "[ERROR] Fail to get buffer size");
+ SLOG(LOG_ERROR, vc_info_tag(), "[ERROR] Fail to get buffer size");
fclose(fp);
return -1;
}
SLOG(LOG_DEBUG, vc_info_tag(), "[DEBUG] buffer size (%d)", readn);
if (10000000 < readn || 0 > readn) {
- SLOG(LOG_DEBUG, vc_info_tag(), "[ERROR] Invalid buffer size");
+ SLOG(LOG_ERROR, vc_info_tag(), "[ERROR] Invalid buffer size");
fclose(fp);
return -1;
}
{
int ret = vc_db_get_result_pid_list(result, pid_list);
if (0 != ret) {
- SLOG(LOG_DEBUG, vc_info_tag(), "[ERROR] Fail to delete result table");
+ SLOG(LOG_ERROR, vc_info_tag(), "[ERROR] Fail to delete result table");
return -1;
}
return 0;
cmd = iter->data;
if (NULL == cmd) {
- SLOG(LOG_ERROR, vc_info_tag(), "[ERROR] NULL data from command list");
+ SLOG(LOG_WARN, vc_info_tag(), "[WARNING] NULL data from command list");
iter = g_slist_next(iter);
continue;
}
}
return 0;
-}
+}
\ No newline at end of file
if (APP_MANAGER_ERROR_NONE != ret) {
SLOG(LOG_ERROR, vc_json_tag(), "[ERROR] fail to get app id, ret(%d)", ret);
} else {
- SLOG(LOG_ERROR, vc_json_tag(), "Background cmd: appid = %s", appid);
+ SLOG(LOG_DEBUG, vc_json_tag(), "Background cmd: appid = %s", appid);
}
} else {
appid = strdup(temp_text);
}
return ret;
}
- SLOG(LOG_WARN, vc_json_tag(), "[INFO] pid(%d), type(%d), format(%d), domain(%d), cmd(%s), appid(%s)", cmd->pid, type, cmd->format, cmd->domain, cmd->command, cmd->appid);
+ SLOG(LOG_INFO, vc_json_tag(), "[INFO] pid(%d), type(%d), format(%d), domain(%d), cmd(%s), appid(%s)", cmd->pid, type, cmd->format, cmd->domain, cmd->command, cmd->appid);
if (NULL != cmd->appid) {
free(cmd->appid);
g_object_unref(parser);
return ret;
-}
-
+}
\ No newline at end of file
ret = app_control_add_extra_data(app_control, "voice_launch", "get_result");
if (APP_CONTROL_ERROR_NONE != ret) {
SLOG(LOG_ERROR, TAG_VCD, "[ERROR] Fail to add extra data, ret(%d)", ret);
+ app_control_destroy(app_control);
return VCD_ERROR_OPERATION_FAILED;
}
// Set an app ID.
ret = app_control_set_app_id(app_control, appid);
if (APP_CONTROL_ERROR_NONE != ret) {
SLOG(LOG_ERROR, TAG_VCD, "[ERROR] Fail to set app id, ret(%d)", ret);
+ app_control_destroy(app_control);
return VCD_ERROR_OPERATION_FAILED;
}
// Sent launch request
ret = app_control_send_launch_request(app_control, NULL, NULL);
if (APP_CONTROL_ERROR_NONE != ret) {
SLOG(LOG_ERROR, TAG_VCD, "[ERROR] Fail to send launch request, ret(%d)", ret);
+ app_control_destroy(app_control);
return VCD_ERROR_OPERATION_FAILED;
}
// Destroy app control