From: Caisking Date: Tue, 24 Jun 2025 09:54:11 +0000 (+0800) Subject: 增加设置进入血压校准的网络判断 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F1883%2Fhead;p=mirrors%2FFD230.git 增加设置进入血压校准的网络判断 --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/applist/src/ApplistPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/applist/src/ApplistPresenter.cpp index 1cc82782d..ae014eb2d 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/applist/src/ApplistPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/applist/src/ApplistPresenter.cpp @@ -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) diff --git a/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingPresenter.cpp index 0986f9181..0e9463a1b 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingPresenter.cpp @@ -17,6 +17,7 @@ #include "settings/include/SettingPresenter.h" #include "common/key_code.h" #include +#include "bleService.h" namespace OHOS { @@ -147,6 +148,19 @@ namespace OHOS SettingItemView *settingItemView = static_cast(&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; }