Loading include/gui/Sensor.h +2 −1 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ public: }; Sensor(); Sensor(struct sensor_t const* hwSensor); virtual ~Sensor(); const String8& getName() const; Loading include/gui/SensorEventQueue.h +9 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ namespace android { class ISensorEventConnection; class Sensor; class PollLoop; // ---------------------------------------------------------------------------- Loading @@ -56,13 +57,21 @@ public: ssize_t write(ASensorEvent const* events, size_t numEvents); ssize_t read(ASensorEvent* events, size_t numEvents); status_t waitForEvent() const; status_t wake() const; 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; private: sp<PollLoop> getPollLoop() const; sp<ISensorEventConnection> mSensorEventConnection; sp<SensorChannel> mSensorChannel; mutable Mutex mLock; mutable sp<PollLoop> mPollLoop; }; // ---------------------------------------------------------------------------- Loading include/gui/SensorManager.h +3 −3 Original line number Diff line number Diff line Loading @@ -47,13 +47,13 @@ public: SensorManager(); ~SensorManager(); ssize_t getSensorList(Sensor**) const; Sensor* getDefaultSensor(int type); ssize_t getSensorList(Sensor const* const** list) const; Sensor const* getDefaultSensor(int type); sp<SensorEventQueue> createEventQueue(); private: sp<ISensorServer> mSensorServer; Sensor* mSensorList; Sensor const** mSensorList; Vector<Sensor> mSensors; }; Loading libs/gui/ISensorEventConnection.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ public: virtual sp<SensorChannel> getSensorChannel() const { Parcel data, reply; data.writeInterfaceToken(ISensorEventConnection::getInterfaceDescriptor()); remote()->transact(GET_SENSOR_CHANNEL, data, &reply); return new SensorChannel(reply); } Loading @@ -54,6 +55,7 @@ public: virtual status_t enableDisable(int handle, bool enabled) { Parcel data, reply; data.writeInterfaceToken(ISensorEventConnection::getInterfaceDescriptor()); data.writeInt32(handle); data.writeInt32(enabled); remote()->transact(ENABLE_DISABLE, data, &reply); Loading @@ -63,6 +65,7 @@ public: virtual status_t setEventRate(int handle, nsecs_t ns) { Parcel data, reply; data.writeInterfaceToken(ISensorEventConnection::getInterfaceDescriptor()); data.writeInt32(handle); data.writeInt64(ns); remote()->transact(SET_EVENT_RATE, data, &reply); Loading libs/gui/ISensorServer.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ public: virtual Vector<Sensor> getSensorList() { Parcel data, reply; data.writeInterfaceToken(ISensorServer::getInterfaceDescriptor()); remote()->transact(GET_SENSOR_LIST, data, &reply); Sensor s; Vector<Sensor> v; Loading @@ -63,6 +64,7 @@ public: virtual sp<ISensorEventConnection> createSensorEventConnection() { Parcel data, reply; data.writeInterfaceToken(ISensorServer::getInterfaceDescriptor()); remote()->transact(CREATE_SENSOR_EVENT_CONNECTION, data, &reply); return interface_cast<ISensorEventConnection>(reply.readStrongBinder()); } Loading Loading
include/gui/Sensor.h +2 −1 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ public: }; Sensor(); Sensor(struct sensor_t const* hwSensor); virtual ~Sensor(); const String8& getName() const; Loading
include/gui/SensorEventQueue.h +9 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ namespace android { class ISensorEventConnection; class Sensor; class PollLoop; // ---------------------------------------------------------------------------- Loading @@ -56,13 +57,21 @@ public: ssize_t write(ASensorEvent const* events, size_t numEvents); ssize_t read(ASensorEvent* events, size_t numEvents); status_t waitForEvent() const; status_t wake() const; 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; private: sp<PollLoop> getPollLoop() const; sp<ISensorEventConnection> mSensorEventConnection; sp<SensorChannel> mSensorChannel; mutable Mutex mLock; mutable sp<PollLoop> mPollLoop; }; // ---------------------------------------------------------------------------- Loading
include/gui/SensorManager.h +3 −3 Original line number Diff line number Diff line Loading @@ -47,13 +47,13 @@ public: SensorManager(); ~SensorManager(); ssize_t getSensorList(Sensor**) const; Sensor* getDefaultSensor(int type); ssize_t getSensorList(Sensor const* const** list) const; Sensor const* getDefaultSensor(int type); sp<SensorEventQueue> createEventQueue(); private: sp<ISensorServer> mSensorServer; Sensor* mSensorList; Sensor const** mSensorList; Vector<Sensor> mSensors; }; Loading
libs/gui/ISensorEventConnection.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ public: virtual sp<SensorChannel> getSensorChannel() const { Parcel data, reply; data.writeInterfaceToken(ISensorEventConnection::getInterfaceDescriptor()); remote()->transact(GET_SENSOR_CHANNEL, data, &reply); return new SensorChannel(reply); } Loading @@ -54,6 +55,7 @@ public: virtual status_t enableDisable(int handle, bool enabled) { Parcel data, reply; data.writeInterfaceToken(ISensorEventConnection::getInterfaceDescriptor()); data.writeInt32(handle); data.writeInt32(enabled); remote()->transact(ENABLE_DISABLE, data, &reply); Loading @@ -63,6 +65,7 @@ public: virtual status_t setEventRate(int handle, nsecs_t ns) { Parcel data, reply; data.writeInterfaceToken(ISensorEventConnection::getInterfaceDescriptor()); data.writeInt32(handle); data.writeInt64(ns); remote()->transact(SET_EVENT_RATE, data, &reply); Loading
libs/gui/ISensorServer.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ public: virtual Vector<Sensor> getSensorList() { Parcel data, reply; data.writeInterfaceToken(ISensorServer::getInterfaceDescriptor()); remote()->transact(GET_SENSOR_LIST, data, &reply); Sensor s; Vector<Sensor> v; Loading @@ -63,6 +64,7 @@ public: virtual sp<ISensorEventConnection> createSensorEventConnection() { Parcel data, reply; data.writeInterfaceToken(ISensorServer::getInterfaceDescriptor()); remote()->transact(CREATE_SENSOR_EVENT_CONNECTION, data, &reply); return interface_cast<ISensorEventConnection>(reply.readStrongBinder()); } Loading