diff --git a/frameworks/native/sensor/src/sensor_agent_proxy.cpp b/frameworks/native/sensor/src/sensor_agent_proxy.cpp index f2de18e2b0e749c41f9c503bc3424d72aa9095b4..0a201f74788689b6c165bc18fa39f9b4cfb1e3d4 100644 --- a/frameworks/native/sensor/src/sensor_agent_proxy.cpp +++ b/frameworks/native/sensor/src/sensor_agent_proxy.cpp @@ -27,16 +27,16 @@ namespace Sensors { namespace { constexpr HiLogLabel LABEL = { LOG_CORE, SENSOR_LOG_DOMAIN, "SensorAgentProxy" }; constexpr uint32_t MAX_SENSOR_LIST_SIZE = 0Xffff; -} // namespace - -#define SenClient SensorServiceClient::GetInstance() -std::recursive_mutex SensorAgentProxy::subscribeMutex_; -std::mutex SensorAgentProxy::chanelMutex_; std::mutex sensorInfoMutex_; SensorInfo *sensorInfos_ = nullptr; std::mutex sensorActiveInfoMutex_; SensorActiveInfo *sensorActiveInfos_ = nullptr; int32_t sensorInfoCount_ = 0; +} // namespace + +#define SenClient SensorServiceClient::GetInstance() +std::recursive_mutex SensorAgentProxy::subscribeMutex_; +std::mutex SensorAgentProxy::chanelMutex_; SensorAgentProxy::SensorAgentProxy() : dataChannel_(new (std::nothrow) SensorDataChannel()) diff --git a/frameworks/native/sensor/src/sensor_data_channel.cpp b/frameworks/native/sensor/src/sensor_data_channel.cpp index fb7586c91fee288a03a85cf412f2bf43c3519a2a..0bf30d60454818451bba05ef377e24424d4f31f4 100644 --- a/frameworks/native/sensor/src/sensor_data_channel.cpp +++ b/frameworks/native/sensor/src/sensor_data_channel.cpp @@ -41,7 +41,7 @@ int32_t SensorDataChannel::RestoreSensorDataChannel() { CHKPR(dataCB_, SENSOR_NATIVE_REGSITER_CB_ERR); if (GetReceiveDataFd() != -1) { - SEN_HILOGE("fd not close"); + SEN_HILOGW("Restore sensor data channel failed, please destroy sensor data channel first."); return SENSOR_CHANNEL_RESTORE_FD_ERR; } return InnerSensorDataChannel();