Adopt function name changes in API Review process 75/229175/1 submit/tizen_5.5/20200409.014144
authorJi-hoon Lee <dalton.lee@samsung.com>
Mon, 30 Mar 2020 06:40:52 +0000 (15:40 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Mon, 30 Mar 2020 06:50:55 +0000 (15:50 +0900)
The function 'ma_set_assistant_language' has been renamed
to 'ma_set_assistant_wakeup_language' during the Tizen API
6.0 review phase. In order to provide a functionality
with the same name, while also supporting backward compatibility,
decided to temporarily provide an alias function with the name
that the function had before.

Change-Id: Ia62fe1ab176c9d6b96f5478d84f687488a0af4f1

client/ma.c
client/ma_dbus.c
client/ma_dbus.h
common/ma_defs.h
include/multi_assistant_internal.h

index 27eb0b4c557ff29a3375ce647a60fd62b36c3116..041aadf0e4d63f7ab9f6dc96038c1412b3ee130e 100644 (file)
@@ -2160,12 +2160,23 @@ int ma_unset_preprocessing_result_received_cb(void)
 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");
@@ -2179,13 +2190,13 @@ int ma_set_assistant_language(const char* language)
                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");
        }
index ceeadc0ad460a1a5785c28fee38969f2075e2885..b2724c564a1812faab7bf40969672a0004b960d7 100644 (file)
@@ -1579,7 +1579,7 @@ int ma_dbus_set_wake_word_audio_require_flag(int pid, bool require)
        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;
@@ -1591,13 +1591,13 @@ int ma_dbus_set_assistant_language(int pid, const char* language)
                          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;
index 304847935263d4a9bfa8f2c044ea3550b7525901..f74a1b5489f76ec4035cb250cfa0ecf59c75b847 100644 (file)
@@ -63,7 +63,7 @@ int ma_dbus_send_preprocessing_result(int pid, bool result);
 
 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
 }
index 3456a509382118306da89c4a7ee7d6c7085cd82b..c646763c88a32a9244959b3945950112f3350dd4 100644 (file)
@@ -81,7 +81,7 @@ extern "C"
 #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"
index 9e16dc049272fcde18e37a9661980cda2b881cb3..097b191a3388182577635da2fab65190ea4ccd95 100644 (file)
@@ -24,10 +24,14 @@ extern "C"
 #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.
@@ -37,10 +41,31 @@ extern "C"
  * @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