Fix bugs 59/73659/3
authorWonnam Jang <wn.jang@samsung.com>
Thu, 9 Jun 2016 05:44:46 +0000 (14:44 +0900)
committerWonnam Jang <wn.jang@samsung.com>
Thu, 9 Jun 2016 07:06:27 +0000 (16:06 +0900)
Change-Id: I368b9088435a6a44a450a97e1eec25e6bea51d08
Signed-off-by: Wonnam Jang <wn.jang@samsung.com>
42 files changed:
CMakeLists.txt
client/stt.c
client/stt_client.c
client/stt_client.h
client/stt_dbus.c
client/stt_dbus.h
client/stt_file.c [changed mode: 0755->0644]
client/stt_file_client.c
client/stt_file_client.h [changed mode: 0755->0644]
client/stt_main.h [changed mode: 0755->0644]
client/stt_setting.c
common/stt_config_mgr.c
common/stt_config_mgr.h
common/stt_config_parser.c
common/stt_config_parser.h
common/stt_defs.h
common/stt_engine.c
common/stt_engine.h
common/stt_network.c
common/stt_network.h
doc/uix_stt_doc.h
include/stt.h
include/stt_file.h [changed mode: 0755->0644]
include/stt_setting.h [changed mode: 0755->0644]
server/sttd_client_data.c
server/sttd_client_data.h [changed mode: 0755->0644]
server/sttd_config.c
server/sttd_config.h
server/sttd_dbus.c
server/sttd_dbus.h
server/sttd_dbus_server.c
server/sttd_dbus_server.h
server/sttd_engine_agent.c
server/sttd_engine_agent.h
server/sttd_main.c
server/sttd_main.h
server/sttd_recorder.c
server/sttd_recorder.h
server/sttd_server.c
server/sttd_server.h
server/sttp.h
test/test_main.c [changed mode: 0755->0644]

index 5bf936a..42a1c7d 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved
+# Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 #
 #    Licensed under the Apache License, Version 2.0 (the "License");
 #    you may not use this file except in compliance with the License.
index d69e7f0..fa4dd9c 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved
+*  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
@@ -555,7 +555,7 @@ int stt_set_credential(stt_h stt, const char* credential)
        SLOG(LOG_DEBUG, TAG_STTC, "===== Set credential");
 
        if (NULL == credential) {
-               SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Input parameter is NULL, stt(%s), credential(%a)", stt, credential);
+               SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Input parameter is NULL");
                return STT_ERROR_INVALID_PARAMETER;
        }
 
@@ -1427,8 +1427,14 @@ int stt_stop(stt_h stt)
                return STT_ERROR_INVALID_STATE;
        }
 
-       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);
+       if (STT_INTERNAL_STATE_STARTING == client->internal_state) {
+               SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid State : Internal state is STARTING : %d", client->internal_state);
+               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);
+               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);
                return STT_ERROR_IN_PROGRESS_TO_PROCESSING;
        }
 
@@ -1438,7 +1444,7 @@ int stt_stop(stt_h stt)
                SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to stop : %s", __stt_get_error_code(ret));
        } else {
                SLOG(LOG_DEBUG, TAG_STTC, "[SUCCESS] Stop is successful but not done");
-               client->internal_state = STT_INTERNAL_STATE_STOPING;
+               client->internal_state = STT_INTERNAL_STATE_STOPPING;
        }
 
        SLOG(LOG_DEBUG, TAG_STTC, "=====");
@@ -1469,8 +1475,14 @@ int stt_cancel(stt_h stt)
                return STT_ERROR_INVALID_STATE;
        }
 
-       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);
+       if (STT_INTERNAL_STATE_STARTING == client->internal_state) {
+               SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid State : Internal state is STARTING : %d", client->internal_state);
+               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);
+               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);
                return STT_ERROR_IN_PROGRESS_TO_READY;
        }
 
@@ -1672,7 +1684,7 @@ static void __stt_notify_state_changed(void *data)
        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");
