#include "tts_dbus.h"
#include "tts_main.h"
+#include "tts_internal.h"
static bool g_screen_reader;
return TTS_ERROR_INVALID_STATE;
}
- if (TTS_MODE_DEFAULT <= mode && mode <= TTS_MODE_SCREEN_READER) {
+ if (TTS_MODE_DEFAULT <= mode && mode <= TTS_MODE_INTERRUPT) {
client->mode = mode;
} else {
SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] mode is not valid : %d", mode);
client->credential = strdup(credential);
if (NULL == client->credential) {
SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to allocate memory");
+ if (NULL != key) {
+ free(key);
+ key = NULL;
+ }
return TTS_ERROR_OUT_OF_MEMORY;
}
} else {
int pid = getpid();
char* appid = NULL;
int ret = app_manager_get_app_id(pid, &appid);
- if (0 != ret) {
+ if (0 != ret || NULL == appid) {
SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to get appid, ret(%d), pid(%d), appid(%s)", ret, pid, appid);
free(key);
key = NULL;
+ if (NULL != appid) {
+ free(appid);
+ appid = NULL;
+ }
return TTS_ERROR_OPERATION_FAILED;
}
SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to set private data, ret(%d), pid(%d), appid(%s)", ret, pid, appid);
free(key);
key = NULL;
+ free(appid);
+ appid = NULL;
return ret;
}
client->conn_timer = NULL;
return EINA_FALSE;
+ } else if (TTS_ERROR_PERMISSION_DENIED == ret) {
+ SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to initialize : %s", __tts_get_error_code(ret));
+
+ client->reason = TTS_ERROR_PERMISSION_DENIED;
+ client->utt_id = -1;
+
+ ecore_timer_add(0, __tts_notify_error, (void*)client->tts);
+ client->conn_timer = NULL;
+ return EINA_FALSE;
+
} else if (TTS_ERROR_NONE != ret) {
SLOG(LOG_WARN, TAG_TTSC, "[WARNING] Fail to connection. Retry to connect : %s", __tts_get_error_code(ret));
return EINA_TRUE;
return TTS_ERROR_INVALID_STATE;
}
-// *size = TTS_MAX_TEXT_SIZE;
if (0 != tts_config_mgr_get_max_text_size(size)) {
SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to get max text size");
return TTS_ERROR_INVALID_PARAMETER;
return TTS_ERROR_INVALID_PARAMETER;
}
- if (TTS_STATE_PLAYING != client->current_state) {
+ if (TTS_STATE_CREATED == client->current_state) {
SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] The current state is invalid.");
return TTS_ERROR_INVALID_STATE;
}
return TTS_ERROR_INVALID_PARAMETER;
}
- if (TTS_STATE_PLAYING != client->current_state) {
+ if (TTS_STATE_CREATED == client->current_state) {
SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] The current state is invalid.");
return TTS_ERROR_INVALID_STATE;
}