From f1ed42f91cd6ead58033a891efc82bf7d6584c29 Mon Sep 17 00:00:00 2001 From: yue Date: Fri, 29 Apr 2022 15:43:38 +0800 Subject: [PATCH] feat:support hdi passthrought mode Signed-off-by: yue --- .../hdi_connection/adapter/include/sensor_event_callback.h | 6 +++--- .../sensor/hdi_connection/adapter/src/hdi_connection.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/services/sensor/hdi_connection/adapter/include/sensor_event_callback.h b/services/sensor/hdi_connection/adapter/include/sensor_event_callback.h index 7d898357..f2117c32 100644 --- a/services/sensor/hdi_connection/adapter/include/sensor_event_callback.h +++ b/services/sensor/hdi_connection/adapter/include/sensor_event_callback.h @@ -16,14 +16,14 @@ #ifndef SENSOR_EVENT_CALLBACK_H #define SENSOR_EVENT_CALLBACK_H -#include "v1_0/sensor_callback_stub.h" +#include "v1_0/isensor_callback.h" using OHOS::HDI::Sensor::V1_0::HdfSensorEvents; -using OHOS::HDI::Sensor::V1_0::SensorCallbackStub; +using OHOS::HDI::Sensor::V1_0::ISensorCallback; namespace OHOS { namespace Sensors { -class SensorEventCallback : public SensorCallbackStub { +class SensorEventCallback : public ISensorCallback { public: virtual ~SensorEventCallback() {} diff --git a/services/sensor/hdi_connection/adapter/src/hdi_connection.cpp b/services/sensor/hdi_connection/adapter/src/hdi_connection.cpp index 8c07da00..553993d0 100644 --- a/services/sensor/hdi_connection/adapter/src/hdi_connection.cpp +++ b/services/sensor/hdi_connection/adapter/src/hdi_connection.cpp @@ -236,7 +236,7 @@ void HdiConnection::RegisterHdiDeathRecipient() CHKPV(sensorInterface_); hdiDeathObserver_ = new (std::nothrow) DeathRecipientTemplate(*const_cast(this)); CHKPV(hdiDeathObserver_); - sensorInterface_->AsObject()->AddDeathRecipient(hdiDeathObserver_); + OHOS::HDI::hdi_objcast(sensorInterface_)->AddDeathRecipient(hdiDeathObserver_); } void HdiConnection::UnregisterHdiDeathRecipient() @@ -244,7 +244,7 @@ void HdiConnection::UnregisterHdiDeathRecipient() CALL_LOG_ENTER; CHKPV(sensorInterface_); CHKPV(hdiDeathObserver_); - sensorInterface_->AsObject()->RemoveDeathRecipient(hdiDeathObserver_); + OHOS::HDI::hdi_objcast(sensorInterface_)->RemoveDeathRecipient(hdiDeathObserver_); } void HdiConnection::ProcessDeathObserver(const wptr &object) -- Gitee