summaryrefslogtreecommitdiffstats
path: root/services/sensorservice/SensorService.h
diff options
context:
space:
mode:
Diffstat (limited to 'services/sensorservice/SensorService.h')
-rw-r--r--services/sensorservice/SensorService.h15
1 files changed, 6 insertions, 9 deletions
diff --git a/services/sensorservice/SensorService.h b/services/sensorservice/SensorService.h
index 0887f28..9654f65 100644
--- a/services/sensorservice/SensorService.h
+++ b/services/sensorservice/SensorService.h
@@ -45,14 +45,6 @@
// For older HALs which don't support batching, use a smaller socket buffer size.
#define SOCKET_BUFFER_SIZE_NON_BATCHED 4 * 1024
-// Flags for sensors_event_t.flag. Using only the most significant two bits for flags.
-// MSB is to invalidate a sensor_event (typically a flush_complete_event) so that
-// it won't be used by other connections.
-// MSB 2nd bit is used to indicate whether the event needs to be acknowledged or not.
-// This is typically used for WAKE_UP sensors. WAKE_UP_SENSOR_EVENT_NEEDS_ACK is defined
-// in SensorEveneQueue.h
-#define SENSOR_EVENT_INVALID_FLAG (1U << 31)
-
struct sensors_poll_device_t;
struct sensors_module_t;
@@ -157,9 +149,11 @@ class SensorService :
SensorEventConnection(const sp<SensorService>& service, uid_t uid);
status_t sendEvents(sensors_event_t* buffer, size_t count,
- sensors_event_t* scratch);
+ sensors_event_t* scratch,
+ SensorEventConnection const * const * mapFlushEventsToConnections = NULL);
bool hasSensor(int32_t handle) const;
bool hasAnySensor() const;
+ bool hasOneShotSensors() const;
bool addSensor(int32_t handle);
bool removeSensor(int32_t handle);
void setFirstFlushPending(int32_t handle, bool value);
@@ -237,6 +231,9 @@ class SensorService :
DefaultKeyedVector<int, SensorInterface*> mActiveVirtualSensors;
SortedVector< wp<SensorEventConnection> > mActiveConnections;
bool mWakeLockAcquired;
+ sensors_event_t *mSensorEventBuffer, *mSensorEventScratch;
+ SensorEventConnection const **mMapFlushEventsToConnections;
+
// The size of this vector is constant, only the items are mutable
KeyedVector<int32_t, sensors_event_t> mLastEventSeen;