History log of /frameworks/base/services/sensorservice/SensorService.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
37d95f6f91713825ebb5edd6ce4e376fc093a750 10-Nov-2011 Mathias Agopian <mathias@google.com> handle EINTR when calling sensor HAL's poll function

some sensor HALs don't handle EINTR, make sure to catch it in the
sensorservice.

also if we ever encounter an error that we can't handle, we abort
which will restart us (or the whole system process if we're running
in it)

Bug: 5511741
Change-Id: I7051882b06980f778736b53d6cd021a99b5ca8d2
/frameworks/base/services/sensorservice/SensorService.cpp
eed2373321a84560961884697b4bd92d0ee9f7c9 08-Nov-2011 Mathias Agopian <mathias@google.com> SensorService now always clamps the requested rate

Requested rate will be clamped to the minimum rate and then
to 1ms. Previously we would return an error if a lower
rate was asked. The SensorManager documentation wording
allows this change.

We do this to get more consistancy between all the sensor
drivers / HALs

Change-Id: I199f76486fb76ccbb11e7280460a03726c767e84
/frameworks/base/services/sensorservice/SensorService.cpp
f61acdac57ddac5ebc1b1ca009351fca86926152 02-Nov-2011 Mathias Agopian <mathias@google.com> fix an issue where SensorService could request an invalid sensor delay

When the app requests "fastest", the java layer encodes this as a
delay of 0. SensorService was passing this unchanged to the HAL.
However the HAL is required to reject delays lower that the
advertised lower delay.

Change-Id: I92be77acd3af62ffeb49e4b31e24ddcd203510e2
/frameworks/base/services/sensorservice/SensorService.cpp
f9a4b1366e6d77f5044a4a8de8f14d391baf6a2b 21-Jul-2011 Mathias Agopian <mathias@google.com> silence sensorservice when it's dropping events

Change-Id: Ib05862e545aa780821aa605e45ab189f530494b7
/frameworks/base/services/sensorservice/SensorService.cpp
29c176f043333c2d286bbe7d5e6a82d2af97b535 15-Jul-2011 Mathias Agopian <mathias@google.com> sensorservice: be more robust when there are no sensor h/w

Bug: 5030108
Change-Id: I45b85b3c492b9268cb0ae44d2e5fc8c708b6e66e
/frameworks/base/services/sensorservice/SensorService.cpp
0dd593f22352a0863223fa4ea7e37e926b99282e 28-Jun-2011 Mathias Agopian <mathias@google.com> PermissionCache caches permission checks

This is intended to absorb the cost of the IPC
to the permission controller.
Cached permission checks cost about 3us, while
full blown ones are two orders of magnitude slower.

CAVEAT: PermissionCache can only handle system
permissions safely for now, because the cache is
not purged upon global permission changes.

Change-Id: I8b8a5e71e191e3c01e8f792f253c379190eee62e
/frameworks/base/services/sensorservice/SensorService.cpp
f8a6737f3d812b6b151990ad1695b55bfb0d8dda 09-Jun-2011 Mathias Agopian <mathias@google.com> improve orientation sensor with gyro data

when we do our own sensor fusion, we also export an
improved orientation sensor and hide the HAL sensor.
The fused orientation sensor is much more precise, fast
and smooth.

Change-Id: I0ea843b47ad9d12f6b22cce51f8629852d423126
/frameworks/base/services/sensorservice/SensorService.cpp
6043e5329cc023ae1bf6c0b7b750e584c1ebfbf4 28-May-2011 Mathias Agopian <mathias@google.com> use quaternions instead of MRPs

also use correct time propagation equation
disable the fused sensors when gyro is not present since
they were unusable in practice.

Change-Id: Iad797425784e67dc6c5690e97c71c583418cc5b5
/frameworks/base/services/sensorservice/SensorService.cpp
73e0bc805a143d8cc2202fccb73230459edc6869 18-May-2011 Mathias Agopian <mathias@google.com> 9-axis sensor fusion with Kalman filter

Add support for 9-axis gravity and linear-acceleration sensors
virtual orientation sensor using 9-axis fusion

Change-Id: I6717539373fce781c10e97b6fa59f68a831a592f
/frameworks/base/services/sensorservice/SensorService.cpp
9ff73de08f137ba03e18b8fd9fe0b070029c00f5 28-May-2011 Mathias Agopian <mathias@google.com> Fix a few issues with sensors reference-counting
/frameworks/base/services/sensorservice/SensorService.cpp
057f625cd9a1c0d1b1e7a5449fccd92de30c70ea 20-May-2011 Mathias Agopian <mathias@google.com> Fix a crasher in SensorService

SensorService main thread wasn't java-enabled. however, in
some situations we end-up calling into the BatteryService from
that thread which causes a crash.

Change-Id: Iffba90e4c4b743dba84d62f1342001a9db31916d
/frameworks/base/services/sensorservice/SensorService.cpp
8d94d82a6dcf987edec0cf642a4d21b8a367550c 11-Mar-2011 Mathias Agopian <mathias@google.com> fix [4025681] continuous sensors should not try to send an event as soon as they're activated

