From b7d1e603e7cc696bd91c34bf230e60d5e41b2a31 Mon Sep 17 00:00:00 2001 From: Caisking Date: Tue, 24 Jun 2025 17:54:11 +0800 Subject: [PATCH] =?utf8?q?=E5=A2=9E=E5=8A=A0=E8=AE=BE=E7=BD=AE=E8=BF=9B?= =?utf8?q?=E5=85=A5=E8=A1=80=E5=8E=8B=E6=A0=A1=E5=87=86=E7=9A=84=E7=BD=91?= =?utf8?q?=E7=BB=9C=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/applist/src/ApplistPresenter.cpp | 2 +- .../nativeui/settings/src/SettingPresenter.cpp | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) 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; } -- 2.17.1