• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 INTERFACES_INNER_API_INCLUDE_IENTERPRISE_DEVICE_MGR_H
17 #define INTERFACES_INNER_API_INCLUDE_IENTERPRISE_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 EnableAdmin(AppExecFwk::ElementName &admin, EntInfo &entInfo, AdminType type,
34         int32_t userId) = 0;
35     virtual ErrCode DisableAdmin(AppExecFwk::ElementName &admin, int32_t userId) = 0;
36     virtual ErrCode DisableSuperAdmin(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 GetEnabledAdmin(AdminType type, std::vector<std::string> &enabledAdminList) = 0;
40     virtual ErrCode GetEnterpriseInfo(AppExecFwk::ElementName &admin, MessageParcel &reply) = 0;
41     virtual ErrCode SetEnterpriseInfo(AppExecFwk::ElementName &admin, EntInfo &entInfo) = 0;
42     virtual ErrCode SubscribeManagedEvent(const AppExecFwk::ElementName &admin,
43         const std::vector<uint32_t> &events) = 0;
44     virtual ErrCode UnsubscribeManagedEvent(const AppExecFwk::ElementName &admin,
45         const std::vector<uint32_t> &events) = 0;
46     virtual bool IsSuperAdmin(std::string &bundleName) = 0;
47     virtual bool IsAdminEnabled(AppExecFwk::ElementName &admin, int32_t userId) = 0;
48     enum {
49         ADD_DEVICE_ADMIN = 1,
50         REMOVE_DEVICE_ADMIN = 2,
51         GET_PERMISSION_REQUEST = 3,
52         REMOVE_SUPER_ADMIN = 4,
53         GET_ENABLED_ADMIN = 5,
54         GET_ENT_INFO = 6,
55         SET_ENT_INFO = 7,
56         IS_SUPER_ADMIN = 8,
57         IS_ADMIN_ENABLED = 9,
58         SUBSCRIBE_MANAGED_EVENT = 10,
59         UNSUBSCRIBE_MANAGED_EVENT = 11,
60     };
61 };
62 } // namespace EDM
63 } // namespace OHOS
64 #endif // INTERFACES_INNER_API_INCLUDE_IENTERPRISE_DEVICE_MGR_H
65