int ma_set_assistant_language(const char* language)
{
MA_SLOGD("[Manager] Set assistant language");
+ return ma_set_assistant_wakeup_language(language);
+}
+
+int ma_set_assistant_wakeup_language(const char* language)
+{
+ MA_SLOGD("[Manager] Set assistant wakeup language");
if (0 != __ma_get_feature_enabled()) {
MA_SLOGD("@@@ [Manager] not supported");
return MA_ERROR_NOT_SUPPORTED;
}
+ if (NULL == language) {
+ MA_SLOGE("[ERROR] Invalid parameter"); //LCOV_EXCL_LINE
+ return MA_ERROR_INVALID_PARAMETER;
+ }
+
ma_state_e state;
if (0 != ma_client_get_client_state(g_ma, &state)) {
MA_SLOGE("[ERROR] A handle is not available");
return MA_ERROR_INVALID_STATE;
}
- MA_SLOGI("[Client DEBUG] Set assistant language : %s", language);
+ MA_SLOGI("[Client DEBUG] Set assistant wakeup language : %s", language);
/* Set assistant language */
int pid = getpid();
- int ret = ma_dbus_set_assistant_language(pid, language);
+ int ret = ma_dbus_set_assistant_wakeup_language(pid, language);
if (0 != ret) {
- MA_SLOGW("[WARNING] Failed to set assistant language");
+ MA_SLOGW("[WARNING] Failed to set assistant wakeup language");
} else {
MA_SLOGD("[DEBUG] Success to set");
}
return 0;
}
-int ma_dbus_set_assistant_language(int pid, const char* language)
+int ma_dbus_set_assistant_wakeup_language(int pid, const char* language)
{
if (0 != __dbus_check()) {
return MA_ERROR_OPERATION_FAILED;
MA_SERVER_SERVICE_NAME,
MA_SERVER_SERVICE_OBJECT_PATH,
MA_SERVER_SERVICE_INTERFACE,
- MA_METHOD_SET_ASSISTANT_LANGUAGE);
+ MA_METHOD_SET_ASSISTANT_WAKEUP_LANGUAGE);
if (NULL == msg) {
- MA_SLOGE("@@ Request multi-assistant set assistant language : Fail to make message"); //LCOV_EXCL_LINE
+ MA_SLOGE("@@ Request multi-assistant set assistant wakeup language : Fail to make message"); //LCOV_EXCL_LINE
return MA_ERROR_OPERATION_FAILED;
} else {
- MA_SLOGD("[DEBUG] multi-assistant set assistant language");
+ MA_SLOGD("[DEBUG] multi-assistant set assistant wakeup language");
}
char* tmp_language = NULL;
int ma_dbus_set_wake_word_audio_require_flag(int pid, bool require);
-int ma_dbus_set_assistant_language(int pid, const char* language);
+int ma_dbus_set_assistant_wakeup_language(int pid, const char* language);
#ifdef __cplusplus
}
#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_SET_WAKE_WORD_AUDIO_REQUIRE_FLAG "ma_method_set_wake_word_audio_require_flag"
-#define MA_METHOD_SET_ASSISTANT_LANGUAGE "ma_method_set_assistant_language"
+#define MA_METHOD_SET_ASSISTANT_WAKEUP_LANGUAGE "ma_method_set_assistant_wakeup_language"
#define MA_METHOD_ERROR "ma_method_error"
#define MA_UI_METHOD_INITIALIZE "ma_ui_method_initialize"
#endif
/**
- * @brief Sets the voice language for the current assistant.
+ * @brief An alias for 'ma_set_assistant_wakeup_language' function.
+ * @details Since the function name has been change from 'ma_set_assistant_language'
+ * to 'ma_set_assistant_wakeup_language' during the API review phase,
+ * this function should be provided for supporting backward compatibility.
+ * It will be removed all references are replaced with the newly added API.
* @since_tizen 5.5
*
- * @param[in] language The language that will be used for the current assistant
+ * @param[in] language The language configuration that will be used for wake word detection.
* It should be denoted by two-letter code defined by IS 639-1,
* optionally combined with two-letter code defined by ISO 3166.
* For example, "ko_KR" for Korean, "en_US" for American English.
* @retval #MA_ERROR_NOT_SUPPORTED Not supported
* @retval #MA_ERROR_INVALID_STATE Invalid state
*
- * @pre The state should be #MA_STATE_INITIALIZED.
+ * @pre The state should be #MA_STATE_READY.
*/
int ma_set_assistant_language(const char* language);
+/**
+ * @brief Sets the language configuration for wake word detection.
+ * @details The language configuration of the assistant that invoked
+ * this function will be changed and language configurations
+ * of other assistants will remain unchanged.
+ * @since_tizen 5.5
+ *
+ * @param[in] language The language configuration that will be used for wake word detection.
+ * It should be denoted by two-letter code defined by IS 639-1,
+ * optionally combined with two-letter code defined by ISO 3166.
+ * For example, "ko_KR" for Korean, "en_US" for American English.
+ *
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #MA_ERROR_NONE Successful
+ * @retval #MA_ERROR_NOT_SUPPORTED Not supported
+ * @retval #MA_ERROR_INVALID_STATE Invalid state
+ *
+ * @pre The state should be #MA_STATE_READY.
+ */
+int ma_set_assistant_wakeup_language(const char* language);
+
/**
* @brief Enumerations for multi-assistant service state.
* @since_tizen 5.5