-       } else if (STT_INTERNAL_STATE_STOPING == client->internal_state && STT_STATE_PROCESSING == client->current_state) {
+       } 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");
        } else if (STT_INTERNAL_STATE_CANCELING == client->internal_state && STT_STATE_READY == client->current_state) {
index d5a45b4..c925151 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved
+*  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
index ed9803d..43cf60e 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved 
+*  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
@@ -26,7 +26,7 @@ extern "C" {
 typedef enum {
        STT_INTERNAL_STATE_NONE         = 0,
        STT_INTERNAL_STATE_STARTING     = 1,
-       STT_INTERNAL_STATE_STOPING      = 2,
+       STT_INTERNAL_STATE_STOPPING     = 2,
        STT_INTERNAL_STATE_CANCELING    = 3
 } stt_internal_state_e;
 
index ee14cd8..1c5682b 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved
+*  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
@@ -293,10 +293,12 @@ int stt_dbus_open_connection()
        dbus_error_init(&err);
 
        /* connect to the DBUS system bus, and check for errors */
-       g_conn_sender = dbus_bus_get_private(DBUS_BUS_SESSION, &err);
-       if (dbus_error_is_set(&err)) {
-               SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Dbus Connection Error (%s)", err.message);
-               dbus_error_free(&err);
+       if (NULL == g_conn_sender) {
+               g_conn_sender = dbus_bus_get_private(DBUS_BUS_SESSION, &err);
+               if (dbus_error_is_set(&err)) {
+                       SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Dbus Connection Error (%s)", err.message);
+                       dbus_error_free(&err);
+               }
        }
 
        if (NULL == g_conn_sender) {
@@ -307,11 +309,12 @@ int stt_dbus_open_connection()
        dbus_connection_set_exit_on_disconnect(g_conn_sender, false);
 
        /* connect to the DBUS system bus, and check for errors */
-       g_conn_listener = dbus_bus_get_private(DBUS_BUS_SESSION, &err);
-
-       if (dbus_error_is_set(&err)) { 
-               SLOG(LOG_ERROR, TAG_STTC, "Dbus Connection Error (%s)", err.message); 
-               dbus_error_free(&err);
+       if (NULL == g_conn_listener) {
+               g_conn_listener = dbus_bus_get_private(DBUS_BUS_SESSION, &err);
+               if (dbus_error_is_set(&err)) {
+                       SLOG(LOG_ERROR, TAG_STTC, "Dbus Connection Error (%s)", err.message);
+                       dbus_error_free(&err);
+               }
        }
 
        if (NULL == g_conn_listener) {
@@ -390,6 +393,9 @@ int stt_dbus_close_connection()
        dbus_connection_close(g_conn_sender);
        dbus_connection_close(g_conn_listener);
 
+       dbus_connection_unref(g_conn_sender);
+       dbus_connection_unref(g_conn_listener);
+
        g_conn_sender = NULL;
        g_conn_listener = NULL;
 
@@ -899,9 +905,9 @@ int stt_dbus_request_set_private_data(int uid, const char* key, const char* data
        DBusMessage* msg;
 
        msg = dbus_message_new_method_call(
-               STT_SERVER_SERVICE_NAME, 
-               STT_SERVER_SERVICE_OBJECT_PATH, 
-               STT_SERVER_SERVICE_INTERFACE, 
+               STT_SERVER_SERVICE_NAME,
+               STT_SERVER_SERVICE_OBJECT_PATH,
+               STT_SERVER_SERVICE_INTERFACE,
                STT_METHOD_SET_PRIVATE_DATA);
 
        if (NULL == msg) {
@@ -969,9 +975,9 @@ int stt_dbus_request_get_private_data(int uid, const char* key, char** data)
        DBusMessage* msg;
 
        msg = dbus_message_new_method_call(
-               STT_SERVER_SERVICE_NAME, 
-               STT_SERVER_SERVICE_OBJECT_PATH, 
-               STT_SERVER_SERVICE_INTERFACE, 
+               STT_SERVER_SERVICE_NAME,
+               STT_SERVER_SERVICE_OBJECT_PATH,
+               STT_SERVER_SERVICE_INTERFACE,
                STT_METHOD_GET_PRIVATE_DATA);
 
        if (NULL == msg) {
@@ -1020,8 +1026,6 @@ int stt_dbus_request_get_private_data(int uid, const char* key, char** data)
                        SLOG(LOG_DEBUG, TAG_STTC, "<<<< stt get private data : result = %d", result);
                        if (NULL != temp) {
                                *data = strdup(temp);
-                               free(temp);
-                               temp = NULL;
                        }
                } else {
                        SLOG(LOG_ERROR, TAG_STTC, "<<<< stt get private data : result = %d", result);
index 8485e95..5330b99 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved 
+*  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
old mode 100755 (executable)
new mode 100644 (file)
index 423eaaa..fcfb863
@@ -1,5 +1,5 @@
 /*
-*  Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved
+*  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
index 893c920..c194bd8 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved 
+*  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
old mode 100755 (executable)
new mode 100644 (file)
index 2991e4f..fb1ed34
@@ -1,5 +1,5 @@
 /*
-*  Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved
+*  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
old mode 100755 (executable)
new mode 100644 (file)
index 564c3f6..79044bf
@@ -1,5 +1,5 @@
 /*
-*  Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved 
+*  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
index 118b74a..9609c72 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved
+*  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
index 1cf7c50..a44f27e 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved
+*  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
@@ -150,7 +150,7 @@ int __stt_config_mgr_select_lang(const char* engine_id, char** language)
                                        /* Default language is STT_BASE_LANGUAGE */
                                        if (0 == strcmp(STT_BASE_LANGUAGE, engine_lang)) {
                                                *language = strdup(engine_lang);
-                                               SLOG(LOG_DEBUG, stt_tag(), "Selected language : %s", *language);
+                                               SLOG(LOG_DEBUG, stt_tag(), "Selected language : %s", (NULL == *language) ? "NULL" : *language);
                                                return 0;
                                        }
                                }
@@ -161,7 +161,7 @@ int __stt_config_mgr_select_lang(const char* engine_id, char** language)
                        /* Not support STT_BASE_LANGUAGE */
                        if (NULL != engine_lang) {
                                *language = strdup(engine_lang);
-                               SLOG(LOG_DEBUG, stt_tag(), "Selected language : %s", *language);
+                               SLOG(LOG_DEBUG, stt_tag(), "Selected language : %s", (NULL == *language) ? "NULL" : *language);
                                return 0;
                        }
                }
@@ -1230,8 +1230,8 @@ int stt_config_mgr_get_language_list(const char* engine_id, stt_config_supported
                        /*Get handle data from list*/
                        lang = iter_lang->data;
 
-                       SLOG(LOG_DEBUG, stt_tag(), " %s", lang);
                        if (NULL != lang) {
+                               SLOG(LOG_DEBUG, stt_tag(), " %s", lang);
                                if (false == callback(engine_info->uuid, lang, user_data))
                                        break;
                        }
index 758662b..9f43044 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved 
+*  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
index 8116ba4..a881174 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved
+*  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
index edd7b23..2987661 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved 
+*  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
index d37769c..6ea59f3 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved
+*  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
index e644512..0311c51 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved
+*  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
@@ -263,10 +263,9 @@ int stt_engine_initialize(int engine_id, sttpe_result_cb result_cb, sttpe_silenc
        ret = engine->pefuncs->initialize(result_cb, silence_cb);
        if (0 != ret) {
                SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] Fail to initialize : %s", __stt_get_engine_error_code(ret));
-               return ret;
        }
 
-       return 0;
+       return ret;
 }
 
 int stt_engine_deinitialize(int engine_id)
@@ -284,7 +283,7 @@ int stt_engine_deinitialize(int engine_id)
                SLOG(LOG_WARN, stt_tag(), "[Engine WARNING] Fail to deinitialize : %s", __stt_get_engine_error_code(ret));
        }
 
-       return 0;
+       return ret;
 }
 
 static bool __supported_language_cb(const char* language, void* user_data)
@@ -322,10 +321,9 @@ int stt_engine_get_supported_langs(int engine_id, GSList** lang_list)
        ret = engine->pefuncs->foreach_langs(__supported_language_cb, (void*)lang_list);
        if (0 != ret) {
                SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] get language list error : %s", __stt_get_engine_error_code(ret));
-               return ret;
        }
 
-       return 0;
+       return ret;
 }
 
 int stt_engine_is_valid_language(int engine_id, const char* language, bool *is_valid)
@@ -368,7 +366,7 @@ int stt_engine_set_private_data(int engine_id, const char* key, const char* data
        if (0 != ret) {
                SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] Fail to set private data(%d)", ret);
        }
-       return STTP_ERROR_NONE;
+       return ret;
 }
 
 int stt_engine_get_private_data(int engine_id, const char* key, char** data)
@@ -388,7 +386,8 @@ int stt_engine_get_private_data(int engine_id, const char* key, char** data)
        char* temp = NULL;
        int ret = engine->pefuncs->get_private_data(key, &temp);
        if (0 != ret) {
-               SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] Fail to set private data(%d)", ret);
+               SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] Fail to get private data(%d)", ret);
+               return ret;
        }
 
        *data = strdup(temp);
