From 497d25bad6febd6623c069eb739ed6527c923ee1 Mon Sep 17 00:00:00 2001 From: wuzhihuitmac Date: Fri, 13 Sep 2024 09:57:04 +0800 Subject: [PATCH] Modify the issue about hdi death Signed-off-by: wuzhihuitmac Change-Id: I9ce51d4d1d7844fec7c06fccccc4b4ea3f98ef53 --- services/hdi_connection/adapter/src/hdi_connection.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/services/hdi_connection/adapter/src/hdi_connection.cpp b/services/hdi_connection/adapter/src/hdi_connection.cpp index 5cd089ab..e5a09d1b 100644 --- a/services/hdi_connection/adapter/src/hdi_connection.cpp +++ b/services/hdi_connection/adapter/src/hdi_connection.cpp @@ -238,6 +238,12 @@ void HdiConnection::UpdateSensorBasicInfo(int32_t sensorId, int64_t samplingPeri SensorBasicInfo sensorBasicInfo; sensorBasicInfo.SetSamplingPeriodNs(samplingPeriodNs); sensorBasicInfo.SetMaxReportDelayNs(maxReportDelayNs); + auto it = g_sensorBasicInfoMap.find(sensorId); + if (it != g_sensorBasicInfoMap.end()) { + if (g_sensorBasicInfoMap[sensorId].GetSensorState()) { + sensorBasicInfo.SetSensorState(true); + } + } g_sensorBasicInfoMap[sensorId] = sensorBasicInfo; } -- Gitee