Loading include/gui/SensorEventQueue.h +4 −2 Original line number Diff line number Diff line Loading @@ -62,10 +62,12 @@ public: status_t enableSensor(Sensor const* sensor) const; status_t disableSensor(Sensor const* sensor) const; status_t enableSensor(int32_t handle) const; status_t disableSensor(int32_t handle) const; status_t setEventRate(Sensor const* sensor, nsecs_t ns) const; // these are here only to support SensorManager.java status_t enableSensor(int32_t handle, int32_t ms) const; status_t disableSensor(int32_t handle) const; private: sp<PollLoop> getPollLoop() const; sp<ISensorEventConnection> mSensorEventConnection; Loading libs/gui/SensorEventQueue.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -114,8 +114,12 @@ status_t SensorEventQueue::disableSensor(Sensor const* sensor) const { return mSensorEventConnection->enableDisable(sensor->getHandle(), false); } status_t SensorEventQueue::enableSensor(int32_t handle) const { return mSensorEventConnection->enableDisable(handle, true); status_t SensorEventQueue::enableSensor(int32_t handle, int32_t ms) const { status_t err = mSensorEventConnection->enableDisable(handle, true); if (err == NO_ERROR) { mSensorEventConnection->setEventRate(handle, ms2ns(ms)); } return err; } status_t SensorEventQueue::disableSensor(int32_t handle) const { Loading Loading
include/gui/SensorEventQueue.h +4 −2 Original line number Diff line number Diff line Loading @@ -62,10 +62,12 @@ public: status_t enableSensor(Sensor const* sensor) const; status_t disableSensor(Sensor const* sensor) const; status_t enableSensor(int32_t handle) const; status_t disableSensor(int32_t handle) const; status_t setEventRate(Sensor const* sensor, nsecs_t ns) const; // these are here only to support SensorManager.java status_t enableSensor(int32_t handle, int32_t ms) const; status_t disableSensor(int32_t handle) const; private: sp<PollLoop> getPollLoop() const; sp<ISensorEventConnection> mSensorEventConnection; Loading
libs/gui/SensorEventQueue.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -114,8 +114,12 @@ status_t SensorEventQueue::disableSensor(Sensor const* sensor) const { return mSensorEventConnection->enableDisable(sensor->getHandle(), false); } status_t SensorEventQueue::enableSensor(int32_t handle) const { return mSensorEventConnection->enableDisable(handle, true); status_t SensorEventQueue::enableSensor(int32_t handle, int32_t ms) const { status_t err = mSensorEventConnection->enableDisable(handle, true); if (err == NO_ERROR) { mSensorEventConnection->setEventRate(handle, ms2ns(ms)); } return err; } status_t SensorEventQueue::disableSensor(int32_t handle) const { Loading