From: Ji-hoon Lee Date: Mon, 6 Apr 2020 10:16:18 +0000 (+0900) Subject: Fix defects detected by static analysis tool X-Git-Tag: submit/tizen/20200409.014926^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d9b8161ebd21e4da84d0ddaa4c1f4adbfce32ec5;p=platform%2Fcore%2Fuifw%2Fmulti-assistant-service.git Fix defects detected by static analysis tool Change-Id: I9af8980b3d3f15ded3fa261ec957debe7adc5365 --- diff --git a/inc/service_config.h b/inc/service_config.h index 5a87e0f..5604ed2 100644 --- a/inc/service_config.h +++ b/inc/service_config.h @@ -28,9 +28,6 @@ extern "C" { #endif -#define MAX_WAKEUP_LIST_NUM 32 -#define MAX_SUPPORTED_LANGUAGE_NUM 128 - /************************************************************************************** *** Definitions for xml file *************************************************************************************/ @@ -79,10 +76,10 @@ typedef struct ma_assistant_info_s { const char* app_id; const char* name; const char* icon_path; - const char* wakeup_list[MAX_WAKEUP_LIST_NUM]; - const char* wakeup_language[MAX_WAKEUP_LIST_NUM]; + const char* wakeup_list[MAX_WAKEUP_WORDS_NUM]; + const char* wakeup_language[MAX_WAKEUP_WORDS_NUM]; int cnt_wakeup; - const char* supported_lang[MAX_SUPPORTED_LANGUAGE_NUM]; + const char* supported_lang[MAX_SUPPORTED_LANGUAGES_NUM]; int cnt_lang; const char* wakeup_engine; bool custom_ui_option; diff --git a/plugins/wakeup-manager/inc/wakeup_manager.h b/plugins/wakeup-manager/inc/wakeup_manager.h index 3b6a00b..8e98d93 100644 --- a/plugins/wakeup-manager/inc/wakeup_manager.h +++ b/plugins/wakeup-manager/inc/wakeup_manager.h @@ -226,7 +226,8 @@ private: bool mVoiceKeyPressed{false}; string mCurrentLanguage; string mCurrentDefaultAssistant; - VOICE_KEY_SUPPORT_MODE mCurrentVoiceKeySupportMode; + /* Assume Push-to-talk is the default mode */ + VOICE_KEY_SUPPORT_MODE mCurrentVoiceKeySupportMode{VOICE_KEY_SUPPORT_MODE_PUSH_TO_TALK}; STREAMING_MODE mStreamingMode{STREAMING_MODE::NONE}; Ecore_Timer* mStreamingDurationTimer{nullptr}; @@ -239,4 +240,4 @@ private: } // wakeup } // multiassistant -#endif /* _WAKEUP_MANAGER_H_ */ \ No newline at end of file +#endif /* _WAKEUP_MANAGER_H_ */ diff --git a/plugins/wakeup-manager/src/wakeup_manager.cpp b/plugins/wakeup-manager/src/wakeup_manager.cpp index bce479c..e7cdbf0 100644 --- a/plugins/wakeup-manager/src/wakeup_manager.cpp +++ b/plugins/wakeup-manager/src/wakeup_manager.cpp @@ -509,6 +509,7 @@ bool CWakeupManager::change_voice_key_status(ma_voice_key_status_e status) { MA_VOICE_KEY_STATUS_RELEASED_AFTER_TAP == status) { mVoiceKeyPressed = false; } + return true; } bool CWakeupManager::process_plugin_event(mas_plugin_event_e event, void* data, int len) diff --git a/src/service_main.cpp b/src/service_main.cpp index b3d4dff..4628c15 100644 --- a/src/service_main.cpp +++ b/src/service_main.cpp @@ -609,7 +609,7 @@ int CServiceMain::initialize_service_plugin(void) } } } - for (inner_loop = 0; inner_loop < MAX_SUPPORTED_LANGUAGE_NUM; inner_loop++) { + for (inner_loop = 0; inner_loop < MAX_SUPPORTED_LANGUAGES_NUM; inner_loop++) { if (mClientInfo[loop].supported_language[inner_loop] && 0 < strlen(mClientInfo[loop].supported_language[inner_loop])) { MAS_LOGD("Adding language %s for app %s",