From 66558824218d5d444814ed936085de3579df7abc Mon Sep 17 00:00:00 2001 From: TianYH Date: Wed, 30 Jul 2025 10:12:48 +0800 Subject: [PATCH] AutoConnect Bugfix Signed-off-by: TianYH --- .../wifi_manage/wifi_sta/sta_service.cpp | 1 - .../wifi_manage/wifi_sta/sta_state_machine.cpp | 17 ----------------- .../wifi_manage/wifi_sta/sta_state_machine.h | 2 -- 3 files changed, 20 deletions(-) diff --git a/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_sta/sta_service.cpp b/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_sta/sta_service.cpp index 8b6db8e59..f42c5c98b 100644 --- a/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_sta/sta_service.cpp +++ b/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_sta/sta_service.cpp @@ -705,7 +705,6 @@ ErrCode StaService::AllowAutoConnect(int32_t networkId, bool isAllowed) const WIFI_LOGI("AllowAutoConnect, networkid is not correct, linked networkid:%{public}d", linkedInfo.networkId); return WIFI_OPT_SUCCESS; } - Disconnect(); } return WIFI_OPT_SUCCESS; } diff --git a/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_sta/sta_state_machine.cpp b/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_sta/sta_state_machine.cpp index e9910c5df..5d4817234 100755 --- a/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_sta/sta_state_machine.cpp +++ b/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_sta/sta_state_machine.cpp @@ -4425,7 +4425,6 @@ ErrCode StaStateMachine::StartConnectToNetwork(int networkId, const std::string return WIFI_OPT_FAILED; } if (connTriggerMode == NETWORK_SELECTED_BY_USER) { - SetAllowAutoConnectStatus(networkId, true); BlockConnectService::GetInstance().EnableNetworkSelectStatus(networkId); #ifndef OHOS_ARCH_LITE BlockConnectService::GetInstance().ReleaseUnusableBssidSet(); @@ -4479,22 +4478,6 @@ ErrCode StaStateMachine::StartConnectToNetwork(int networkId, const std::string return WIFI_OPT_SUCCESS; } -void StaStateMachine::SetAllowAutoConnectStatus(int32_t networkId, bool status) -{ - WifiDeviceConfig deviceConfig; - if (WifiSettings::GetInstance().GetDeviceConfig(networkId, deviceConfig, m_instId) != 0) { - WIFI_LOGE("SetAllowAutoConnectStatus get GetDeviceConfig failed!"); - return; - } - if (deviceConfig.isAllowAutoConnect == status) { - return; - } - - deviceConfig.isAllowAutoConnect = status; - WifiSettings::GetInstance().AddDeviceConfig(deviceConfig); - WifiSettings::GetInstance().SyncDeviceConfig(); -} - void StaStateMachine::MacAddressGenerate(WifiStoreRandomMac &randomMacInfo) { WIFI_LOGD("enter MacAddressGenerate\n"); diff --git a/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_sta/sta_state_machine.h b/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_sta/sta_state_machine.h index 1121ab819..a3354ebbe 100644 --- a/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_sta/sta_state_machine.h +++ b/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_sta/sta_state_machine.h @@ -610,8 +610,6 @@ private: */ void AutoSelectConnectToNetwork(const std::string& bssid, std::string& ifaceName); - void SetAllowAutoConnectStatus(int32_t networkId, bool status); - /** * @Description Disconnect network * -- Gitee