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 #ifndef I_SECURITY_COMPONENT_SERVICE_H
16 #define I_SECURITY_COMPONENT_SERVICE_H
17 
18 #include <string>
19 #include "access_token.h"
20 #include "iremote_broker.h"
21 #include "sec_comp_info.h"
22 #include "security_component_service_ipc_interface_code.h"
23 
24 namespace OHOS {
25 namespace Security {
26 namespace SecurityComponent {
27 constexpr int32_t SA_ID_SECURITY_COMPONENT_SERVICE = 3506;
28 
29 class ISecCompService : public IRemoteBroker {
30 public:
31     DECLARE_INTERFACE_DESCRIPTOR(u"ohos.security.ISecCompService");
32 
33     virtual int32_t RegisterSecurityComponent(SecCompType type,
34         const std::string& componentInfo, int32_t& scId) = 0;
35     virtual int32_t UpdateSecurityComponent(int32_t scId, const std::string& componentInfo) = 0;
36     virtual int32_t UnregisterSecurityComponent(int32_t scId) = 0;
37     virtual int32_t ReportSecurityComponentClickEvent(int32_t scId, const std::string& componentInfo,
38         const SecCompClickEvent& clickInfo, sptr<IRemoteObject> callerToken, sptr<IRemoteObject> dialogCallback) = 0;
39     virtual bool VerifySavePermission(AccessToken::AccessTokenID tokenId) = 0;
40     virtual sptr<IRemoteObject> GetEnhanceRemoteObject() = 0;
41     virtual int32_t PreRegisterSecCompProcess() = 0;
42 };
43 }  // namespace SecurityComponent
44 }  // namespace Security
45 }  // namespace OHOS
46 #endif  // I_SECURITY_COMPONENT_SERVICE_H
47