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 f34a206a5cd5e37b7ee8a076ce9c5aad5ea23ad9..e30e0ba8ffb6f762f3e7608b5568a060ce5dc6b3 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 76558d1989ca7c3d604c2ea3bcf4215af7e8a043..c49aea81a804e1462ee9934fd7713c0bacee9a17 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 @@ -4402,7 +4402,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(); @@ -4456,22 +4455,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 1121ab81939287060dad2bd7499e43100da1e390..a3354ebbec7311ab5d8a8bb1ce84d44afa8b07d9 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 * diff --git a/wifi/services/wifi_standard/wifi_framework/wifi_toolkit/utils/wifi_global_func.cpp b/wifi/services/wifi_standard/wifi_framework/wifi_toolkit/utils/wifi_global_func.cpp index 190d1b5355eda104f2cc212e583380be018d9b22..bb3cb3f66b8dba521f3ecb371cd22abb71b135be 100644 --- a/wifi/services/wifi_standard/wifi_framework/wifi_toolkit/utils/wifi_global_func.cpp +++ b/wifi/services/wifi_standard/wifi_framework/wifi_toolkit/utils/wifi_global_func.cpp @@ -639,9 +639,13 @@ bool ParseJsonKey(const cJSON *jsonValue, const std::string &key, std::string &v int nSize = cJSON_GetArraySize(jsonValue); for (int i = 0; i < nSize; ++i) { cJSON *item = cJSON_GetArrayItem(jsonValue, i); - if (item == nullptr || !cJSON_IsObject(item)) { + if (item == nullptr) { return false; } + if (!cJSON_IsObject(item)) { + cJSON_Delete(item); + continue; + } cJSON *keyItem = cJSON_GetObjectItem(item, key.c_str()); if (keyItem == nullptr) { return false;