Signed-off-by: yangpengfei <yangpengfei34@huawei.com>
This commit is contained in:
yangpengfei 2024-11-19 13:37:01 +00:00 committed by Gitee
parent 39c18a795d
commit b8f5063dd4
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -87,7 +87,8 @@ SavedWifiFilter::~SavedWifiFilter()
bool SavedWifiFilter::Filter(NetworkCandidate &networkCandidate)
{
return networkCandidate.wifiDeviceConfig.networkId != INVALID_NETWORK_ID;
return networkCandidate.wifiDeviceConfig.networkId != INVALID_NETWORK_ID &&
(networkCandidate.wifiDeviceConfig.uid == -1 || networkCandidate.wifiDeviceConfig.isShared == true);
}
@ -569,4 +570,21 @@ bool WifiSwitchThresholdFilter::Filter(NetworkCandidate &networkCandidate)
return true;
}
SuggestionNetworkWifiFilter::SuggestionNetworkWifiFilter() : SimpleWifiFilter("suggestionNetworkWifiFilter") {}
SuggestionNetworkWifiFilter::~SuggestionNetworkWifiFilter()
{
if (!filteredNetworkCandidates.empty()) {
WIFI_LOGI("filteredNetworkCandidates in %{public}s: %{public}s",
filterName.c_str(),
NetworkSelectionUtils::GetNetworkCandidatesInfo(filteredNetworkCandidates).c_str());
}
}
bool SuggestionNetworkWifiFilter::Filter(NetworkCandidate &networkCandidate)
{
return networkCandidate.wifiDeviceConfig.uid != WIFI_INVALID_UID &&
networkCandidate.wifiDeviceConfig.isShared == false;
}
}