mirror of
https://gitee.com/openharmony/security_security_guard
synced 2024-11-27 00:30:42 +00:00
commit
d9238de84a
@ -392,7 +392,9 @@ void SecurityCollectorManagerProxyFuzzTest(const uint8_t* data, size_t size)
|
||||
sptr<IRemoteObject> obj(new (std::nothrow) MockRemoteObject());
|
||||
sptr<Security::SecurityCollector::SecurityCollectorManagerCallbackService> callback =
|
||||
new (std::nothrow) Security::SecurityCollector::SecurityCollectorManagerCallbackService(nullptr);
|
||||
SecurityCollectorSubscribeInfo subscribeInfo{};
|
||||
std::string string(reinterpret_cast<const char *>(data), size);
|
||||
int64_t int64 = *(reinterpret_cast<const int64_t *>(data));
|
||||
SecurityCollectorSubscribeInfo subscribeInfo({int64, string, string, string});
|
||||
SecurityCollectorManagerProxy proxy{obj};
|
||||
std::vector<SecurityEventRuler> rulers{};
|
||||
std::vector<SecurityEvent> events{};
|
||||
|
@ -171,6 +171,17 @@ void OnRemoteUnsubscribeRequest(const uint8_t* data, size_t size, MessageParcel*
|
||||
SGLOGI("DataCollectManagerCallbackService called");
|
||||
return 0;
|
||||
};
|
||||
int64_t eventId = static_cast<int64_t>(size);
|
||||
std::string version(reinterpret_cast<const char *>(data), size);
|
||||
std::string content(reinterpret_cast<const char *>(data), size);
|
||||
std::string extra(reinterpret_cast<const char *>(data), size);
|
||||
int64_t duration = static_cast<int64_t>(size);
|
||||
SecurityCollector::Event event;
|
||||
event.eventId = eventId;
|
||||
event.version = version;
|
||||
event.content = content;
|
||||
event.extra = extra;
|
||||
SecurityCollector::SecurityCollectorSubscribeInfo subscriberInfo{event, duration, true};
|
||||
sptr<IRemoteObject> callback = new (std::nothrow) DataCollectManagerCallbackService(func);
|
||||
datas->WriteRemoteObject(callback);
|
||||
g_service.OnRemoteRequest(DataCollectManagerStub::CMD_DATA_UNSUBSCRIBE, *datas, *reply, *option);
|
||||
@ -271,6 +282,17 @@ void OnRemoteSecurityEventConfigQuery(const uint8_t* data, size_t size, MessageP
|
||||
SGLOGI("DataCollectManagerCallbackService called");
|
||||
return 0;
|
||||
};
|
||||
int64_t eventId = static_cast<int64_t>(size);
|
||||
std::string version(reinterpret_cast<const char *>(data), size);
|
||||
std::string content(reinterpret_cast<const char *>(data), size);
|
||||
std::string extra(reinterpret_cast<const char *>(data), size);
|
||||
int64_t duration = static_cast<int64_t>(size);
|
||||
SecurityCollector::Event event;
|
||||
event.eventId = eventId;
|
||||
event.version = version;
|
||||
event.content = content;
|
||||
event.extra = extra;
|
||||
SecurityCollector::SecurityCollectorSubscribeInfo subscriberInfo{event, duration, true};
|
||||
sptr<IRemoteObject> callback = new (std::nothrow) DataCollectManagerCallbackService(func);
|
||||
datas->WriteRemoteObject(callback);
|
||||
g_service.OnRemoteRequest(DataCollectManagerStub::CMD_SECURITY_EVENT_CONFIG_QUERY, *datas, *reply, *option);
|
||||
|
Loading…
Reference in New Issue
Block a user