return 0;
}
-int __ma_cb_error(int reason, char* msg)
+int __ma_cb_error(int reason, char* msg, int notify)
{
ma_state_e state;
if (0 != ma_client_get_client_state(g_ma, &state)) {
__ma_notify_state_changed((void*)g_ma);
}
- MA_SLOGE("[ERROR] Error reason(%d), msg(%s)", reason, msg); //LCOV_EXCL_LINE
+ MA_SLOGE("[ERROR] Error reason(%d), msg(%s), notify(%d)", reason, msg, notify); //LCOV_EXCL_LINE
ma_client_set_error(g_ma, reason);
- __ma_notify_error((void*)g_ma);
+ if (notify) {
+ __ma_notify_error((void*)g_ma);
+ }
if (MA_ERROR_SERVICE_RESET == reason) {
if (0 != ma_prepare()) {
static DBusConnection* g_conn_listener = NULL;
static bool g_streaming_requested = false;
+static bool g_restart_notification_received = false;
-extern int __ma_cb_error(int reason, char* msg);
+extern int __ma_cb_error(int reason, char* msg, int notify);
extern int __ma_cb_audio_streaming(int event, char* buffer, int len);
extern int __ma_cb_active_state_changed(int state, const char* wakeup_word,
const unsigned char* extra_data, int extra_data_length, const char* extra_data_desc);
//LCOV_EXCL_STOP
} else {
MA_SLOGD("@@ multi-assistant Get Error message : reason(%d), msg(%s)", reason, err_msg); //LCOV_EXCL_LINE
- __ma_cb_error(reason, err_msg);
+ __ma_cb_error(reason, err_msg, TRUE);
}
} /* MAS_METHOD_ERROR */
+ else if (dbus_message_is_signal(msg, if_name, MAS_METHOD_RESTART_NOTIFICATION)) {
+ MA_SLOGE("RESTART NOTIFICATION RECEIVED");
+ g_restart_notification_received = true;
+ } /* MAS_METHOD_RESTART_NOTIFICATION */
+
else if (dbus_message_is_signal(msg, "org.freedesktop.DBus", "NameOwnerChanged")) {
//LCOV_EXCL_START
MA_SLOGD("[DEBUG] Owner Changed"); //LCOV_EXCL_LINE
dbus_error_free(&err);
}
- __ma_cb_error(MA_ERROR_SERVICE_RESET, "Daemon Reset");
+ __ma_cb_error(MA_ERROR_SERVICE_RESET, "Daemon Reset", g_restart_notification_received ? FALSE : TRUE);
+ g_restart_notification_received = false;
//LCOV_EXCL_STOP
} /* NameOwnerChanged */
#define MAS_METHOD_STREAMING_AUDIO_DATA "mas_method_streaming_audio_data"
#define MAS_METHOD_WAKEUP_ENGINE_COMMAND "mas_method_wakeup_engine_command"
#define MAS_METHOD_ERROR "mas_method_error"
+#define MAS_METHOD_RESTART_NOTIFICATION "mas_method_restart_notification"
#define MAS_METHOD_SEND_PREPROCESSING_INFORMATION "mas_method_send_preprocessing_information"
#define MAS_METHOD_AUDIO_STREAMING_DATA_SECTION "mas_method_audio_streaming_data_section"
#define MAS_METHOD_SEND_PREPROCESSING_RESULT "mas_method_send_preprocessing_result"