1 /* 2 * Copyright (C) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef OHOS_WIFI_WIFI_FILTER_H 17 #define OHOS_WIFI_WIFI_FILTER_H 18 #include "network_selection.h" 19 20 namespace OHOS::Wifi::NetworkSelection { 21 class HiddenWifiFilter final : public SimpleWifiFilter { 22 public: 23 HiddenWifiFilter(); 24 ~HiddenWifiFilter() override; 25 protected: 26 bool Filter(NetworkCandidate &networkCandidate) override; 27 }; 28 29 class NotCurrentNetworkFilter final : public SimpleWifiFilter { 30 public: 31 NotCurrentNetworkFilter(); 32 ~NotCurrentNetworkFilter() override; 33 protected: 34 bool Filter(NetworkCandidate &networkCandidate) override; 35 }; 36 37 class ValidNetworkIdFilter final : public SimpleWifiFilter { 38 public: 39 ValidNetworkIdFilter(); 40 ~ValidNetworkIdFilter() override; 41 protected: 42 bool Filter(NetworkCandidate &networkCandidate) override; 43 }; 44 45 class SignalLevelFilter final : public SimpleWifiFilter { 46 public: 47 SignalLevelFilter(); 48 ~SignalLevelFilter() override; 49 protected: 50 bool Filter(NetworkCandidate &networkCandidate) override; 51 }; 52 53 class NotNetworkBlackListFilter final : public SimpleWifiFilter { 54 public: 55 NotNetworkBlackListFilter(); 56 ~NotNetworkBlackListFilter() override; 57 protected: 58 bool Filter(NetworkCandidate &networkCandidate) override; 59 }; 60 61 class NotP2pFreqAt5gFilter final : public SimpleWifiFilter { 62 public: 63 NotP2pFreqAt5gFilter(); 64 ~NotP2pFreqAt5gFilter() override; 65 protected: 66 bool Filter(NetworkCandidate &networkCandidate) override; 67 }; 68 69 class ValidConfigNetworkFilter final : public SimpleWifiFilter { 70 public: 71 ValidConfigNetworkFilter(); 72 ~ValidConfigNetworkFilter() override; 73 protected: 74 bool Filter(NetworkCandidate &networkCandidate) override; 75 }; 76 77 class WifiSwitchThresholdFilter final : public SimpleWifiFilter { 78 public: 79 WifiSwitchThresholdFilter(); 80 ~WifiSwitchThresholdFilter() override; 81 protected: 82 bool Filter(NetworkCandidate &networkCandidate) override; 83 }; 84 85 class WifiSwitchThresholdQoeFilter final : public SimpleWifiFilter { 86 public: 87 WifiSwitchThresholdQoeFilter(); 88 ~WifiSwitchThresholdQoeFilter() override; 89 protected: 90 bool Filter(NetworkCandidate &networkCandidate) override; 91 }; 92 93 class WifiSwitch5GNot2GFilter final : public SimpleWifiFilter { 94 public: 95 WifiSwitch5GNot2GFilter(); 96 ~WifiSwitch5GNot2GFilter() override; 97 protected: 98 bool Filter(NetworkCandidate &networkCandidate) override; 99 }; 100 101 class SignalStrengthWifiFilter final : public SimpleWifiFilter { 102 public: 103 SignalStrengthWifiFilter(); 104 ~SignalStrengthWifiFilter() override; 105 protected: 106 bool Filter(NetworkCandidate &networkCandidate) override; 107 }; 108 109 class SavedWifiFilter final : public SimpleWifiFilter { 110 public: 111 SavedWifiFilter(); 112 ~SavedWifiFilter() override; 113 protected: 114 bool Filter(NetworkCandidate &networkCandidate) override; 115 }; 116 117 118 class EphemeralWifiFilter final : public SimpleWifiFilter { 119 public: 120 EphemeralWifiFilter(); 121 ~EphemeralWifiFilter() override; 122 protected: 123 bool Filter(NetworkCandidate &networkCandidate) override; 124 }; 125 126 class PassPointWifiFilter final : public SimpleWifiFilter { 127 public: 128 PassPointWifiFilter(); 129 ~PassPointWifiFilter() override; 130 protected: 131 bool Filter(NetworkCandidate &networkCandidate) override; 132 }; 133 134 class DisableWifiFilter final : public SimpleWifiFilter { 135 public: 136 DisableWifiFilter(); 137 ~DisableWifiFilter() override; 138 protected: 139 bool Filter(NetworkCandidate &networkCandidate) override; 140 }; 141 142 class MatchedUserSelectBssidWifiFilter final : public SimpleWifiFilter { 143 public: 144 MatchedUserSelectBssidWifiFilter(); 145 ~MatchedUserSelectBssidWifiFilter() override; 146 protected: 147 bool Filter(NetworkCandidate &networkCandidate) override; 148 }; 149 150 class HasInternetWifiFilter final : public SimpleWifiFilter { 151 public: 152 HasInternetWifiFilter(); 153 ~HasInternetWifiFilter() override; 154 protected: 155 bool Filter(NetworkCandidate &networkCandidate) override; 156 }; 157 158 class RecoveryWifiFilter final : public SimpleWifiFilter { 159 public: 160 RecoveryWifiFilter(); 161 ~RecoveryWifiFilter() override; 162 protected: 163 bool Filter(NetworkCandidate &networkCandidate) override; 164 }; 165 166 class PoorPortalWifiFilter final : public SimpleWifiFilter { 167 public: 168 PoorPortalWifiFilter(); 169 ~PoorPortalWifiFilter() override; 170 protected: 171 bool Filter(NetworkCandidate &networkCandidate) override; 172 }; 173 174 class PortalWifiFilter final : public SimpleWifiFilter { 175 public: 176 PortalWifiFilter(); 177 ~PortalWifiFilter() override; 178 protected: 179 bool Filter(NetworkCandidate &networkCandidate) override; 180 }; 181 182 class MaybePortalWifiFilter final : public SimpleWifiFilter { 183 public: 184 MaybePortalWifiFilter(); 185 ~MaybePortalWifiFilter() override; 186 protected: 187 bool Filter(NetworkCandidate &networkCandidate) override; 188 }; 189 190 class NoInternetWifiFilter final : public SimpleWifiFilter { 191 public: 192 NoInternetWifiFilter(); 193 ~NoInternetWifiFilter() override; 194 protected: 195 bool Filter(NetworkCandidate &networkCandidate) override; 196 }; 197 198 199 class WeakAlgorithmWifiFilter final : public SimpleWifiFilter { 200 public: 201 WeakAlgorithmWifiFilter(); 202 ~WeakAlgorithmWifiFilter() override; 203 protected: 204 bool Filter(NetworkCandidate &networkCandidate) override; 205 }; 206 207 class SuggestionNetworkWifiFilter final : public SimpleWifiFilter { 208 public: 209 SuggestionNetworkWifiFilter(); 210 ~SuggestionNetworkWifiFilter() override; 211 protected: 212 bool Filter(NetworkCandidate &networkCandidate) override; 213 }; 214 } 215 #endif //OHOS_WIFI_WIFI_FILTER_H 216