@@ -540,10 +539,9 @@ int stt_engine_get_audio_type(int engine_id, sttp_audio_type_e* types, int* rate
        ret = engine->pefuncs->get_audio_format(types, rate, channels);
        if (0 != ret) {
                SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] Fail to get audio format : %s", __stt_get_engine_error_code(ret));
-               return ret;
        }
 
-       return 0;
+       return ret;
 }
 
 /* Set option */
@@ -562,10 +560,9 @@ int stt_engine_set_silence_detection(int engine_id, bool value)
                return STTP_ERROR_NOT_SUPPORTED_FEATURE;
        } else if (0 != ret) {
                SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] Fail to set silence detection : %d", ret);
-               return ret;
        }
 
-       return 0;
+       return ret;
 }
 
 int stt_engine_check_app_agreed(int engine_id, const char* appid, bool* value)
@@ -587,10 +584,9 @@ int stt_engine_check_app_agreed(int engine_id, const char* appid, bool* value)
        if (0 != ret) {
                SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] Fail to get app agreement : %s", __stt_get_engine_error_code(ret));
                *value = false;
-               return ret;
        }
 
-       return 0;
+       return ret;
 }
 
 /* Recognition */
@@ -612,10 +608,9 @@ int stt_engine_recognize_start(int engine_id, const char* lang, const char* reco
        if (0 != ret) {
                SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] Fail to start recognition : %s", __stt_get_engine_error_code(ret));
                SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] Fail to start recognition : lang(%s), recognition_type(%s), credential(%s)", lang, recognition_type, credential);
