1 /* 2 * Copyright (c) 2022-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_INCLUDE_IENTERPRISE_DEVICE_MGR_H 17 #define INTERFACES_INNER_API_INCLUDE_IENTERPRISE_DEVICE_MGR_H 18 #include <string> 19 20 #include "admin_type.h" 21 #include "edm_errors.h" 22 #include "edm_ipc_interface_code.h" 23 #include "element_name.h" 24 #include "ent_info.h" 25 #include "iremote_broker.h" 26 #include "iremote_object.h" 27 #include "iremote_proxy.h" 28 #include "iremote_stub.h" 29 #include "want.h" 30 31 namespace OHOS { 32 namespace EDM { 33 class IEnterpriseDeviceMgr : public IRemoteBroker { 34 public: 35 DECLARE_INTERFACE_DESCRIPTOR(u"ohos.edm.IEnterpriseDeviceMgr"); 36 virtual ErrCode EnableAdmin(AppExecFwk::ElementName &admin, EntInfo &entInfo, AdminType type, int32_t userId) = 0; 37 virtual ErrCode DisableAdmin(AppExecFwk::ElementName &admin, int32_t userId) = 0; 38 virtual ErrCode DisableSuperAdmin(const std::string &bundleName) = 0; 39 virtual ErrCode HandleDevicePolicy(uint32_t code, AppExecFwk::ElementName &admin, MessageParcel &data, 40 MessageParcel &reply, int32_t userId) = 0; 41 virtual ErrCode GetDevicePolicy(uint32_t code, MessageParcel &data, MessageParcel &reply, int32_t userId) = 0; 42 virtual ErrCode CheckAndGetAdminProvisionInfo(uint32_t code, MessageParcel &data, MessageParcel &reply, 43 int32_t userId) = 0; 44 virtual ErrCode GetEnabledAdmin(AdminType type, std::vector<std::string> &enabledAdminList) = 0; 45 virtual ErrCode GetEnterpriseInfo(AppExecFwk::ElementName &admin, MessageParcel &reply) = 0; 46 virtual ErrCode SetEnterpriseInfo(AppExecFwk::ElementName &admin, EntInfo &entInfo) = 0; 47 virtual ErrCode SubscribeManagedEvent(const AppExecFwk::ElementName &admin, 48 const std::vector<uint32_t> &events) = 0; 49 virtual ErrCode UnsubscribeManagedEvent(const AppExecFwk::ElementName &admin, 50 const std::vector<uint32_t> &events) = 0; 51 virtual bool IsSuperAdmin(const std::string &bundleName) = 0; 52 virtual bool IsAdminEnabled(AppExecFwk::ElementName &admin, int32_t userId) = 0; 53 virtual ErrCode AuthorizeAdmin(const AppExecFwk::ElementName &admin, const std::string &bundleName) = 0; 54 virtual ErrCode GetSuperAdmin(MessageParcel &reply) = 0; 55 virtual ErrCode SetDelegatedPolicies(const std::string &parentAdminName, const std::string &bundleName, 56 const std::vector<std::string> &policies) = 0; 57 virtual ErrCode GetDelegatedPolicies(const std::string &parentAdminName, const std::string &bundleName, 58 std::vector<std::string> &policies) = 0; 59 virtual ErrCode GetDelegatedBundleNames(const std::string &parentAdminName, const std::string &policyName, 60 std::vector<std::string> &bundleNames) = 0; 61 virtual ErrCode GetAdmins(std::vector<std::shared_ptr<AAFwk::Want>> &wants) = 0; 62 }; 63 } // namespace EDM 64 } // namespace OHOS 65 #endif // INTERFACES_INNER_API_INCLUDE_IENTERPRISE_DEVICE_MGR_H 66