From 6ea4ffa21df40a95509581ee60e9f9c0f4ad18bf Mon Sep 17 00:00:00 2001 From: cff-gite Date: Tue, 15 Mar 2022 15:51:25 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9sensor=E6=A3=80=E8=A7=86?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: cff-gite --- frameworks/native/sensor/src/sensor_agent_proxy.cpp | 4 ---- services/sensor/src/client_info.cpp | 1 + services/sensor/src/sensor_data_processer.cpp | 3 --- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/frameworks/native/sensor/src/sensor_agent_proxy.cpp b/frameworks/native/sensor/src/sensor_agent_proxy.cpp index e3a1eebe..1865bfc7 100644 --- a/frameworks/native/sensor/src/sensor_agent_proxy.cpp +++ b/frameworks/native/sensor/src/sensor_agent_proxy.cpp @@ -99,10 +99,6 @@ void SensorAgentProxy::HandleSensorData(struct SensorEvent *events, int32_t num, struct SensorEvent eventStream; for (int32_t i = 0; i < num; ++i) { eventStream = events[i]; - if (eventStream.data == nullptr || g_subscribeMap[eventStream.sensorTypeId] == nullptr) { - HiLog::Error(LABEL, "%{public}s data or sensorUser is nullptr", __func__); - return; - } if (g_subscribeMap.find(eventStream.sensorTypeId) == g_subscribeMap.end()) { HiLog::Error(LABEL, "%{public}s sensorTypeId not in g_subscribeMap", __func__); return; diff --git a/services/sensor/src/client_info.cpp b/services/sensor/src/client_info.cpp index 19a6a426..c39ee3e0 100644 --- a/services/sensor/src/client_info.cpp +++ b/services/sensor/src/client_info.cpp @@ -671,6 +671,7 @@ std::vector ClientInfo::GetCmdList(uint32_t sensorId, int32_t uid) void ClientInfo::UpdateDataQueue(int32_t sensorId, struct SensorEvent &event) { + HiLog::Debug(LABEL, "%{public}s begin", __func__); if (sensorId == HEART_RATE_SENSOR_ID) { return; } diff --git a/services/sensor/src/sensor_data_processer.cpp b/services/sensor/src/sensor_data_processer.cpp index 044b7364..c5cb6646 100644 --- a/services/sensor/src/sensor_data_processer.cpp +++ b/services/sensor/src/sensor_data_processer.cpp @@ -337,9 +337,6 @@ void SensorDataProcesser::EventFilter(struct CircularEventBuf &eventsBuf) } } } else { - if (channelList.empty() || channelList.size() == 0) { - HiLog::Error(LABEL, "%{public}s channelList is empty", __func__); - } for (auto &channel : channelList) { int32_t index = flushInfo_.GetFlushChannelIndex(flushVec, channel); if (index >= 0) { -- Gitee From 3112181529e85b0f86c88ead3684eb907462d6b2 Mon Sep 17 00:00:00 2001 From: cff-gite Date: Wed, 16 Mar 2022 09:06:12 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9sensor=E6=A3=80=E8=A7=86?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: cff-gite --- frameworks/native/sensor/src/sensor_agent_proxy.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frameworks/native/sensor/src/sensor_agent_proxy.cpp b/frameworks/native/sensor/src/sensor_agent_proxy.cpp index 1865bfc7..b1154689 100644 --- a/frameworks/native/sensor/src/sensor_agent_proxy.cpp +++ b/frameworks/native/sensor/src/sensor_agent_proxy.cpp @@ -99,6 +99,10 @@ void SensorAgentProxy::HandleSensorData(struct SensorEvent *events, int32_t num, struct SensorEvent eventStream; for (int32_t i = 0; i < num; ++i) { eventStream = events[i]; + if (eventStream.data == nullptr) { + HiLog::Error(LABEL, "%{public}s data or sensorUser is nullptr", __func__); + return; + } if (g_subscribeMap.find(eventStream.sensorTypeId) == g_subscribeMap.end()) { HiLog::Error(LABEL, "%{public}s sensorTypeId not in g_subscribeMap", __func__); return; -- Gitee From 9a8fe45dba51cdfcbd0f34b6425d29fd67aeae89 Mon Sep 17 00:00:00 2001 From: cff-gite Date: Wed, 16 Mar 2022 09:46:13 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9sensor=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: cff-gite --- frameworks/native/sensor/src/sensor_agent_proxy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frameworks/native/sensor/src/sensor_agent_proxy.cpp b/frameworks/native/sensor/src/sensor_agent_proxy.cpp index b1154689..5a769a1b 100644 --- a/frameworks/native/sensor/src/sensor_agent_proxy.cpp +++ b/frameworks/native/sensor/src/sensor_agent_proxy.cpp @@ -100,7 +100,7 @@ void SensorAgentProxy::HandleSensorData(struct SensorEvent *events, int32_t num, for (int32_t i = 0; i < num; ++i) { eventStream = events[i]; if (eventStream.data == nullptr) { - HiLog::Error(LABEL, "%{public}s data or sensorUser is nullptr", __func__); + HiLog::Error(LABEL, "%{public}s data is nullptr", __func__); return; } if (g_subscribeMap.find(eventStream.sensorTypeId) == g_subscribeMap.end()) { -- Gitee