1 /* 2 * Copyright (c) 2023 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 INTERFACES_INNER_API_WIFI_MANAGER_INCLUDE_WIFI_MANAGER_PROXY_H 17 #define INTERFACES_INNER_API_WIFI_MANAGER_INCLUDE_WIFI_MANAGER_PROXY_H 18 19 #include "enterprise_device_mgr_proxy.h" 20 #ifdef WIFI_EDM_ENABLE 21 #include "wifi_msg.h" 22 #include "wifi_password.h" 23 #endif 24 25 namespace OHOS { 26 namespace EDM { 27 class WifiManagerProxy { 28 public: 29 WifiManagerProxy(); 30 ~WifiManagerProxy(); 31 static std::shared_ptr<WifiManagerProxy> GetWifiManagerProxy(); 32 int32_t IsWifiActive(const AppExecFwk::ElementName &admin, bool &result, bool isSync = false); 33 #ifdef WIFI_EDM_ENABLE 34 int32_t SetWifiProfile(const AppExecFwk::ElementName &admin, Wifi::WifiDeviceConfig &config, 35 WifiPassword &pwd, bool isSync = false); 36 #endif 37 int32_t SetWifiDisabled(const AppExecFwk::ElementName &admin, const bool &isDisabled); 38 int32_t IsWifiDisabled(AppExecFwk::ElementName *admin, bool &result); 39 private: 40 static std::shared_ptr<WifiManagerProxy> instance_; 41 static std::mutex mutexLock_; 42 }; 43 } // namespace EDM 44 } // namespace OHOS 45 46 #endif // INTERFACES_INNER_API_WIFI_MANAGER_INCLUDE_WIFI_MANAGER_PROXY_H 47