From: xue <2144439972@qq.com> Date: Sun, 2 Nov 2025 15:23:25 +0000 (+0800) Subject: 增加对话超时 X-Git-Tag: V1.0.9_20251128_194606_LN~122 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=fa24d6d06acea67d7244c27f62f87046765c9a5e;p=mirrors%2FFD230.git 增加对话超时 --- diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdPresenter.h b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdPresenter.h index 06b56f697..4c3af71cb 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdPresenter.h +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdPresenter.h @@ -38,6 +38,8 @@ namespace OHOS bool isDialogueing{false};//是否进入对话模式 bool powerKeyPressed{false};//电源键按下标志位,防止重复触发 + void SetDialogueing(bool dialogueing);//设置对话模式标志位 + // FUNC键长按功能 void RegisterFuncKeyLongPressEvent(void); void HandleFuncKeyLongPress(void); diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp index 7b073a8b8..a4c38ff8c 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp @@ -250,7 +250,7 @@ // ---------------------- 通用计时加一定时器(已整合到新定时器系统) ---------------------- void ThunderBirdModel::StartCountUpTimer(uint32_t targetSeconds) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "StartCountUpTimer: targetSeconds=%u", targetSeconds); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "StartCountUpTimer: targetSeconds=%u", targetSeconds); // 参数保护:至少为1秒 if (targetSeconds < 1) { targetSeconds = 1; } @@ -1539,6 +1539,22 @@ view->ChangeView(currentView, THUNDERBIRD_DIALOGUEVIEW, ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_SPEAKING); ln_ws_end_audio_chat(); } + //检查是否是播放界面超时,需要自动跳转到状态界面 + else if (currentView == THUNDERBIRD_DIALOGUEVIEW && + currentSubView == ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_SPEAKING) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "播放界面超时,自动跳转到状态界面"); + view->ChangeView(currentView, THUNDERBIRD_DIALOGUEVIEW, ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_STATUS_SHOW); + ln_ws_end_audio_chat();//结束对话 + // 退出对话模式时恢复表情 + AI_ForceInterrupt(); + ln_ws_send_voice_chat_interrupt("退出对话"); + do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_AUDIO_DEINIT, NULL, 0); + ThunderBirdPresenter::GetInstance()->SetDialogueing(false); + ScreenAlwaysOnCtr(CANCEL_SCREEN_ALWAYS_ON); // 关闭屏幕常亮 + ThunderBirdModel::GetInstance()->HighFrequence();//恢复视频帧率 + ThunderBirdModel::GetInstance()->OnExitDialogueMode(); + } + // 检查是否是绑定成功界面,需要跳转到对话界面 else if (currentView == THUNDERBIRD_ADJUSTVIEW && currentSubView == ThunderBirdAdjustView::THUNDERBIRD_ADJUSTVIEW_BIND_SUCCESS) { @@ -2388,11 +2404,13 @@ void ThunderBirdModel::HandleAudioPlaybackEnd() { //return;//确保稳定性该版本不使用音频播放结束处理 - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdModel::HandleAudioPlaybackEnd"); int currentSubView = ThunderBirdMainView::GetInstance()->GetCurrentSubView(); if(ThunderBirdDialogueView::GetInstance() && currentSubView == ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_SPEAKING) { + ThunderBirdDialogueView::GetInstance()->AudioPlaybackEnd(); + //增加30秒定时器 + ThunderBirdModel::GetInstance()->StartCountUpTimer(120); } } diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdPresenter.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdPresenter.cpp index 789ddce12..d1e971366 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdPresenter.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdPresenter.cpp @@ -814,5 +814,17 @@ namespace OHOS } } + void ThunderBirdPresenter::SetDialogueing(bool dialogueing) + { + if(dialogueing) + { + isDialogueing = true; + } + else + { + isDialogueing = false; + } + } + }