优化息屏操作
authorxue <2144439972@qq.com>
Wed, 22 Oct 2025 08:53:54 +0000 (16:53 +0800)
committerxue <2144439972@qq.com>
Wed, 22 Oct 2025 08:53:54 +0000 (16:53 +0800)
code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdMainView.cpp

index 9ce3c62..868eda3 100644 (file)
@@ -598,15 +598,18 @@ namespace OHOS
             iconView->SetVisible(false);
         }
         backGroundView->SetVisible(false);
-        if(showView != THUNDERBIRD_DIALOGUEVIEW && showView != THUNDERBIRD_LULLABYVIEW)
-        {
-           ScreenAlwaysOnCtr(CANCEL_SCREEN_ALWAYS_ON); // 关闭屏幕常亮
-        }
-        if(currentSubView_ == ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_SPEAKING || currentSubView_ == ThunderBirdLullabyView::THUNDERBIRD_LULLABYVIEW_4)
-        {
-           //恢复视频帧率
-           ThunderBirdModel::GetInstance()->HighFrequence();
-        }
+        // 如果当前界面是需要常亮的界面,则关闭常亮并设置息屏时间
+        if((currentView_ == THUNDERBIRD_DIALOGUEVIEW && 
+            (currentSubView_ == ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_SPEAKING || 
+             currentSubView_ == ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_LISTENING)) || 
+           (currentView_ == THUNDERBIRD_LULLABYVIEW && currentSubView_ == ThunderBirdLullabyView::THUNDERBIRD_LULLABYVIEW_4))
+        {
+            WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ThunderBirdMainView::ChangeView: 从常亮界面退出,关闭屏幕常亮,重新设置息屏时间");
+            ScreenAlwaysOnCtr(CANCEL_SCREEN_ALWAYS_ON); // 关闭屏幕常亮
+            uapi_setScreenDuration(30000); // 重新设置30秒自动息屏
+            ThunderBirdModel::GetInstance()->HighFrequence();
+        }
+       
         // OTA界面已独立为slice,不再需要此检查
         // 保存上一级视图信息(如果是GoBackToPreviousView调用,则不更新prevView_和prevSubView_)
         if (!isGoingBack_)