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 SECURITY_GUARD_IRISK_ANALYSIS_MANAGER_H 17 #define SECURITY_GUARD_IRISK_ANALYSIS_MANAGER_H 18 19 #include <cstdint> 20 #include <cstring> 21 22 #include "iremote_broker.h" 23 #include "message_parcel.h" 24 25 #include "risk_analysis_manager_service_ipc_interface_code.h" 26 27 namespace OHOS::Security::SecurityGuard { 28 constexpr int32_t RISK_ANALYSIS_MANAGER_SA_ID = 3523; 29 30 class IRiskAnalysisManager : public IRemoteBroker { 31 public: 32 using InterfaceCode = RiskAnalysisManagerInterfaceCode; 33 DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.Security.RiskAnalysisManager"); 34 enum { 35 CMD_GET_SECURITY_MODEL_RESULT = static_cast<uint32_t>(InterfaceCode::CMD_GET_SECURITY_MODEL_RESULT), 36 CMD_SET_MODEL_STATE = static_cast<uint32_t>(InterfaceCode::CMD_SET_MODEL_STATE), 37 }; 38 39 virtual int32_t RequestSecurityModelResult(const std::string &devId, uint32_t modelId, 40 const std::string ¶m, const sptr<IRemoteObject> &callback) = 0; 41 virtual int32_t SetModelState(uint32_t modelId, bool enable) = 0; 42 }; 43 44 class IRiskAnalysisManagerCallback : public IRemoteBroker { 45 public: 46 using InterfaceCode = RiskAnalysisManagerCallbackInterfaceCode; 47 DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.Security.RiskAnalysisManager.Callback"); 48 enum { 49 CMD_SET_SECURITY_MODEL_RESULT = static_cast<uint32_t>(InterfaceCode::CMD_SET_SECURITY_MODEL_RESULT), 50 }; 51 52 virtual int32_t ResponseSecurityModelResult(const std::string &devId, uint32_t modelId, std::string &result) = 0; 53 }; 54 } // namespace OHOS::Security::SecurityGuard 55 56 #endif // SECURITY_GUARD_IRISK_ANALYSIS_MANAGER_H 57