1 /* 2 * Copyright (c) 2022 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 EDM_ENTERPRISE_DEVICE_MGR_H 17 #define EDM_ENTERPRISE_DEVICE_MGR_H 18 #include <string> 19 #include "admin_type.h" 20 #include "ent_info.h" 21 #include "edm_errors.h" 22 #include "element_name.h" 23 #include "iremote_broker.h" 24 #include "iremote_object.h" 25 #include "iremote_proxy.h" 26 #include "iremote_stub.h" 27 28 namespace OHOS { 29 namespace EDM { 30 class IEnterpriseDeviceMgr : public IRemoteBroker { 31 public: 32 DECLARE_INTERFACE_DESCRIPTOR(u"ohos.edm.IEnterpriseDeviceMgr"); 33 virtual ErrCode ActiveAdmin(AppExecFwk::ElementName &admin, EntInfo &entInfo, AdminType type, 34 int32_t userId) = 0; 35 virtual ErrCode DeactiveAdmin(AppExecFwk::ElementName &admin, int32_t userId) = 0; 36 virtual ErrCode DeactiveSuperAdmin(std::string &bundleName) = 0; 37 virtual ErrCode HandleDevicePolicy(uint32_t code, AppExecFwk::ElementName &admin, MessageParcel &data) = 0; 38 virtual ErrCode GetDevicePolicy(uint32_t code, AppExecFwk::ElementName *admin, MessageParcel &reply) = 0; 39 virtual ErrCode GetActiveAdmin(AdminType type, std::vector<std::string> &activeAdminList) = 0; 40 virtual ErrCode GetEnterpriseInfo(AppExecFwk::ElementName &admin, MessageParcel &reply) = 0; 41 virtual ErrCode SetEnterpriseInfo(AppExecFwk::ElementName &admin, EntInfo &entInfo) = 0; 42 virtual bool IsSuperAdmin(std::string &bundleName) = 0; 43 virtual bool IsAdminActive(AppExecFwk::ElementName &admin) = 0; 44 enum { 45 ADD_DEVICE_ADMIN = 1, 46 REMOVE_DEVICE_ADMIN = 2, 47 GET_PERMISSION_REQUEST = 3, 48 REMOVE_SUPER_ADMIN = 4, 49 GET_ACTIVE_ADMIN = 5, 50 GET_ENT_INFO = 6, 51 SET_ENT_INFO = 7, 52 IS_SUPER_ADMIN = 8, 53 IS_ADMIN_ACTIVE = 9, 54 }; 55 }; 56 } // namespace EDM 57 } // namespace OHOS 58 #endif // EDM_ENTERPRISE_DEVICE_MGR_H 59