From: Caisking <3449750381@qq.com> Date: Sat, 18 Jan 2025 03:44:20 +0000 (+0800) Subject: 语音助手:增加使用语音助手的情况下不进行弹窗 X-Git-Tag: v1.3.113-repair_tp~21^2~4 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=26a50313b8471edec050ad4481085c71ef477ffb;p=mirrors%2FFD230.git 语音助手:增加使用语音助手的情况下不进行弹窗 --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/assistant/src/AssistantModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/assistant/src/AssistantModel.cpp index 75ccc7e73..a9bd8801b 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/assistant/src/AssistantModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/assistant/src/AssistantModel.cpp @@ -145,6 +145,8 @@ bool AssistantModel::GetHFPStatus(void) { bool AssistantModel::StartAssistant(void) { if (uapi_open_voice_recognition() == 0) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "uapi_open_voice_recognition is ok"); + //成功开启语音助手 + uapi_dev_runtime_set_voice_status(1); return true; } WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, @@ -153,7 +155,6 @@ bool AssistantModel::StartAssistant(void) { } //关闭语音助手 void AssistantModel::StopAssistant(void) { - if (uapi_close_voice_recognition() == 0) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "uapi_close_voice_recognition is ok"); @@ -175,6 +176,8 @@ bool AssistantModel::ChangeToMainView(void) { ->IsVisible() == true && p_AssistantView->GetAssistantScrollView(ASSISTANT_MAIN_VIEW) ->IsVisible() == false) { + //设置退出状态 + uapi_dev_runtime_set_voice_status(0); p_AssistantView->ChangeView(ASSISTANT_ANSWER_VIEW, ASSISTANT_MAIN_VIEW); WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "退出语音助手成功\r\n"); } diff --git a/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageModel.cpp index 83d04231f..9566ae16b 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageModel.cpp @@ -207,9 +207,17 @@ static void Notify(void *args, const Topic topic, Request *request) { messageTimestamp = currentTimestamp; + /* + 以下状态不进行消息弹窗 + -训练中 + -省电模式 + -呼吸训练中 + -使用语音助手 + */ if (uapi_dev_runtime_get_train_status() || uapi_dev_runtime_get_saveele_status() || - uapi_dev_runtime_get_respiratory_training_status()) { + uapi_dev_runtime_get_respiratory_training_status() || + uapi_dev_runtime_get_voice_status()) { free(messageInfo_.title); free(messageInfo_.msg); @@ -533,8 +541,6 @@ void MessageModel::AddMessageData(ancs_data_info_t *messageInfo) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "messageInfo add is ok"); } - - // 获取目前的项 MessageData *MessageModel::GetCurrentMessageData() { if (currentIndex_ < MessageVector.size()) { diff --git a/code/sdk/drivers/peripheral/utils/custom_runtime.c b/code/sdk/drivers/peripheral/utils/custom_runtime.c index 04e1656b8..c316da099 100644 --- a/code/sdk/drivers/peripheral/utils/custom_runtime.c +++ b/code/sdk/drivers/peripheral/utils/custom_runtime.c @@ -106,6 +106,7 @@ typedef struct uint8_t transmitting_status;//是否处于ble传输状态 uint8_t atuoota_status;//是否处于自动ota状态 + uint8_t voice_status;//是否处于使用语音助手 } runtime_status_t; @@ -609,6 +610,15 @@ uint8_t uapi_dev_runtime_get_heartrate_detect_status(void) { return g_runtime.heartrate_detect_status; } +//设置是否在使用语音助手功能 +void uapi_dev_runtime_set_voice_status(uint8_t status) +{ + g_runtime.voice_status = status; +} +uint8_t uapi_dev_runtime_get_voice_status(void) +{ + return g_runtime.voice_status; +} // 设置是否为指南针页面状态 void uapi_dev_runtime_set_mmc_status(uint8_t status) { diff --git a/code/sdk/drivers/peripheral/utils/custom_runtime.h b/code/sdk/drivers/peripheral/utils/custom_runtime.h index 147df7a06..1f414c9be 100644 --- a/code/sdk/drivers/peripheral/utils/custom_runtime.h +++ b/code/sdk/drivers/peripheral/utils/custom_runtime.h @@ -285,6 +285,9 @@ void uapi_dev_runtime_set_safemode_flag(uint8_t status); // 安全模式 uint8_t uapi_dev_runtime_get_safemode_flag(void); +//是否使用语音助手状态 +void uapi_dev_runtime_set_voice_status(uint8_t status); +uint8_t uapi_dev_runtime_get_voice_status(void); void uapi_dev_runtime_set_hrs_passivity(uint8_t status); // 获取被动心率检测状态