增加设置进入血压校准的网络判断 1883/1 1883/head 1884/target/2 1885/target/1 1886/target/1
authorCaisking <Casiking@zhihuishixun.com>
Tue, 24 Jun 2025 09:54:11 +0000 (17:54 +0800)
committerCaisking <Casiking@zhihuishixun.com>
Tue, 24 Jun 2025 09:54:11 +0000 (17:54 +0800)
code/sdk/application/wearable/fd230app/nativeui/applist/src/ApplistPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingPresenter.cpp

index 1cc8278..ae014eb 100644 (file)
@@ -190,7 +190,7 @@ namespace OHOS
 #if defined(BOARD_W9) || defined(BOARD_N9)
             bool isbleconnected = get_ble_connect(); // 获取蓝牙连接状态
             bool is4Gconnected = uapi_dev_runtime_get_cat1_networkstat(); // 获取4G连接状态
-            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"isbleconnected = %d is4Gconnected = %d",isbleconnected,is4Gconnected);
+            WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"isbleconnected = %d is4Gconnected = %d",isbleconnected,is4Gconnected);
             if(viewId ==  VIEW_PRESSURE || viewId == VIEW_EMOTION || viewId == VIEW_ECG 
                 || viewId == VIEW_FATIGUE || viewId == VIEW_BLOOD_PRESSURE_CHECK 
                 || viewId == VIEW_BLOOD_PRESSURE_CALIBRATION)
index 0986f91..0e9463a 100644 (file)
@@ -17,6 +17,7 @@
 #include "settings/include/SettingPresenter.h"
 #include "common/key_code.h"
 #include <custom_utils.h>
+#include "bleService.h"
 namespace OHOS
 {
 
@@ -147,6 +148,19 @@ namespace OHOS
         SettingItemView *settingItemView = static_cast<SettingItemView *>(&view);
         AppViewId viewId = settingItemView->GetViewId();
         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "%d\n", viewId);
+#if defined(BOARD_W9) || defined(BOARD_N9)
+            bool isbleconnected = get_ble_connect(); // 获取蓝牙连接状态
+            bool is4Gconnected = uapi_dev_runtime_get_cat1_networkstat(); // 获取4G连接状态
+            WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"isbleconnected = %d is4Gconnected = %d",isbleconnected,is4Gconnected);
+            if( viewId == VIEW_BLOOD_PRESSURE_CHECK  || viewId == VIEW_BLOOD_PRESSURE_CALIBRATION)
+            {
+                // 必须至少有一个状态成功才可以正常进入应用,否则进入未连接界面。
+                if (isbleconnected == false && is4Gconnected == false)
+                {
+                    viewId = VIEW_UNCONNECTED;
+                }
+            }
+#endif
         NativeAbility::GetInstance().EnterSlice(viewId);
         return true;
     }