Signed-off-by: yangpengfei <yangpengfei34@huawei.com>
This commit is contained in:
yangpengfei 2024-11-20 08:00:23 +00:00 committed by Gitee
parent 552efc3a90
commit 0b9c73cf7b
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 2 additions and 18 deletions

View File

@ -157,26 +157,13 @@ void SavedNetworkTracker::GetCandidatesFromSubNetworkSelector()
} }
} }
SuggestionNetworkTracker::SuggestionNetworkTracker() : CompositeNetworkSelector("suggestionNetworkTracker") SuggestionNetworkTracker::SuggestionNetworkTracker() : SimpleNetworkSelector("suggestionNetworkTracker")
{ {
auto andFilter = make_shared<AndWifiFilter>(); auto andFilter = make_shared<AndWifiFilter>();
andFilter->AddFilter(make_shared<SuggestionNetworkWifiFilter>()); andFilter->AddFilter(make_shared<SuggestionNetworkWifiFilter>());
andFilter->AddFilter(make_shared<DisableWifiFilter>()); andFilter->AddFilter(make_shared<DisableWifiFilter>());
SetWifiFilter(andFilter); SetWifiFilter(andFilter);
} }
bool SuggestionNetworkTracker::Nominate(NetworkCandidate &networkCandidate)
{
networkCandidates.emplace_back(&networkCandidate);
return true;
}
void SuggestionNetworkTracker::GetCandidatesFromSubNetworkSelector()
{
for (const auto &subNetworkSelector : subNetworkSelectors) {
subNetworkSelector->GetBestCandidates(networkCandidates);
}
}
SimpleFilterNetworkSelector::SimpleFilterNetworkSelector(const std::string &networkSelectorName) SimpleFilterNetworkSelector::SimpleFilterNetworkSelector(const std::string &networkSelectorName)
: SimpleNetworkSelector(networkSelectorName), SimpleWifiFilter(networkSelectorName) {} : SimpleNetworkSelector(networkSelectorName), SimpleWifiFilter(networkSelectorName) {}

View File

@ -45,12 +45,9 @@ protected:
void GetCandidatesFromSubNetworkSelector() override; void GetCandidatesFromSubNetworkSelector() override;
}; };
class SuggestionNetworkTracker final: public CompositeNetworkSelector { class SuggestionNetworkTracker final: public SimpleNetworkSelector {
public: public:
SuggestionNetworkTracker(); SuggestionNetworkTracker();
protected:
bool Nominate(NetworkCandidate &networkCandidate) override;
void GetCandidatesFromSubNetworkSelector() override;
}; };
class SimpleFilterNetworkSelector : public SimpleNetworkSelector, public SimpleWifiFilter { class SimpleFilterNetworkSelector : public SimpleNetworkSelector, public SimpleWifiFilter {