-               return ret;
        }
 
-       return 0;
+       return ret;
 }
 
 int stt_engine_set_recording_data(int engine_id, const void* data, unsigned int length)
@@ -635,10 +630,9 @@ int stt_engine_set_recording_data(int engine_id, const void* data, unsigned int
        int ret = engine->pefuncs->set_recording(data, length);
        if (0 != ret) {
                SLOG(LOG_WARN, stt_tag(), "[Engine WARNING] Fail to set recording : %s", __stt_get_engine_error_code(ret));
-               return ret;
        }
 
-       return 0;
+       return ret;
 }
 
 int stt_engine_recognize_stop(int engine_id)
@@ -653,10 +647,9 @@ int stt_engine_recognize_stop(int engine_id)
        int ret = engine->pefuncs->stop();
        if (0 != ret) {
                SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] Fail to stop : %s", __stt_get_engine_error_code(ret));
-               return ret;
        }
 
-       return 0;
+       return ret;
 }
 
 int stt_engine_recognize_cancel(int engine_id)
@@ -671,10 +664,9 @@ int stt_engine_recognize_cancel(int engine_id)
        int ret = engine->pefuncs->cancel();
        if (0 != ret) {
                SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] Fail to cancel : %s", __stt_get_engine_error_code(ret));
-               return ret;
        }
 
