SLOG(LOG_DEBUG, TAG_STTC, "<<<< stt initialize : result = %d, silence(%d), credential(%d)",
result, *silence_supported, *credential_needed);
- /* add a rule for daemon error */
- char rule_err[256] = {0, };
- snprintf(rule_err, 256, "sender='org.freedesktop.DBus',path='/org/freedesktop/DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',type='signal',arg0='%s'", g_server_service_interface);
- dbus_bus_add_match(g_conn_listener, rule_err, &err);
- dbus_connection_flush(g_conn_listener);
-
- if (dbus_error_is_set(&err)) {
- SLOG(LOG_ERROR, TAG_STTC, "Match Error (%s)", err.message);
- dbus_error_free(&err);
+ stt_client_s* client = stt_client_get_by_uid(uid);
+ if (NULL == client) {
+ SLOG(LOG_ERROR, TAG_STTC, "Fail to get STT client");
return STT_ERROR_OPERATION_FAILED;
}
+
+ if (STT_ERROR_SERVICE_RESET != client->reason) {
+ /* add a rule for daemon error */
+ char rule_err[256] = {0, };
+
+ snprintf(rule_err, 256, "sender='org.freedesktop.DBus',path='/org/freedesktop/DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',type='signal',arg0='%s'", g_server_service_interface);
+ dbus_bus_add_match(g_conn_listener, rule_err, &err);
+ dbus_connection_flush(g_conn_listener);
+
+ if (dbus_error_is_set(&err)) {
+ SLOG(LOG_ERROR, TAG_STTC, "Match Error (%s)", err.message);
+ dbus_error_free(&err);
+ return STT_ERROR_OPERATION_FAILED;
+ }
+ }
} else {
SLOG(LOG_ERROR, TAG_STTC, "<<<< stt initialize : result = %d", result);
}