修复哄睡选择故事一直录音问题
authorxue <2144439972@qq.com>
Sat, 7 Mar 2026 10:59:29 +0000 (18:59 +0800)
committerxue <2144439972@qq.com>
Sat, 7 Mar 2026 10:59:29 +0000 (18:59 +0800)
code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp

index 52d8457..fe14676 100644 (file)
@@ -2698,16 +2698,19 @@ extern "C" {
         }
         
         // 比较传入的新值和上次保存的值(last_xxx_)
-        if(newEyesShape == last_eyesShape_ && newHairColor == last_hairColor_ && 
-           newEyesColor == last_eyesColor_ && newHairStyle == last_hairStyle_ && 
-           hasScreenImage == last_hasScreenImage_ && screenImageAsEmoji == last_screenImageAsEmoji_)
+        // 屏保角色(hasScreenImage 或 screenImageAsEmoji 为真)即使配置未变也需执行切换,以便刷新刚下载的屏保图等
+        bool configUnchanged = (newEyesShape == last_eyesShape_ && newHairColor == last_hairColor_ &&
+            newEyesColor == last_eyesColor_ && newHairStyle == last_hairStyle_ &&
+            hasScreenImage == last_hasScreenImage_ && screenImageAsEmoji == last_screenImageAsEmoji_);
+        bool isScreenSaverRole = (hasScreenImage != 0 || screenImageAsEmoji != 0);
+        if (configUnchanged && !isScreenSaverRole)
         {
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdModel::HandleCharacterConfigChange: 角色配置没有变化,不进行处理");
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "  上次配置: eyesShape=%s, hairColor=%s, eyesColor=%s, hairStyle=%s, screenImageAsEmoji=%d",
-                         last_eyesShape_.c_str(), last_hairColor_.c_str(), last_eyesColor_.c_str(), 
+                         last_eyesShape_.c_str(), last_hairColor_.c_str(), last_eyesColor_.c_str(),
                          last_hairStyle_.c_str(), last_screenImageAsEmoji_);
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "  新配置: eyesShape=%s, hairColor=%s, eyesColor=%s, hairStyle=%s, screenImageAsEmoji=%d",
-                         newEyesShape.c_str(), newHairColor.c_str(), newEyesColor.c_str(), 
+                         newEyesShape.c_str(), newHairColor.c_str(), newEyesColor.c_str(),
                          newHairStyle.c_str(), screenImageAsEmoji);
             return;
         }
@@ -3698,6 +3701,8 @@ extern "C" {
             if (ThunderBirdMainView::GetInstance() && ThunderBirdMainView::GetInstance()->listenIcon) {
                 ThunderBirdMainView::GetInstance()->listenIcon->SetVisible(true);
             }
+            // 开启 VAD 识别,否则用户说完后 status=2 会被忽略,录音不会结束(一直录音)
+            ln_ws_set_vad_recognition_enabled(true);
             int ret = ln_ws_start_audio_chat(LN_AUDIO_CHAT_CHOOSE_STORY_REQUEST);
             if (ret == 0) {
                 WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "THUNDERBIRD_LULLABYVIEW_3: 音频聊天已重新启动");