• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_DEVICE_SETTINGS_INCLUDE_DEVICE_SETTINGS_PROXY_H
17 #define INTERFACES_INNER_API_DEVICE_SETTINGS_INCLUDE_DEVICE_SETTINGS_PROXY_H
18 
19 #include "edm_constants.h"
20 #include "enterprise_device_mgr_proxy.h"
21 #include "power_policy.h"
22 
23 namespace OHOS {
24 namespace EDM {
25 class DeviceSettingsProxy {
26 public:
27     static std::shared_ptr<DeviceSettingsProxy> GetDeviceSettingsProxy();
28     int32_t SetScreenOffTime(const AppExecFwk::ElementName &admin, int32_t value,
29         const std::string &permissionTag = EdmConstants::PERMISSION_TAG_VERSION_11);
30     int32_t SetScreenOffTime(MessageParcel &data);
31     int32_t GetScreenOffTime(const AppExecFwk::ElementName &admin, int32_t &value,
32         const std::string &permissionTag = EdmConstants::PERMISSION_TAG_VERSION_11);
33     int32_t GetScreenOffTime(MessageParcel &data, int32_t &value);
34     int32_t InstallUserCertificate(MessageParcel &data, std::string &result, std::string &innerCodeMsg);
35     int32_t UninstallUserCertificate(MessageParcel &data, std::string &innerCodeMsg);
36     int32_t SetPowerPolicy(const AppExecFwk::ElementName &admin, const PowerScene &powerScene,
37         const PowerPolicy &powerPolicy);
38     int32_t SetPowerPolicy(MessageParcel &data);
39     int32_t GetPowerPolicy(const AppExecFwk::ElementName &admin, const PowerScene &powerScene,
40         PowerPolicy &powerPolicy);
41     int32_t GetPowerPolicy(MessageParcel &data, PowerPolicy &powerPolicy);
42     int32_t SetWallPaper(MessageParcel &data, std::string &errMsg);
43 
44 private:
45     static std::shared_ptr<DeviceSettingsProxy> instance_;
46     static std::once_flag flag_;
47 };
48 } // namespace EDM
49 } // namespace OHOS
50 
51 #endif // INTERFACES_INNER_API_DEVICE_SETTINGS_INCLUDE_DEVICE_SETTINGS_PROXY_H
52