From 96a388133d66765525cda09a3d0cf6fa81d7a11c Mon Sep 17 00:00:00 2001 From: Gala Han <2545202801@qq.com> Date: Mon, 1 Sep 2025 16:40:04 +0800 Subject: [PATCH 1/2] modify interface check --- frameworks/inner/src/bluetooth_host.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frameworks/inner/src/bluetooth_host.cpp b/frameworks/inner/src/bluetooth_host.cpp index 7dd77250..d0b525e5 100644 --- a/frameworks/inner/src/bluetooth_host.cpp +++ b/frameworks/inner/src/bluetooth_host.cpp @@ -701,11 +701,12 @@ int BluetoothHost::RestrictBluetooth(std::string name) int BluetoothHost::SatelliteControl(int type, int state) { HILOGI("type: %{public}d, state: %{public}d", type, state); - if (type == static_cast(SATELLITE_CONTROL_MODE::ANTENNA) || - type == static_cast(SATELLITE_CONTROL_MODE::SIGNALHUB_MAC_SWITCH)) { + if (type == static_cast(SATELLITE_CONTROL_MODE::ANTENNA)) { CHECK_AND_RETURN_LOG_RET(IS_BT_ENABLED(), BT_ERR_INVALID_STATE, "bluetooth is off."); } else if (type == static_cast(SATELLITE_CONTROL_MODE::BLUETOOTH_SWITCH)) { pimpl->LoadBluetoothHostService(); + } else if (type == static_cast(SATELLITE_CONTROL_MODE::SIGNALHUB_MAC_SWITCH)) { + CHECK_AND_RETURN_LOG_RET(IS_BLE_ENABLED(), BT_ERR_INVALID_STATE, "ble is off."); } else { HILOGE("Invalid control type: %{public}d", type); return BT_ERR_INVALID_PARAM; -- Gitee From d6d3e02cb061bb216125758fe63cc16d2fa1af00 Mon Sep 17 00:00:00 2001 From: Gala Han <2545202801@qq.com> Date: Mon, 1 Sep 2025 16:40:04 +0800 Subject: [PATCH 2/2] modify interface check Signed-off-by: Gala Han <2545202801@qq.com> --- frameworks/inner/src/bluetooth_host.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frameworks/inner/src/bluetooth_host.cpp b/frameworks/inner/src/bluetooth_host.cpp index 7dd77250..d0b525e5 100644 --- a/frameworks/inner/src/bluetooth_host.cpp +++ b/frameworks/inner/src/bluetooth_host.cpp @@ -701,11 +701,12 @@ int BluetoothHost::RestrictBluetooth(std::string name) int BluetoothHost::SatelliteControl(int type, int state) { HILOGI("type: %{public}d, state: %{public}d", type, state); - if (type == static_cast(SATELLITE_CONTROL_MODE::ANTENNA) || - type == static_cast(SATELLITE_CONTROL_MODE::SIGNALHUB_MAC_SWITCH)) { + if (type == static_cast(SATELLITE_CONTROL_MODE::ANTENNA)) { CHECK_AND_RETURN_LOG_RET(IS_BT_ENABLED(), BT_ERR_INVALID_STATE, "bluetooth is off."); } else if (type == static_cast(SATELLITE_CONTROL_MODE::BLUETOOTH_SWITCH)) { pimpl->LoadBluetoothHostService(); + } else if (type == static_cast(SATELLITE_CONTROL_MODE::SIGNALHUB_MAC_SWITCH)) { + CHECK_AND_RETURN_LOG_RET(IS_BLE_ENABLED(), BT_ERR_INVALID_STATE, "ble is off."); } else { HILOGE("Invalid control type: %{public}d", type); return BT_ERR_INVALID_PARAM; -- Gitee