History log of /frameworks/native/services/sensorservice/SensorDevice.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
1a00e2d5fb819c95ade644146020c83551208af1 28-Sep-2017 Peng Xu <pengxu@google.com> Clean up connection to sensor hidl service

getService() would block until hidl service up and running. Replace
retry delay with service registration listener to speed up.

Moreover, when getService() return nullptr, it means sensor hidl
service does not exist. Remove retry in this case and return failure.

Bug: 66916774
Test: test device boot
Test: adb shell "stop; start"
Test: kill sensor hidl process
Test: mod manifest file to remove sensor entry
Change-Id: I685971425e97e314699de4630d9adf400aba4af2
/frameworks/native/services/sensorservice/SensorDevice.h
2bec6230661e66ce37d8a074df32e07553e3cb8c 02-Jul-2016 Peng Xu <pengxu@google.com> Calculate batching param in a smarter way

Calculate batching parameter in a better way by lower-bound the
latency specification by sample period.

Bug: 28353456
Test: run sensor cts tests
Change-Id: I13a6a33d3d0dedb246ac602e634656f516dccfc3
/frameworks/native/services/sensorservice/SensorDevice.h
a8fad9bd6ca694bb0f86d617c72122d2220ec253 17-Mar-2017 Peng Xu <pengxu@google.com> Checks hidl service and remove hidl call at dump

Two things:
* check for hidl service availability before calling any hidl
functions.
* remove hidl dependency on dump to ensure dump will not cause
crash due to hidl failure.

Bug: 36073404
Test: check sensor running after reboot
Test: check dumpsys sensorservice works normally.
Change-Id: I8626635a143a9f07f263f85d95ab16749ea1e452
/frameworks/native/services/sensorservice/SensorDevice.h
96b12d8dedd6bffdc520920d731c5dff82e122df 16-Mar-2017 Ashutosh Joshi <ashutoshj@google.com> Add a retry mechanism to potentially allow recovery from HIDL failures.

Retry a few times to see if HIDL failures persist.
Add some logging to track failures.

Bug: 36088202
Test: Ensure sensors stream normally after change.
Change-Id: I194eaffd455ba782fff041f03ef89da384e3a901
/frameworks/native/services/sensorservice/SensorDevice.h
56a8f942731ad34a8e85a9a0fb84f1be2ead5541 07-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "split libsensor our of libgui "
801ea093b0e923a61b832f2adba698a273479880 07-Mar-2017 Mathias Agopian <mathias@google.com> split libsensor our of libgui

Test: compile & run
Bug: treble cleanup
Change-Id: I5b2c2a14f7d3b364d25695cf0901c5b08cfb0fc9
/frameworks/native/services/sensorservice/SensorDevice.h
3889e6ea1c321cbaf8a959775da58509672143af 03-Mar-2017 Peng Xu <pengxu@google.com> Double check hidl service at init + meaningful abort when hidl crash

Sensor hidl service will kill itself when it detects
double-connection(*) from framework sensor service in order to avoid
potential deadlock. This cl adds a no-op call to hidl service at
initialization of framework service to allow early detection on hidl
service side. It also adds retry mechanism in this case to avoid
another system server crash.

Log messages is added when hidl call transport failure to help better
identify problem. There is no sane recovery at this point and fatal
log is preferred.

* Double-connection to hidl service happens when framework sensor
service crash but leave a lingering connection in sensor hidl service.
Auto restarted framework service will attempt to connect hidl service
again which result in a double connection.

Test: manually killing sensor hidl service and/or restart runtime,
with and without sensor service in restricted mode, observe
system recover to good state.

Pid of sensor hidl service can be found by lshal
lshal | grep sensor
switch to restrict mode
dumpsys sensorservice restrict a.non-exist.package

Bug: 35727090
Bug: 35843387
Bug: 35702298
Bug: 35919167
Bug: 35848670
Bug: 35903635
Change-Id: Ie5c24300503e125d9de031a70948e2bda1eb6dc6
/frameworks/native/services/sensorservice/SensorDevice.h
d15c030f7255ec9db8567a4ee77a56844982586d 20-Dec-2016 Steven Moreland <smoreland@google.com> sensorservice: Start using HIDL sensor HAL.

Framework now use the HIDL sensor HAL only. Loading the legacy
HAL library is removed.

Bug: 32978887
Test: sensors stream data in both passthrough and binderized mode.
Change-Id: I1d700a5a23cd9d209559570439f306aa22c613c1
/frameworks/native/services/sensorservice/SensorDevice.h
5cafc1e086db67911f937b68d35f0955e0a37caf 09-Feb-2017 Ashutosh Joshi <ashutoshj@google.com> Revert "sensorservice: Remove ENABLE_TREBLE flag."

