summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2010-07-21 16:06:46 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-07-21 16:06:46 -0700
commite4764521353e898554931a557460fc49209fb0a9 (patch)
tree261afe438ecda0a438afe04c8a5e1c40bf978d63 /include
parent3685db7f5dd8a830a4e096404d4924e12697fb78 (diff)
parent1bf797857e025e8a71db86fb9e79765a767ec1eb (diff)
downloadframeworks_base-e4764521353e898554931a557460fc49209fb0a9.zip
frameworks_base-e4764521353e898554931a557460fc49209fb0a9.tar.gz
frameworks_base-e4764521353e898554931a557460fc49209fb0a9.tar.bz2
Merge "new SensorService" into gingerbread
Diffstat (limited to 'include')
-rw-r--r--include/gui/ISensorServer.h2
-rw-r--r--include/gui/Sensor.h3
-rw-r--r--include/gui/SensorEventQueue.h9
-rw-r--r--include/gui/SensorManager.h6
4 files changed, 15 insertions, 5 deletions
diff --git a/include/gui/ISensorServer.h b/include/gui/ISensorServer.h
index 3e05076..9c8afc5 100644
--- a/include/gui/ISensorServer.h
+++ b/include/gui/ISensorServer.h
@@ -36,7 +36,7 @@ class ISensorServer : public IInterface
public:
DECLARE_META_INTERFACE(SensorServer);
- virtual Vector<Sensor> getSensorList()= 0;
+ virtual Vector<Sensor> getSensorList() = 0;
virtual sp<ISensorEventConnection> createSensorEventConnection() = 0;
};
diff --git a/include/gui/Sensor.h b/include/gui/Sensor.h
index 86a16f1..e696d63 100644
--- a/include/gui/Sensor.h
+++ b/include/gui/Sensor.h
@@ -51,7 +51,8 @@ public:
TYPE_PROXIMITY = ASENSOR_TYPE_PROXIMITY
};
- Sensor();
+ Sensor();
+ Sensor(struct sensor_t const* hwSensor);
virtual ~Sensor();
const String8& getName() const;
diff --git a/include/gui/SensorEventQueue.h b/include/gui/SensorEventQueue.h
index d8d8128..bb03c12 100644
--- a/include/gui/SensorEventQueue.h
+++ b/include/gui/SensorEventQueue.h
@@ -42,6 +42,7 @@ namespace android {
class ISensorEventConnection;
class Sensor;
+class PollLoop;
// ----------------------------------------------------------------------------
@@ -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;
};
// ----------------------------------------------------------------------------
diff --git a/include/gui/SensorManager.h b/include/gui/SensorManager.h
index 0d65334..e1b1a7b 100644
--- a/include/gui/SensorManager.h
+++ b/include/gui/SensorManager.h
@@ -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;
};