-       return 0;
+       return ret;
 }
 
 int stt_engine_foreach_result_time(int engine_id, void* time_info, sttpe_result_time_cb callback, void* user_data)
@@ -689,10 +681,9 @@ int stt_engine_foreach_result_time(int engine_id, void* time_info, sttpe_result_
        int ret = engine->pefuncs->foreach_result_time(time_info, callback, user_data);
        if (0 != ret) {
                SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] Fail to foreach result time : %s", __stt_get_engine_error_code(ret));
-               return ret;
        }
 
-       return 0;
+       return ret;
 }
 
 int stt_engine_recognize_start_file(int engine_id, const char* lang, const char* recognition_type, 
@@ -718,10 +709,9 @@ int stt_engine_recognize_start_file(int engine_id, const char* lang, const char*
        int ret = engine->pefuncs->start_file(lang, recognition_type, filepath, audio_type, sample_rate, user_param);
        if (0 != ret) {
                SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] Fail to start file recognition : %s", __stt_get_engine_error_code(ret));
-               return ret;
        }
 
-       return 0;
+       return ret;
 }
 
 int stt_engine_recognize_cancel_file(int engine_id)
@@ -741,8 +731,7 @@ int stt_engine_recognize_cancel_file(int engine_id)
        int ret = engine->pefuncs->cancel_file();
        if (0 != ret) {
                SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] Fail to start file recognition : %s", __stt_get_engine_error_code(ret));
-               return ret;
        }
 
-       return 0;
+       return ret;
 }
index 3b47936..a2c9e74 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved 
+*  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
index dcecd94..8538e80 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved
+*  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
index fbda52d..612ff38 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved 
+*  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
index 25bc85b..6c5b97c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
  *
  * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
index 113cb1c..9fecdaa 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
  *
  * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
