diff --git a/frameworks/native/include/sensor_agent_proxy.h b/frameworks/native/include/sensor_agent_proxy.h index 58e8bd1f5ff5d0d2be2c815839a6694491ccc6d2..964dd2558031a75135f3f8714277f96de3546c91 100644 --- a/frameworks/native/include/sensor_agent_proxy.h +++ b/frameworks/native/include/sensor_agent_proxy.h @@ -55,6 +55,7 @@ private: void ClearSensorInfos() const; std::set GetSubscribeUserCallback(int32_t sensorId); bool IsSubscribeMapEmpty() const; + void PrintSersorInfo(SensorInfo *sensorInfos, int32_t sensorInfoCount) const; static std::recursive_mutex subscribeMutex_; static std::mutex chanelMutex_; OHOS::sptr dataChannel_ = nullptr; diff --git a/frameworks/native/src/sensor_agent_proxy.cpp b/frameworks/native/src/sensor_agent_proxy.cpp index 2d023b4d0eef11e2ccd2c755ccf232d6c9f80411..73a467a3cca99f2e2fed0306fb6e1fa2069fbc28 100644 --- a/frameworks/native/src/sensor_agent_proxy.cpp +++ b/frameworks/native/src/sensor_agent_proxy.cpp @@ -430,9 +430,20 @@ int32_t SensorAgentProxy::GetAllSensors(SensorInfo **sensorInfo, int32_t *count) } *sensorInfo = sensorInfos_; *count = sensorInfoCount_; + PrintSersorInfo(sensorInfos_, sensorInfoCount_); return SUCCESS; } +void SensorAgentProxy::PrintSersorInfo(SensorInfo *sensorInfos, int32_t sensorInfoCount) const +{ + std::string combineSensorIds = ""; + for (int32_t i = 0; i < sensorInfoCount; ++i) { + combineSensorIds = combineSensorIds + std::to_string(sensorInfos[i].sensorTypeId) + " "; + } + SEN_HILOGI("PrintSersorInfo success, sensorIds:%{public}s, sensorInfoCount:%{public}d", combineSensorIds.c_str(), + sensorInfoCount); +} + int32_t SensorAgentProxy::SuspendSensors(int32_t pid) { CALL_LOG_ENTER;