This reverts commit d333511e94afbcc6462dd9c81405f4a3e30ecac9.

Change-Id: I6812643a7d0265f3a64a03a35e4d5a2359ba87cf
/frameworks/native/services/sensorservice/SensorDevice.h
d333511e94afbcc6462dd9c81405f4a3e30ecac9 20-Dec-2016 Steven Moreland <smoreland@google.com> sensorservice: Remove ENABLE_TREBLE flag.

Only hidl hals should be built/referenced by the framework,
and ENABLE_TREBLE will be deprecated soon.

Bug: 32978887
Test: compiles/wip
Change-Id: Ibb32129e1f30ae5baa15e116d3b13cc72bf27395
/frameworks/native/services/sensorservice/SensorDevice.h
5363254ba38b50da95e5bdb15391c139c182627c 24-Jan-2017 Peng Xu <pengxu@google.com> Add function to determine if SensorDevice support direct report

Added a function to SensorDevice to indicate if direct report is
supported. This avoided a crash condition in non-HIDL implementation.

Test: test with demo app on a HAL w/ and w/o direct report support
Change-Id: If68497bb8890b9e6003c2afeec38d16daf81f237
/frameworks/native/services/sensorservice/SensorDevice.h
e36e34731cbe77a49aa5e7d687dde041d83d0370 03-Nov-2016 Peng Xu <pengxu@google.com> Direct report mode support in sensor service and client

Added SensorDirectConnection to represent the direct channel.
The life-cycle is similar to that of SensorEventConnection.
Modified SensorDevice and SensorDeviceTreble to support new
HAL API. Added support in SensorManager, SensorService, binder
classes. Also added related helper functions in Sensor and dumpsys
support in SensorList.

Test: manual test with demo app
Bug: 30985702
Change-Id: I8750294b6aab717ed7f525299be642f1f0b85558
/frameworks/native/services/sensorservice/SensorDevice.h
99fdbb5fdc6a2ab4cc1fdf99872a3b30cbbc6f0e 10-Oct-2016 Andreas Huber <andih@google.com> sensor HAL v3

Bug: 32021636
Test: no
Change-Id: If5f082db4f22c3aa4aa1eedb2948df767bb074aa
/frameworks/native/services/sensorservice/SensorDevice.h
4f707f8b3da68d3055db895da9ae5216cc4f483a 26-Sep-2016 Peng Xu <pengxu@google.com> [sensorservice] Fix inconsistent states in SensorDevice

This CL avoids inconsistent disabled client list when sensorservice
is in restricted mode and a restricted sensor event connection is
destroyed.

The inconsistency can cause registerLister error in sensor CTS.

Also removed the additional logging message since they are no longer
necessary.

Bug: 28533594

Test: Running "cts-tradefed run singleCommand cts-dev --module
CtsHardwareTestCases --test android.hardware.cts.SensorBatchingTests"
continuously while keep registering and unregistering sensor listener
in a separate app (e.g. enable BreakIt mode in SensorLogger).

Change-Id: I601aea87c88511f5543a80c4921ee4822cb89dff
/frameworks/native/services/sensorservice/SensorDevice.h
6a2d3a06caa337857cf60cfc70a9a78909ad3608 21-Dec-2015 Peng Xu <pengxu@google.com> Fix sensor uuid, retrofit recent event logger

Fix an issue that causes uuid field not being initialzed in
sensorservice.

MostRecentEventLogger in sensorservice is migrated to use RingBuffer
instead of a custom circular buffer. This is expected to improve
readability and maintainability of code.

Dumpsys print format is retouched to offer more information in easier
to read format.

Bug: 28305085

Change-Id: I190e43350b60a22a9fccb92a95d6eab06a471560
/frameworks/native/services/sensorservice/SensorDevice.h
2576cb63b3fe1592f54816625036566b9eb0793a 20-Jan-2016 Peng Xu <pengxu@google.com> Dynamic Sensor Discovery implementation

Defined the dynamic sensor meta data type and UUID of sensor.

Implementation in sensorservice and the native SensorManager to
support Dynamic sensor discovery.

Change-Id: I9df2f2ae51d46cd946a9757393f7a60b52cc4fb8
/frameworks/native/services/sensorservice/SensorDevice.h
b412f6e203b38f8047f760261a5e3dc6d0722f08 30-Apr-2015 Svetoslav <svetoslavganov@google.com> Add body sensors app op - framework native

