1 /* 2 * Copyright (c) 2023-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 INTERFACES_INNER_API_SYSTEM_MANAGER_INCLUDE_SYSTEM_MANAGER_PROXY_H 17 #define INTERFACES_INNER_API_SYSTEM_MANAGER_INCLUDE_SYSTEM_MANAGER_PROXY_H 18 19 #include "enterprise_device_mgr_proxy.h" 20 21 #include "func_code.h" 22 #include "update_policy_utils.h" 23 24 namespace OHOS { 25 namespace EDM { 26 class SystemManagerProxy { 27 public: 28 static std::shared_ptr<SystemManagerProxy> GetSystemManagerProxy(); 29 int32_t SetNTPServer(MessageParcel &data); 30 int32_t GetNTPServer(MessageParcel &data, std::string &value); 31 int32_t SetOTAUpdatePolicy(MessageParcel &data, std::string &errorMsg); 32 int32_t GetOTAUpdatePolicy(MessageParcel &data, UpdatePolicy &updatePolicy); 33 int32_t NotifyUpdatePackages(const AppExecFwk::ElementName &admin, UpgradePackageInfo &packageInfo, 34 std::string &errMsg); 35 int32_t GetUpgradeResult(const AppExecFwk::ElementName &admin, const std::string &version, 36 UpgradeResult &upgradeResult); 37 int32_t GetUpdateAuthData(MessageParcel &data, std::string &authData); 38 int32_t SetAutoUnlockAfterReboot(MessageParcel &data); 39 int32_t GetAutoUnlockAfterReboot(MessageParcel &data, bool &authData); 40 int32_t SetInstallLocalEnterpriseAppEnabled(MessageParcel &data); 41 int32_t GetInstallLocalEnterpriseAppEnabled(MessageParcel &data, bool &isAllowedInstall); 42 int32_t AddOrRemoveDisallowedNearlinkProtocols(MessageParcel &data, FuncOperateType operateType); 43 int32_t GetDisallowedNearlinkProtocols(MessageParcel &data, std::vector<int32_t> &protocols); 44 45 private: 46 static std::shared_ptr<SystemManagerProxy> instance_; 47 static std::once_flag flag_; 48 }; 49 } // namespace EDM 50 } // namespace OHOS 51 52 #endif // INTERFACES_INNER_API_SYSTEM_MANAGER_INCLUDE_SYSTEM_MANAGER_PROXY_H 53