From 67d4d6a1b5f970ce336f3e513742478b90a366aa Mon Sep 17 00:00:00 2001 From: hui1975 Date: Mon, 4 Sep 2023 12:13:18 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=E8=B0=83=E6=95=B4restore=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hui1975 Change-Id: Ic3253c923dde9dfe9e7e647f9dfe587a8d10a6a8 --- frameworks/native/sensor/src/sensor_data_channel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frameworks/native/sensor/src/sensor_data_channel.cpp b/frameworks/native/sensor/src/sensor_data_channel.cpp index fb7586c9..0bf30d60 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(); -- Gitee From 2408851724befa279d91238002d0a5ade0e8ef6f Mon Sep 17 00:00:00 2001 From: hui1975 Date: Tue, 5 Sep 2023 02:47:58 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=E5=B0=86=E5=8F=98=E9=87=8F=E6=94=BE?= =?UTF-8?q?=E5=88=B0=E5=8C=BF=E5=90=8Dnamespace=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hui1975 Change-Id: I072c4588f2bd6fdd54adf40e732349e9bd7d4a5f --- frameworks/native/sensor/src/sensor_agent_proxy.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frameworks/native/sensor/src/sensor_agent_proxy.cpp b/frameworks/native/sensor/src/sensor_agent_proxy.cpp index f2de18e2..0a201f74 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()) -- Gitee