Change-Id: I727a2bb1e28ae9158f2df9c74dd0aee977dfd47f
/frameworks/native/services/sensorservice/SensorDevice.h
a9e6cc387072e25706a6d847a97b02a6f25a918b 17-Apr-2015 Aravind Akella <aakella@google.com> Enable data injection mode in SensorService.

Change-Id: I0cd32a017235c31c54816e4a357ce3b988350ed6
/frameworks/native/services/sensorservice/SensorDevice.h
4949c50372de4c7fdb57de1dc0c1f5bb3ac463eb 12-Feb-2015 Aravind Akella <aakella@google.com> Support restricted mode in SensorService.

In restricted mode, only CTS tests can register for sensors or call flush() on them. The requests
from other applications will be ignored.

Change-Id: Ieb923df3e0cfe3390fe2d052af776da79589744b
/frameworks/native/services/sensorservice/SensorDevice.h
724d91d778e71c8186399f4955de14b54812b3ed 27-Jun-2013 Aravind Akella <aakella@google.com> Sensor batching. Changes to the native code.

Bug: 10109508
Change-Id: I7333f3aac76125a8226a4c99c901fb904588df04
/frameworks/native/services/sensorservice/SensorDevice.h
cdd7d8bc145bbbd21a1689ed87a381287aeec229 12-Jul-2013 Mathias Agopian <mathias@google.com> resolved conflicts for merge of 00aea5c5 to master

Change-Id: Ie1769be863ee2d411eae451907a928db57882e14
ac9a96da65f6eae4513654adaad8a457d1c1575c 12-Jul-2013 Mathias Agopian <mathias@google.com> fix a dead-lock in sensorservice

sensorservice would deadlock if for some reason
a sensor failed to enable.

simplifed the code a bit, and made it behave a little
closer to mr1.1 -- I couldn't convince myself that
some changes in how locks were used were correct.

Bug: 9794362
Change-Id: I6110f5dbb67e543f1c71d127de2299232badb36a
/frameworks/native/services/sensorservice/SensorDevice.h
ba02cd2f6cc3f59adf66cb2b9176bfe6c9e382d1 04-Jul-2013 Mathias Agopian <mathias@google.com> improve sensorservice's dumpsys

it now displays the reported trigger mode properly, as well as
the number and type of the last received data

Change-Id: I2ff64b32ab71f1332bc2e09671c8c02bb9550490
/frameworks/native/services/sensorservice/SensorDevice.h
4c01b1ad80e084f0cd1057f89fdd1fcedf19dd96 17-Apr-2013 Jaikumar Ganesh <jaikumar@google.com> Fix activation issue with auto disabled sensors.

Auto disabled sensors get auto disabled after trigger.
An activation after this wasn't working because the
state was not being reset.

b/8609561

Change-Id: If72c9f27345e91671d7ad0a7a066f6dc3d255b78
/frameworks/native/services/sensorservice/SensorDevice.h
4342fdf14ffb792a36c1de25ad14b745df628da2 09-Apr-2013 Jaikumar Ganesh <jaikumar@google.com> Sensor changes.

1. Some sensors can wake up the AP. Add wakelocks.
2. Handle backward compatibility for rotation vector
heading accuracy.
3. Cleanup auto disabled sensors.
4. Fix race condition between enable and dispatch.

Change-Id: I39dddf12e208d83cd288201986ee994312555820
/frameworks/native/services/sensorservice/SensorDevice.h
667102f6b072582fe497599e0b760f9fc94ceffa 15-Sep-2011 Mathias Agopian <mathias@google.com> improve sensorservice dumpsys

Change-Id: I8b53d5cab884c3aca16d95df5fbf288368d52e8b
/frameworks/native/services/sensorservice/SensorDevice.h
50b66767f6c5635430483393e17d15969dfe2f05 30-Nov-2010 Mathias Agopian <mathias@google.com> fix [3237242] sensormanager sensor active count gets out of sync

whether a physical sensor needed to be active or not was managed by
a simpe reference counter; unfortunatelly nothing prevented it to
get out of sync if a sensor was disabled more than once.

sensorservice already maintainted a list of all the "clients"
connected to a physical sensor; we now use that list to determine if
a sensor should be enabled. This can never be "out-of-sync" since
this is the only data structure linking a sensor to a user of that
sensor.

also removed the isEnabled() method, which was never used and
implemented wrongly (since it didn't take into account that a sensor
could be disabled for a client but not of another).

Change-Id: I789affb877728ca957e99f7ba749def37c4db1c7
/frameworks/native/services/sensorservice/SensorDevice.h
f001c92436b4a66eb7687286325ced7f10c9f917 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/native/services/sensorservice/SensorDevice.h