• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
16 #ifndef REQUEST_SECURITY_EVENT_INFO_NAPI_H
17 #define REQUEST_SECURITY_EVENT_INFO_NAPI_H
18 #include <map>
19 #include "event_info.h"
20 #include "event_define.h"
21 #include "security_guard_define.h"
22 #include "system_ability_load_callback_stub.h"
23 #include "security_event_query_callback.h"
24 #include "security_event_ruler.h"
25 #include "i_collector_subscriber.h"
26 #include "acquire_data_manager_callback_service.h"
27 #include "sg_classify_client.h"
28 namespace OHOS::Security::SecurityGuard {
29 class SecurityGuardSdkAdaptor {
30 public:
31     static int32_t RequestSecurityEventInfo(std::string &devId, std::string &eventList,
32         RequestRiskDataCallback callback);
33     static int32_t InnerRequestSecurityModelResult(const std::string &devId, uint32_t modelId,
34         const std::string &param, SecurityGuardRiskCallback callback);
35     static int32_t InnerReportSecurityInfo(const std::shared_ptr<EventInfo> &info);
36     static int32_t StartCollector(const SecurityCollector::Event &event, int64_t duration);
37     static int32_t StopCollector(const SecurityCollector::Event &event);
38     static int32_t QuerySecurityEvent(std::vector<SecurityCollector::SecurityEventRuler> rulers,
39         std::shared_ptr<SecurityEventQueryCallback> callback);
40     static int32_t Subscribe(const std::shared_ptr<SecurityCollector::ICollectorSubscriber> &subscriber);
41     static int32_t Unsubscribe(const std::shared_ptr<SecurityCollector::ICollectorSubscriber> &subscriber);
42     static int32_t ConfigUpdate(const SecurityGuard::SecurityConfigUpdateInfo &updateInfo);
43 private:
44     SecurityGuardSdkAdaptor() = delete;
45     ~SecurityGuardSdkAdaptor() = delete;
46 };
47 } // OHOS::Security::SecurityGuard
48 
49 #endif // REQUEST_SECURITY_EVENT_INFO_NAPI_H