优化哄睡模式
authorxue <2144439972@qq.com>
Wed, 15 Oct 2025 10:24:09 +0000 (18:24 +0800)
committerxue <2144439972@qq.com>
Wed, 15 Oct 2025 10:24:09 +0000 (18:24 +0800)
code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdPresenter.cpp
code/sdk/zhihui/leiniao/imsl_ln/ln_api.c
code/sdk/zhihui/leiniao/imsl_ln/ln_api_websocket.c

index d28cca2..da0abc9 100644 (file)
@@ -530,9 +530,8 @@ namespace OHOS
                 break;
             case ThunderBirdLullabyView::THUNDERBIRD_LULLABYVIEW_5:
                 do_ln_http_server_send_data(LN_HTTP_SERVICE_CMD_STORY_FINISH, NULL, 0);//确认结束哄睡
-                ai_media_play_stop();
-                WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ThunderBirdDialogueView::AudioPlaybackEnd: Stopped audio playback");
-                ln_ws_end_audio_chat();//结束对话
+                AI_ForceInterrupt();
+                ln_ws_send_voice_chat_interrupt("退出哄睡");
                 ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_DIALOGUEVIEW, ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_STATUS_SHOW);
                 break;
         }
@@ -668,6 +667,8 @@ namespace OHOS
                 WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ThunderBirdDialogueView::AudioPlaybackEnd: Stopped audio playback");
                 ln_ws_end_audio_chat();//结束对话
                 // 退出对话模式时恢复表情
+                AI_ForceInterrupt();
+                ln_ws_send_voice_chat_interrupt("退出对话");
                 isDialogueing = false;
                 ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_DIALOGUEVIEW, ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_STATUS_SHOW);
                 if(currentSubView == ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_LISTENING)
index 2be4e97..06e6889 100644 (file)
@@ -830,6 +830,7 @@ void ln_ws_process_message(const ws_data_msg_t *data_msg, ws_command_t type)
         {
             // ln_parse_sleep_mode_end(json_str, (int)strlen(json_str));
             ln_voice_chat_interrupt("哄睡模式结束");
+            push_sleep_mode_end_notification();
         }
         break;
     }
@@ -917,7 +918,7 @@ void ln_ws_process_message(const ws_data_msg_t *data_msg, ws_command_t type)
     case WS_CMD_AUDIO_PLAYBACK_END:
     {
         uapi_ln_set_audio_play_status(0);
-        push_audio_playback_end_notification();
+        //push_audio_playback_end_notification();
         break;
     }
     default:
index 2ad5e74..2f6740f 100644 (file)
@@ -2577,6 +2577,7 @@ static bool check_playback_completion_by_timeout(void)
         
         // 触发播放结束事件
         if (g_ws_message_callback != NULL) {
+            push_audio_playback_end_notification();
             g_ws_message_callback(NULL, WS_CMD_AUDIO_PLAYBACK_END);
         }