@@ -55,7 +55,8 @@ typedef enum {
        STT_ERROR_NO_SPEECH                     = TIZEN_ERROR_STT | 0x06,       /**< No speech while recording */
        STT_ERROR_IN_PROGRESS_TO_READY          = TIZEN_ERROR_STT | 0x07,       /**< Progress to ready is not finished */
        STT_ERROR_IN_PROGRESS_TO_RECORDING      = TIZEN_ERROR_STT | 0x08,       /**< Progress to recording is not finished */
-       STT_ERROR_IN_PROGRESS_TO_PROCESSING     = TIZEN_ERROR_STT | 0x09        /**< Progress to processing is not finished */
+       STT_ERROR_IN_PROGRESS_TO_PROCESSING     = TIZEN_ERROR_STT | 0x09,       /**< Progress to processing is not finished */
+       STT_ERROR_RECORDING_TIMED_OUT           = TIZEN_ERROR_STT | 0x10        /**< Recording timed out */
 } stt_error_e;
 
 /**
@@ -794,6 +795,8 @@ int stt_start(stt_h stt, const char* language, const char* type);
  * @retval #STT_ERROR_INVALID_STATE Invalid state
  * @retval #STT_ERROR_OPERATION_FAILED Operation failure
  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_IN_PROGRESS_TO_READY Progress to ready is not finished
+ * @retval #STT_ERROR_IN_PROGRESS_TO_RECORDING Progress to recording is not finished
  * @retval #STT_ERROR_IN_PROGRESS_TO_PROCESSING Progress to processing is not finished
  *
  * @pre The state should be #STT_STATE_RECORDING.
@@ -826,6 +829,8 @@ int stt_stop(stt_h stt);
  * @retval #STT_ERROR_OPERATION_FAILED Operation failure
  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
  * @retval #STT_ERROR_IN_PROGRESS_TO_READY Progress to ready is not finished
+ * @retval #STT_ERROR_IN_PROGRESS_TO_RECORDING Progress to recording is not finished
+ * @retval #STT_ERROR_IN_PROGRESS_TO_PROCESSING Progress to processing is not finished
  *
  * @pre The state should be #STT_STATE_RECORDING or #STT_STATE_PROCESSING.
  * @post It will invoke stt_state_changed_cb(), if you register a callback with stt_state_changed_cb(). \n
old mode 100755 (executable)
new mode 100644 (file)
index eb06246..01a6a73
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
  *
  * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
old mode 100755 (executable)
new mode 100644 (file)
index 352a43a..13f90f0
@@ -1,5 +1,5 @@
 /*
-*  Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved 
+*  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
index 8da0df2..fafb50d 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved
+*  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
old mode 100755 (executable)
new mode 100644 (file)
index c5115d9..a1bc732
@@ -1,5 +1,5 @@
 /*
-*  Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved 
+*  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
index 71af39d..cedd5d7 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved
+*  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
index 1f58534..f6d4c99 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved 
+*  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
index 73646d8..b30a35a 100644 (file)
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved
+* Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
@@ -515,6 +515,9 @@ int sttd_dbus_close_connection()
        dbus_connection_close(g_conn_listener);
        dbus_connection_close(g_conn_sender);
 
+       dbus_connection_unref(g_conn_sender);
+       dbus_connection_unref(g_conn_listener);
+
        g_conn_listener = NULL;
        g_conn_sender = NULL;
 
index 9311eca..91d81af 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved 
+*  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
index 47aa97b..e2266b8 100644 (file)
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved
+* Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
@@ -640,7 +640,7 @@ int sttd_dbus_server_get_private_data(DBusConnection* conn, DBusMessage* msg)
                dbus_error_free(&err);
                ret = STTD_ERROR_OPERATION_FAILED;
        } else {
-               SLOG(LOG_DEBUG, TAG_STTD, "[IN] stt get private data : uid(%d)", uid);
+               SLOG(LOG_DEBUG, TAG_STTD, "[IN] stt get private data : uid(%d), key(%s)", uid, (NULL == key) ? "NULL" : key);
                ret = sttd_server_get_private_data(uid, key, &data);
        }
 
@@ -655,7 +655,7 @@ int sttd_dbus_server_get_private_data(DBusConnection* conn, DBusMessage* msg)
                        DBUS_TYPE_INVALID);
 
                if (0 == ret) {
-                       SLOG(LOG_DEBUG, TAG_STTD, "[OUT SUCCESS] Result(%d)", ret);
+                       SLOG(LOG_DEBUG, TAG_STTD, "[OUT SUCCESS] Result(%d), data(%s)", ret, (NULL == data) ? "NULL" : data);
                } else {
                        SLOG(LOG_ERROR, TAG_STTD, "[OUT ERROR] Result(%d)", ret);
                }
index 34210f7..bb629c1 100644 (file)
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved 
+* Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
index b316993..a00e33e 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved
+*  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
@@ -875,10 +875,9 @@ int sttd_engine_agent_supported_langs(int uid, GSList** lang_list)
        int ret = stt_engine_get_supported_langs(engine->engine_id, lang_list);
        if (0 != ret) {
                SLOG(LOG_ERROR, TAG_STTD, "[Engine Agent ERROR] get language list error(%d)", ret);
-               return ret;
        }
 
-       return 0;
+       return ret;
 }
 
 int sttd_engine_agent_get_default_lang(int uid, char** lang)
@@ -953,10 +952,9 @@ int sttd_engine_agent_set_private_data(int uid, const char* key, const char* dat
        ret = stt_engine_set_private_data(engine->engine_id, key, data);
        if (0 != ret) {
                SLOG(LOG_ERROR, TAG_STTD, "[Engine Agent ERROR] Fail to set private data");
-               return ret;
        }
 
-       return 0;
+       return ret;
 }
 
 int sttd_engine_agent_get_private_data(int uid, const char* key, char** data)
@@ -989,10 +987,9 @@ int sttd_engine_agent_get_private_data(int uid, const char* key, char** data)
        ret = stt_engine_get_private_data(engine->engine_id, key, data);
        if (0 != ret) {
                SLOG(LOG_ERROR, TAG_STTD, "[Engine Agent ERROR] Fail to get private data");
-               return ret;
        }
 
-       return 0;
+       return ret;
 }
 
 int sttd_engine_agent_get_option_supported(int uid, bool* silence)
@@ -1299,10 +1296,9 @@ int sttd_engine_agent_set_recording_data(int uid, const void* data, unsigned int
        int ret = stt_engine_set_recording_data(engine->engine_id, data, length);
        if (0 != ret) {
                SLOG(LOG_WARN, TAG_STTD, "[Engine Agent WARNING] set recording error(%d)", ret);
-               return ret;
        }
 
-       return 0;
+       return ret;
 }
 
 int sttd_engine_agent_recognize_stop_recorder(int uid)
index 35e93cc..e0ba814 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved 
+*  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
index 7fd2cd2..1d64720 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved 
+*  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
index b75ade7..31655dc 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved 
+*  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
@@ -53,7 +53,8 @@ typedef enum {
        STTD_ERROR_ENGINE_NOT_FOUND             = TIZEN_ERROR_STT | 0x03,       /**< No available engine  */    
        STTD_ERROR_OPERATION_FAILED             = TIZEN_ERROR_STT | 0x04,       /**< Operation failed  */
        STTD_ERROR_NOT_SUPPORTED_FEATURE        = TIZEN_ERROR_STT | 0x05,       /**< Not supported feature of current engine */
