From 605531d5960cdb110ee2bd72748e862aa30a60e0 Mon Sep 17 00:00:00 2001 From: li-yaoyao777 Date: Fri, 16 Sep 2022 14:27:21 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99log?= =?UTF-8?q?=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-yaoyao777 --- services/sensor/src/client_info.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/services/sensor/src/client_info.cpp b/services/sensor/src/client_info.cpp index 1024cbca..122c727f 100644 --- a/services/sensor/src/client_info.cpp +++ b/services/sensor/src/client_info.cpp @@ -352,7 +352,6 @@ bool ClientInfo::DestroySensorChannel(int32_t pid) SensorBasicInfo ClientInfo::GetCurPidSensorInfo(uint32_t sensorId, int32_t pid) { - SEN_HILOGD("begin, sensorId:%{public}u", sensorId); int64_t minSamplingPeriodNs = LLONG_MAX; int64_t minReportDelayNs = LLONG_MAX; SensorBasicInfo sensorInfo; @@ -467,7 +466,6 @@ void ClientInfo::StoreEvent(const SensorEvent &event) } for (size_t i = 0; i < sensors.size(); i++) { if ((int32_t)(sensors[i].GetSensorId()) == storedEvent.sensorTypeId) { - SEN_HILOGD("sensorFlags:%{public}u", sensors[i].GetFlags()); foundSensor = true; break; } -- Gitee From d83a0e7690b9821e4b98b5efdc3b40bdfa207280 Mon Sep 17 00:00:00 2001 From: li-yaoyao777 Date: Wed, 9 Nov 2022 14:54:19 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=88=A0=E9=99=A4make=5Funique,make=5Fshar?= =?UTF-8?q?ed=E5=86=97=E4=BD=99=E7=9A=84=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-yaoyao777 --- frameworks/native/sensor/src/sensor_data_channel.cpp | 2 -- .../hdi_connection/interface/src/sensor_hdi_connection.cpp | 1 - utils/src/sensor.cpp | 2 -- 3 files changed, 5 deletions(-) diff --git a/frameworks/native/sensor/src/sensor_data_channel.cpp b/frameworks/native/sensor/src/sensor_data_channel.cpp index 1f466c9b..d4d706cc 100644 --- a/frameworks/native/sensor/src/sensor_data_channel.cpp +++ b/frameworks/native/sensor/src/sensor_data_channel.cpp @@ -57,11 +57,9 @@ int32_t SensorDataChannel::InnerSensorDataChannel() return ret; } auto listener = std::make_shared(); - listener->SetChannel(this); auto myRunner = AppExecFwk::EventRunner::Create(true); CHKPR(myRunner, ERROR); eventHandler_ = std::make_shared(myRunner); - CHKPR(eventHandler_, ERROR); int32_t receiveFd = GetReceiveDataFd(); auto inResult = eventHandler_->AddFileDescriptorListener(receiveFd, AppExecFwk::FILE_DESCRIPTOR_INPUT_EVENT, listener); diff --git a/services/sensor/hdi_connection/interface/src/sensor_hdi_connection.cpp b/services/sensor/hdi_connection/interface/src/sensor_hdi_connection.cpp index 7f1ca5e6..c2c6596f 100644 --- a/services/sensor/hdi_connection/interface/src/sensor_hdi_connection.cpp +++ b/services/sensor/hdi_connection/interface/src/sensor_hdi_connection.cpp @@ -29,7 +29,6 @@ constexpr HiLogLabel LABEL = { LOG_CORE, SENSOR_LOG_DOMAIN, "SensorHdiConnection int32_t SensorHdiConnection::ConnectHdi() { iSensorHdiConnection_ = std::make_unique(); - CHKPR(iSensorHdiConnection_, ERROR); int32_t ret = ConnectHdiService(); if (ret != ERR_OK) { SEN_HILOGE("connect hdi service failed, try to connect compatible connection"); diff --git a/utils/src/sensor.cpp b/utils/src/sensor.cpp index 69d5a512..29d847cd 100644 --- a/utils/src/sensor.cpp +++ b/utils/src/sensor.cpp @@ -230,8 +230,6 @@ bool Sensor::Marshalling(Parcel &parcel) const std::unique_ptr Sensor::Unmarshalling(Parcel &parcel) { auto sensor = std::make_unique(); - CHKPP(sensor); - if (!sensor->ReadFromParcel(parcel)) { SEN_HILOGE("ReadFromParcel is failed"); return nullptr; -- Gitee From 640574679a08e4b36476687e43a62263fd4f2c26 Mon Sep 17 00:00:00 2001 From: li-yaoyao777 Date: Wed, 9 Nov 2022 15:40:05 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=86=97=E4=BD=99?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-yaoyao777 --- frameworks/native/sensor/src/sensor_data_channel.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/frameworks/native/sensor/src/sensor_data_channel.cpp b/frameworks/native/sensor/src/sensor_data_channel.cpp index d4d706cc..501a6d0e 100644 --- a/frameworks/native/sensor/src/sensor_data_channel.cpp +++ b/frameworks/native/sensor/src/sensor_data_channel.cpp @@ -57,6 +57,7 @@ int32_t SensorDataChannel::InnerSensorDataChannel() return ret; } auto listener = std::make_shared(); + listener->SetChannel(this); auto myRunner = AppExecFwk::EventRunner::Create(true); CHKPR(myRunner, ERROR); eventHandler_ = std::make_shared(myRunner); -- Gitee