• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 "update_policy_utils.h"
22 
23 namespace OHOS {
24 namespace EDM {
25 class SystemManagerProxy {
26 public:
27     static std::shared_ptr<SystemManagerProxy> GetSystemManagerProxy();
28     int32_t SetNTPServer(const AppExecFwk::ElementName &admin, const std::string &value);
29     int32_t GetNTPServer(const AppExecFwk::ElementName &admin, std::string &value);
30     int32_t SetOTAUpdatePolicy(const AppExecFwk::ElementName &admin, const UpdatePolicy &updatePolicy,
31         std::string &errorMsg);
32     int32_t GetOTAUpdatePolicy(const AppExecFwk::ElementName &admin, 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 
38 private:
39     static std::shared_ptr<SystemManagerProxy> instance_;
40     static std::mutex mutexLock_;
41 };
42 } // namespace EDM
43 } // namespace OHOS
44 
45 #endif // INTERFACES_INNER_API_SYSTEM_MANAGER_INCLUDE_SYSTEM_MANAGER_PROXY_H
46