From: sooyeon Date: Tue, 3 May 2022 16:58:48 +0000 (+0900) Subject: [UTC][non-ACR][stt] Add a logic to check microphone feature X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ec578f4ee77d30e4cdf924efbe040e856659d967;p=test%2Ftct%2Fnative%2Fapi.git [UTC][non-ACR][stt] Add a logic to check microphone feature Change-Id: If1c1915e09116d504bcbf9d5218a8feea98d93dc Signed-off-by: sooyeon --- diff --git a/src/utc/stt/utc-stt.c b/src/utc/stt/utc-stt.c index beeeddfae..0a9e03ea2 100755 --- a/src/utc/stt/utc-stt.c +++ b/src/utc/stt/utc-stt.c @@ -22,8 +22,12 @@ #include #include "assert.h" +#include "tct_common.h" //& set: Stt +#define API_NAMESPACE "STT_UTC" +#define MICROPHONE_FEATURE "http://tizen.org/feature/microphone" +#define SPEECH_RECOGNITION_FEATURE "http://tizen.org/feature/speech.recognition" #define assert_eq_with_reset_TC_mode(ret, exp) do { \ if (ret != exp) { \ @@ -47,8 +51,9 @@ void utc_stt_startup(void) { /* start of TC */ int ret = -1; - g_stt_supported = false; - system_info_get_platform_bool("http://tizen.org/feature/speech.recognition", &g_stt_supported); + g_stt_supported = TCTCheckSystemInfoFeatureSupported(MICROPHONE_FEATURE, API_NAMESPACE) && + TCTCheckSystemInfoFeatureSupported(SPEECH_RECOGNITION_FEATURE, API_NAMESPACE); + g_current_state = 0; g_error = TIZEN_ERROR_NONE; diff --git a/src/utc/stt/utc-stte.c b/src/utc/stt/utc-stte.c index 923be7ffd..bdd40accd 100755 --- a/src/utc/stt/utc-stte.c +++ b/src/utc/stt/utc-stte.c @@ -21,6 +21,11 @@ #include #include "assert.h" +#include "tct_common.h" + +#define API_NAMESPACE "STT_UTC" +#define MICROPHONE_FEATURE "http://tizen.org/feature/microphone" +#define SPEECH_RECOGNITION_FEATURE "http://tizen.org/feature/speech.recognition" extern void transfer_arg(int * argc, char ** argv[]); @@ -153,7 +158,8 @@ static int __engine_audio_type_cb(const char* audio_type, void* user_data) void utc_stte_startup(void) { /* start of TC */ - system_info_get_platform_bool("http://tizen.org/feature/speech.recognition", &g_is_supported); + g_is_supported = TCTCheckSystemInfoFeatureSupported(MICROPHONE_FEATURE, API_NAMESPACE) && + TCTCheckSystemInfoFeatureSupported(SPEECH_RECOGNITION_FEATURE, API_NAMESPACE); if (g_is_supported == false) return;