-       STTD_ERROR_NO_SPEECH                    = TIZEN_ERROR_STT | 0x06        /**< No speech while recording */
+       STTD_ERROR_NO_SPEECH                    = TIZEN_ERROR_STT | 0x06,       /**< No speech while recording */
+       STTD_ERROR_RECORDING_TIMED_OUT          = TIZEN_ERROR_STT | 0x10        /**< Recording timed out */
 } stt_error_e;
 
 typedef enum {
index 629fb35..a1136c9 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved
+*  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
index 38cc0c4..7cf6946 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved 
+*  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
index 8ea0fd2..47bea93 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved
+*  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
index 91a3899..ec77117 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved 
+*  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
index e1f7032..72366b1 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved
+*  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
@@ -44,7 +44,8 @@ typedef enum {
        STTP_ERROR_ENGINE_NOT_FOUND             = TIZEN_ERROR_STT | 0x03,       /**< No available engine  */
        STTP_ERROR_OPERATION_FAILED             = TIZEN_ERROR_STT | 0x04,       /**< Operation failed  */
        STTP_ERROR_NOT_SUPPORTED_FEATURE        = TIZEN_ERROR_STT | 0x05,       /**< Not supported feature of current engine */
-       STTP_ERROR_NO_SPEECH                    = TIZEN_ERROR_STT | 0x06        /**< No speech while recording */
+       STTP_ERROR_NO_SPEECH                    = TIZEN_ERROR_STT | 0x06,       /**< No speech while recording */
+       STTP_ERROR_RECORDING_TIMED_OUT          = TIZEN_ERROR_STT | 0x10        /**< Recording timed out */
 }sttp_error_e;
 
 /**
@@ -357,6 +358,7 @@ typedef int (*sttpe_foreach_result_time)(void* time_info, sttpe_result_time_cb c
 * @retval #STTP_ERROR_INVALID_LANGUAGE Invalid language
 * @retval #STTP_ERROR_OPERATION_FAILED Operation failed
 * @retval #STTP_ERROR_OUT_OF_NETWORK Out of network
+* @retval #STTP_ERROR_PERMISSION_DENIED Permission denied
 *
 * @pre The engine is not in recognition processing.
 *
old mode 100755 (executable)
new mode 100644 (file)
index 03a99c8..5d98a06
@@ -1,5 +1,5 @@
 /*
-*  Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved
+*  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at