Loading services/sensorservice/SensorService.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -383,7 +383,8 @@ Vector<Sensor> SensorService::getSensorList() sp<ISensorEventConnection> SensorService::createSensorEventConnection() { sp<SensorEventConnection> result(new SensorEventConnection(this)); uid_t uid = IPCThreadState::self()->getCallingUid(); sp<SensorEventConnection> result(new SensorEventConnection(this, uid)); return result; } Loading Loading @@ -553,8 +554,8 @@ bool SensorService::SensorRecord::removeConnection( // --------------------------------------------------------------------------- SensorService::SensorEventConnection::SensorEventConnection( const sp<SensorService>& service) : mService(service), mChannel(new BitTube()) const sp<SensorService>& service, uid_t uid) : mService(service), mChannel(new BitTube()), mUid(uid) { } Loading services/sensorservice/SensorService.h +4 −1 Original line number Diff line number Diff line Loading @@ -77,13 +77,14 @@ class SensorService : sp<SensorService> const mService; sp<BitTube> const mChannel; uid_t mUid; mutable Mutex mConnectionLock; // protected by SensorService::mLock SortedVector<int> mSensorInfo; public: SensorEventConnection(const sp<SensorService>& service); SensorEventConnection(const sp<SensorService>& service, uid_t uid); status_t sendEvents(sensors_event_t const* buffer, size_t count, sensors_event_t* scratch = NULL); Loading @@ -91,6 +92,8 @@ class SensorService : bool hasAnySensor() const; bool addSensor(int32_t handle); bool removeSensor(int32_t handle); uid_t getUid() const { return mUid; } }; class SensorRecord { Loading Loading
services/sensorservice/SensorService.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -383,7 +383,8 @@ Vector<Sensor> SensorService::getSensorList() sp<ISensorEventConnection> SensorService::createSensorEventConnection() { sp<SensorEventConnection> result(new SensorEventConnection(this)); uid_t uid = IPCThreadState::self()->getCallingUid(); sp<SensorEventConnection> result(new SensorEventConnection(this, uid)); return result; } Loading Loading @@ -553,8 +554,8 @@ bool SensorService::SensorRecord::removeConnection( // --------------------------------------------------------------------------- SensorService::SensorEventConnection::SensorEventConnection( const sp<SensorService>& service) : mService(service), mChannel(new BitTube()) const sp<SensorService>& service, uid_t uid) : mService(service), mChannel(new BitTube()), mUid(uid) { } Loading
services/sensorservice/SensorService.h +4 −1 Original line number Diff line number Diff line Loading @@ -77,13 +77,14 @@ class SensorService : sp<SensorService> const mService; sp<BitTube> const mChannel; uid_t mUid; mutable Mutex mConnectionLock; // protected by SensorService::mLock SortedVector<int> mSensorInfo; public: SensorEventConnection(const sp<SensorService>& service); SensorEventConnection(const sp<SensorService>& service, uid_t uid); status_t sendEvents(sensors_event_t const* buffer, size_t count, sensors_event_t* scratch = NULL); Loading @@ -91,6 +92,8 @@ class SensorService : bool hasAnySensor() const; bool addSensor(int32_t handle); bool removeSensor(int32_t handle); uid_t getUid() const { return mUid; } }; class SensorRecord { Loading