Loading services/sensorservice/SensorDeviceUtils.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,11 @@ namespace android { namespace SensorDeviceUtils { HidlServiceRegistrationWaiter::HidlServiceRegistrationWaiter() { } void HidlServiceRegistrationWaiter::onFirstRef() { // Creating sp<...>(this) in the constructor should be avoided, hence // registerForNotifications is called in onFirstRef callback. mRegistered = ISensors::registerForNotifications("default", this); } Loading services/sensorservice/SensorDeviceUtils.h +2 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,8 @@ public: * @return true if service is restart since last reset(); false otherwise. */ bool wait(); protected: void onFirstRef() override; private: bool mRegistered; Loading Loading
services/sensorservice/SensorDeviceUtils.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,11 @@ namespace android { namespace SensorDeviceUtils { HidlServiceRegistrationWaiter::HidlServiceRegistrationWaiter() { } void HidlServiceRegistrationWaiter::onFirstRef() { // Creating sp<...>(this) in the constructor should be avoided, hence // registerForNotifications is called in onFirstRef callback. mRegistered = ISensors::registerForNotifications("default", this); } Loading
services/sensorservice/SensorDeviceUtils.h +2 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,8 @@ public: * @return true if service is restart since last reset(); false otherwise. */ bool wait(); protected: void onFirstRef() override; private: bool mRegistered; Loading