[UTC][non-ACR][stt] Add a logic to check microphone feature 06/274606/2
authorsooyeon <sooyeon.kim@samsung.com>
Tue, 3 May 2022 16:58:48 +0000 (01:58 +0900)
committersooyeon <sooyeon.kim@samsung.com>
Wed, 4 May 2022 17:17:31 +0000 (02:17 +0900)
Change-Id: If1c1915e09116d504bcbf9d5218a8feea98d93dc
Signed-off-by: sooyeon <sooyeon.kim@samsung.com>
src/utc/stt/utc-stt.c
src/utc/stt/utc-stte.c

index beeeddfaeaed921a5d20047dd7f900ece11dd272..0a9e03ea2c8ca1301d52f3fbf6b3945c235963c9 100755 (executable)
 #include <Ecore.h>
 
 #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;
 
index 923be7ffd526ba0c891d108657bb574a57ceee80..bdd40accd51580483e482fb7c437b39bfe4ead84 100755 (executable)
 #include <dlog.h>
 
 #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;