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 GetScreenOffTime(const AppExecFwk::ElementName &admin, int32_t &value, 31 const std::string &permissionTag = EdmConstants::PERMISSION_TAG_VERSION_11); 32 int32_t InstallUserCertificate(const AppExecFwk::ElementName &admin, const std::vector<uint8_t> &certArray, 33 std::string &alias, std::string &result, std::string &innerCodeMsg); 34 int32_t UninstallUserCertificate(const AppExecFwk::ElementName &admin, const std::string &certUri, 35 std::string &innerCodeMsg); 36 int32_t SetPowerPolicy(const AppExecFwk::ElementName &admin, const PowerScene &powerScene, 37 const PowerPolicy &powerPolicy); 38 int32_t GetPowerPolicy(const AppExecFwk::ElementName &admin, const PowerScene &powerScene, 39 PowerPolicy &powerPolicy); 40 41 private: 42 static std::shared_ptr<DeviceSettingsProxy> instance_; 43 static std::mutex mutexLock_; 44 }; 45 } // namespace EDM 46 } // namespace OHOS 47 48 #endif // INTERFACES_INNER_API_DEVICE_SETTINGS_INCLUDE_DEVICE_SETTINGS_PROXY_H 49