summaryrefslogtreecommitdiffstats
path: root/services/sensorservice/SensorService.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Add support for virtual sensors.Mathias Agopian2012-06-271-188/+159
| | | | | | | | | | | | | | | | | | | | | | Rework sensorservice to allow "virtual sensors", that is sensors that report a synthetized value based on real sensors. the main change to sensorservice is around managing which real sensor need to be activated and which rate to use. The logic for all this has been moved into SensorDevice, which essentially wraps the sensor HAL but adds two features to it: - it keeps track of which sensors need to be activated - it keeps track of what rate needs to be used For this purpose an "identity" is associated with each real sensor activation, so we can track them. On start-up we check for gravity, linear-acceleration and rotation-vector sensors, if they're not present in the HAL, we synthetize them in sensor-service. Change-Id: I841db2c1b37ef127ed571efa21732ecc5adf1800
* Fix a race condition in sensormanagerMathias Agopian2012-06-271-0/+6
| | | | | | | | | | | | the per-connection state assumed the main sensorservice lock was held during access. This is however not true while pre-processing the events just before sending them to clients. Therefore, there was a small window during which this state could be modified while being used. we now have an internal lock that protects this state. Change-Id: I594680f20f09d6a4f1f38f093a1d3f650dcef1be
* record the last event received regardless of having clients or notMathias Agopian2012-06-271-14/+20
| | | | | | | | | | | | We only recorded the last received event (which is needed when a sensor is activated on a connection) when there was some connection active. This should fix an issue where sometimes the light sensor doesn't return an event whent activated. we also didn't need to hold the main lock while dispatching events to clients. Change-Id: I6c6386c040051ce205e3c0516c678e0603fa45e1
* improve sensorservice dumpsys and increase the max sensor rate to 1 ms (1000Hz)Mathias Agopian2012-06-271-1/+2
| | | | | | | the increased maximum rate is needed for proper gyro integration, current gyro parts can sample at up to 800Hz Change-Id: Ide75f6d5bc7a0fdafeb2dafd72db39e7afb9e794
* Replace epoll() with poll() and rename PollLoop to Looper.Jeff Brown2012-06-271-1/+1
| | | | | | | | | | | | | | | As part of this change, consolidated and cleaned up the Looper API so that there are fewer distinctions between the NDK and non-NDK declarations (no need for two callback types, etc.). Removed the dependence on specific constants from sys/poll.h such as POLLIN. Instead looper.h defines events like LOOPER_EVENT_INPUT for the events that it supports. That should help make any future under-the-hood implementation changes easier. Fixed a couple of compiler warnings along the way. Change-Id: I449a7ec780bf061bdd325452f823673e2b39b6ae
* Report sensor events to BatteryStats serviceMathias Agopian2012-06-271-22/+42
| | | | Change-Id: I9b83aa709887aa658bc474391573f2d45b6c4eb2
* SensorService handles last known state properlyMathias Agopian2012-06-271-14/+70
| | | | | | | | | | SensorService now correctly sends the last known state of a sensor as soon as a new connection is made. This fixes the issue where, for instance, an application could wait a long time before getting the light or proximity sensor initial state. Change-Id: Ic41392f3626e26c4f15746c7e17c7ecd44bbb10b
* filter sensor event by connectionMathias Agopian2012-06-271-6/+18
| | | | | | | we now don't send events down to a connection that has not registered for this event. Change-Id: I3fe507974d3e99293749bfec2ef871e8a0ee9600
* propagate sensor event rate properly to the sensor HALMathias Agopian2012-06-271-43/+78
| | | | Change-Id: I1abe4c0fcce423caab79208353fded4d57398227
* propagate sensor event rate properlyMathias Agopian2012-06-271-1/+9
| | | | Change-Id: I32e67d30e4295285a6827956cc8161b2025d70bc
* SensorService doesn't crash if correct HAL is not presentMathias Agopian2012-06-271-14/+33
| | | | Change-Id: I83700b1a1b43390f5830e1056572bfb16e58e8e4
* Better dumpsys logsMathias Agopian2012-06-271-2/+16
| | | | Change-Id: Iae65a8547ee5815cc4c3b74d2c9ef17bed7f565d
* Added partial support for repporting sensor activity to IBatteryStatsMathias Agopian2012-06-271-0/+37
| | | | Change-Id: I2af319d89e49b0f2349ec9d8b0fccac80e9bc047
* new SensorServiceMathias Agopian2012-06-271-0/+359
remove old sensor service and implement SensorManager on top of the new (native) SensorManger API. Change-Id: Iddb77d498755da3e11646473a44d651f12f40281