* limitations under the License.
*/
+#include <aul.h>
#include <Ecore.h>
+#include <vconf.h>
#include "stt_engine.h"
#include "stt_defs.h"
#include "stte.h"
+static bool __is_default_engine()
+{
+ char* engine = NULL;
+ engine = vconf_get_str(VCONFKEY_STT_ENGINE_DEFAULT);
+ if (NULL == engine) {
+ SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to get sting for stt engine");
+ return FALSE;
+ }
+
+ char appid[1024] = {'\0', };
+ if (0 != aul_app_get_appid_bypid(getpid(), appid, sizeof(appid) - 1)) {
+ SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to get callee appid by pid");
+ }
+
+ SLOG(LOG_DEBUG, TAG_STTD, "[Server] STT Default Engine(%s), appId(%s)", engine, appid);
+ if (0 == strncmp(engine, appid, strlen(engine))) {
+ free(engine);
+ return TRUE;
+ }
+ free(engine);
+ return FALSE;
+}
int stte_main(int argc, char**argv, stte_request_callback_s *callback)
{
return STTE_ERROR_OPERATION_FAILED;
}
- if (0 != sttd_dbus_open_connection()) {
- SLOG(LOG_ERROR, TAG_STTD, "[ERROR] Fail to open connection");
- ecore_shutdown();
- return STTE_ERROR_OPERATION_FAILED;
+ if (TRUE == __is_default_engine()) {
+ if (0 != sttd_dbus_open_connection()) {
+ SLOG(LOG_ERROR, TAG_STTD, "[ERROR] Fail to open connection");
+ ecore_shutdown();
+ return STTE_ERROR_OPERATION_FAILED;
+ }
}
ret = sttd_initialize(callback);