#define MA_METHOD_SEND_ASSISTANT_SPECIFIC_COMMAND "ma_method_send_assistant_specific_command"
#define MA_METHOD_SET_BACKGROUND_VOLUME "ma_method_set_background_volume"
#define MA_METHOD_SET_PREPROCESSING_ALLOW_MODE "ma_method_set_preprocessing_allow_mode"
+#define MA_METHOD_SEND_PREPROCESSING_RESULT "ma_method_send_preprocessing_result"
#define MA_METHOD_ERROR "ma_method_error"
#define MA_UI_METHOD_INITIALIZE "ma_ui_method_initialize"
int mas_client_set_preprocessing_allow_mode(int pid, int mode, const char* appid);
+int mas_client_send_preprocessing_result(int pid, bool result);
+
int mas_client_update_recognition_result(int pid, int result);
int mas_ui_client_initialize(int pid);
} else if (dbus_message_is_method_call(msg, MA_SERVER_SERVICE_INTERFACE, MA_METHOD_SET_PREPROCESSING_ALLOW_MODE)) {
ma_service_dbus_set_preprocessing_allow_mode(g_conn_listener, msg);
+ } else if (dbus_message_is_method_call(msg, MA_SERVER_SERVICE_INTERFACE, MA_METHOD_SEND_PREPROCESSING_RESULT)) {
+ ma_service_dbus_send_preprocessing_result(g_conn_listener, msg);
+
} else if (dbus_message_is_method_call(msg, MA_SERVER_SERVICE_INTERFACE, MA_UI_METHOD_INITIALIZE)) {
ma_service_ui_dbus_initialize(g_conn_listener, msg);
return 0;
}
+int ma_service_dbus_send_preprocessing_result(DBusConnection* conn, DBusMessage* msg)
+{
+ DBusError err;
+ dbus_error_init(&err);
+
+ int pid;
+ int ret = 0;
+ int result;
+
+ dbus_message_get_args(msg, &err,
+ DBUS_TYPE_INT32, &pid,
+ DBUS_TYPE_INT32, &result,
+ DBUS_TYPE_INVALID);
+
+ MAS_LOGD("[DEBUG] MAS SEND PREPROCESSING RESULT");
+
+ if (dbus_error_is_set(&err)) {
+ MAS_LOGE("[IN ERROR] mas send preprocessing result : Get arguments error (%s)", err.message);
+ dbus_error_free(&err);
+ ret = -1; //MAS_ERROR_OPERATION_FAILED;
+ } else {
+ MAS_LOGD("[IN] mas send preprocessing result : pid(%d), result(%d)", pid, result);
+ ret = mas_client_send_preprocessing_result(pid, (bool)result);
+ }
+
+ MAS_LOGD("<<<<<");
+ MAS_LOGD(" ");
+
+ return 0;
+}
+
int ma_service_ui_dbus_initialize(DBusConnection* conn, DBusMessage* msg)
{
DBusError err;
int ma_service_dbus_set_preprocessing_allow_mode(DBusConnection* conn, DBusMessage* msg);
+int ma_service_dbus_send_preprocessing_result(DBusConnection* conn, DBusMessage* msg);
+
int ma_service_ui_dbus_initialize(DBusConnection* conn, DBusMessage* msg);
int ma_service_ui_dbus_deinitialize(DBusConnection* conn, DBusMessage* msg);
return 0;
}
+int mas_client_send_preprocessing_result(int pid, bool result)
+{
+ const char* pid_appid = NULL;
+ char buf[MAX_APPID_LEN] = {'\0',};
+ if (AUL_R_OK == aul_app_get_appid_bypid(pid, buf, sizeof(buf))) {
+ buf[MAX_APPID_LEN - 1] = '\0';
+ pid_appid = buf;
+ }
+ if (!is_current_preprocessing_assistant(pid_appid)) return -1;
+
+ if (result) {
+ mas_process_preprocessing_state_event(PREPROCESSING_STATE_EVENT_PREPROCESSING_SUCCEEDED);
+ } else {
+ mas_process_preprocessing_state_event(PREPROCESSING_STATE_EVENT_PREPROCESSING_FAILED);
+ }
+ return 0;
+}
+
int mas_client_update_recognition_result(int pid, int state)
{
multi_assistant_service_plugin_update_recognition_result(NULL, state);