Make sure to send an event down only for sensors that report a value only on data
change. Other sensors, will naturally send an event when the next event is available.

Bug: 4025681
Change-Id: I6d444deda388b6bc9a33e3371e09d390f1566ec5
/frameworks/base/services/sensorservice/SensorService.cpp
f0aec213ec02fb833f3c927206dad9693e0672de 03-Feb-2011 Mathias Agopian <mathias@google.com> fix [3421350] Killing a game that uses the accelerometer renders the device unable to sleep

when an app dies, make sure to disable all sensors that process
is connected to, regardless of wether this was the LAST connection
to this sensor.

Change-Id: I9c72b1792eee03815304674d5c2f25b5270e4748
/frameworks/base/services/sensorservice/SensorService.cpp
671a6ff4be11b3e2d8eb017e0c7a78e6133fb2b8 12-Nov-2010 Mathias Agopian <mathias@google.com> Add support for virtual sensors.

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
/frameworks/base/services/sensorservice/SensorService.cpp
f33a6e9645517b9bcf7236bc6f2b7fe182a0137d 15-Nov-2010 Mathias Agopian <mathias@google.com> Fix a race condition in sensormanager

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
/frameworks/base/services/sensorservice/SensorService.cpp
3a9223ebf881b10996dac34b00e51e08a602d44b 11-Nov-2010 Mathias Agopian <mathias@google.com> record the last event received regardless of having clients or not

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
/frameworks/base/services/sensorservice/SensorService.cpp
94c4f5c1b28344001bae5ac4ad22dd01dc2fd679 06-Nov-2010 Mathias Agopian <mathias@google.com> improve sensorservice dumpsys and increase the max sensor rate to 1 ms (1000Hz)

the increased maximum rate is needed for proper gyro integration, current gyro
parts can sample at up to 800Hz

Change-Id: Ide75f6d5bc7a0fdafeb2dafd72db39e7afb9e794
/frameworks/base/services/sensorservice/SensorService.cpp
4fe6c3e51be77e35f40872cdbca6c80f8f8b7ecb 14-Sep-2010 Jeff Brown <jeffbrown@google.com> Replace epoll() with poll() and rename PollLoop to Looper.

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
/frameworks/base/services/sensorservice/SensorService.cpp
32123fde1b82fc7f5d04f35e2b972364d4352ec9 23-Jul-2010 Mathias Agopian <mathias@google.com> Report sensor events to BatteryStats service

Change-Id: I9b83aa709887aa658bc474391573f2d45b6c4eb2
/frameworks/base/services/sensorservice/SensorService.cpp
aea786f42cee6a899e8f78fdbf82cb1cac544430 23-Jul-2010 Mathias Agopian <mathias@google.com> SensorService handles last known state properly

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
/frameworks/base/services/sensorservice/SensorService.cpp
efba8bf53aa6d0efb8cf778aaa63a482b813d2b1 23-Jul-2010 Mathias Agopian <mathias@google.com> filter sensor event by connection

we now don't send events down to a connection that has not
registered for this event.

Change-Id: I3fe507974d3e99293749bfec2ef871e8a0ee9600
/frameworks/base/services/sensorservice/SensorService.cpp
d8653518449e3dbf03fe6f8b11dbdff5ef6ce60e 22-Jul-2010 Mathias Agopian <mathias@google.com> propagate sensor event rate properly to the sensor HAL

Change-Id: I1abe4c0fcce423caab79208353fded4d57398227
/frameworks/base/services/sensorservice/SensorService.cpp
23e8de26b7b3d04daf08526f314c2fdd2f8fee65 22-Jul-2010 Mathias Agopian <mathias@google.com> propagate sensor event rate properly

Change-Id: I32e67d30e4295285a6827956cc8161b2025d70bc
/frameworks/base/services/sensorservice/SensorService.cpp
5df13ef30e7dd58e4e718e6d949ac3d1f5af94e0 20-Jul-2010 Mathias Agopian <mathias@google.com> SensorService doesn't crash if correct HAL is not present

Change-Id: I83700b1a1b43390f5830e1056572bfb16e58e8e4
/frameworks/base/services/sensorservice/SensorService.cpp
42e1b39ac53709d9a9a74cd803e8ded10cf03848 20-Jul-2010 Mathias Agopian <mathias@google.com> Better dumpsys logs

Change-Id: Iae65a8547ee5815cc4c3b74d2c9ef17bed7f565d
/frameworks/base/services/sensorservice/SensorService.cpp
6f8b4d28d41508e3a563c12f5841918bb3869819 20-Jul-2010 Mathias Agopian <mathias@google.com> Added partial support for repporting sensor activity to IBatteryStats

Change-Id: I2af319d89e49b0f2349ec9d8b0fccac80e9bc047
/frameworks/base/services/sensorservice/SensorService.cpp
1bf797857e025e8a71db86fb9e79765a767ec1eb 15-Jul-2010 Mathias Agopian <mathias@google.com> new SensorService

remove old sensor service and implement SensorManager
on top of the new (native) SensorManger API.

Change-Id: Iddb77d498755da3e11646473a44d651f12f40281
/frameworks/base/services/sensorservice/SensorService.cpp