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 7d898357b98ede5843e645c5a29535760fd978ee..f2117c3256669bc2db75b5e98dfe2041db4195bf 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 8c07da00c971549f3f14d4472c564105414bf02a..553993d032d0757c6987d1ec214101a80be7c507 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)