diff --git a/services/hdi_connection/adapter/src/hdi_connection.cpp b/services/hdi_connection/adapter/src/hdi_connection.cpp index 5cd089aba48c7bb2175b0fbb7c9169b94846fb44..e5a09d1b7a55eab4e461744c81dba63bac91491d 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; }