增加退出蓝牙视频判断,如果不存在则重置为眨眼
authorxue <2144439972@qq.com>
Wed, 7 Jan 2026 11:55:43 +0000 (19:55 +0800)
committerxue <2144439972@qq.com>
Wed, 7 Jan 2026 11:55:43 +0000 (19:55 +0800)
code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdMainView.cpp

index f573601..8b1e971 100644 (file)
@@ -1167,6 +1167,36 @@ namespace OHOS
                 do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_AUDIO_DEINIT, NULL, 0);
             }
         }
+        // 检查从蓝牙界面跳转到发呆中界面时,如果已经在发呆中界面,则切换到眨眼表情来重置表情
+        if(hideView == THUNDERBIRD_BLUEVIEW && 
+           showView == THUNDERBIRD_DIALOGUEVIEW && 
+           subView == ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_STATUS_SHOW)
+        {
+            // 如果当前已经在发呆中界面,且VideoPlayThread已退出(黑脸),切换到眨眼表情来重置表情
+            if(currentView_ == THUNDERBIRD_DIALOGUEVIEW && 
+               currentSubView_ == ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_STATUS_SHOW)
+            {
+                // 检查是否黑脸:VideoPlayThread是否退出
+                bool isBlackFace = false;
+                if (videoPlay_ != nullptr) {
+                    // 检查VideoPlayThread是否已退出或播放已停止
+                    isBlackFace = videoPlay_->isExited_;
+                } else {
+                    // videoPlay_为nullptr也认为是黑脸
+                    isBlackFace = true;
+                }
+                
+                if (isBlackFace) {
+                    WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdMainView::ChangeView: 从蓝牙界面跳转到发呆中界面,已在发呆中界面,检测到黑脸(VideoPlayThread已退出),切换到眨眼表情重置表情");
+                    ThunderBirdModel* model = ThunderBirdModel::GetInstance();
+                    if (model != nullptr) {
+                        model->SwitchToWinkingExpression();
+                    }
+                } else {
+                    WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ThunderBirdMainView::ChangeView: 从蓝牙界面跳转到发呆中界面,已在发呆中界面,但VideoPlayThread未退出,不重置表情");
+                }
+            }
+        }
         if (hideView != MAXVIEW)
         {
             if (group[hideView] == nullptr)