summaryrefslogtreecommitdiffstats
path: root/services/sensorservice
Commit message (Collapse)AuthorAgeFilesLines
* sensorservice: 64-bit compile issuesMark Salyzyn2014-06-102-17/+20
| | | | Change-Id: Ied7b779f39e71d041791729f7355b052b63903c5
* am cdbf28b3: Merge "native frameworks: 64-bit compile issues"Mark Salyzyn2014-03-1310-22/+23
|\ | | | | | | | | * commit 'cdbf28b3f7f5327f4cb0eb95b8326bf4c24c87ba': native frameworks: 64-bit compile issues
| * native frameworks: 64-bit compile issuesMark Salyzyn2014-03-1210-22/+23
| | | | | | | | | | | | | | - Fix format (print/scanf) - Suppress unused argument warning messages (bonus) Change-Id: I05c7724d2aba6da1e82a86000e11f3a8fef4e728
* | Bug fix for SensorFusion data rate.Aravind Akella2014-03-062-13/+4
| | | | | | | | | | | | | | | | SensorFusion is always returning data at the slowest possible sampling rate (5 Hz). batch() is getting called twice, first time with the requested rate and second time with the slowest rate (which overwrites the requested rate). Fix batch call in SensorFusion::activate() Bug: 12064319 Change-Id: If62f3e514233f69810336fd22b136b4395b667d3 (cherry picked from commit 88509090387eeb400771a786171866710cca230c)
* | Ignore flush complete events when recording last value for a sensor.Aravind Akella2014-03-062-12/+13
|/ | | | | Bug: 11822806 Change-Id: I1402d6684ed71ed413aef6a7be3aad945b331ec2
* Bug fixes for SensorServiceAravind Akella2013-10-252-1/+12
| | | | | | | | | i) Emulate Flush for AOSP Fusion Sesnsors on newer HALs that support batching. ii) Early return if there are no events for the current SensorEventConnection. Bug: 11325707, 11376538 Change-Id: Idb856302463649a99d3d5d0c965bb06ba06b8e1d
* SensorService Flush API bug fix.Aravind Akella2013-10-142-34/+19
| | | | | | SensorService is dead locking itself when flush is called on older devices which don't support batching. mConnectionLock is acquired twice. Change-Id: I5c25585bfb2b396df4b05826a9cba1da7997a3ee
* Change API from flush(handle) to flush(). Call flush on all active sensors ↵Aravind Akella2013-10-092-5/+19
| | | | | | in the given SensorEventConnection. Change-Id: I4ef2bec80406c517903ab9782dc9eaf3fa8b7f36
* Merge "Fix for AOSP fusion sensors not handling multiple clients correctly." ↵Aravind Akella2013-09-176-15/+15
|\ | | | | | | into klp-dev
| * Fix for AOSP fusion sensors not handling multiple clients correctly.Aravind Akella2013-09-166-15/+15
| | | | | | | | | | Bug: 10786801 Change-Id: I7b938bc583a303a30237c3d93b5accbf64cc90b5
* | Sensor Batching Bug fixes.Aravind Akella2013-09-162-14/+173
|/ | | | | | | | | i) SensorService dropping events. Increase SOCKET_BUFFER_SIZE in BitTube ctor. ii) Call flush before every activate. iii) Emulate flush for older devices. Add a trivial flush complete event when flush is called. Bug: 10641596 Change-Id: I30d0f3948e830457143f16e157b6ad81908687ce
* fix a few problems with BitTubeMathias Agopian2013-09-101-2/+6
| | | | | | | | | | | | | | | | BitTube used to send objects one at a time and didn't handle errors properly. We now send all the objects in one call, which means they have to be read as a single batch as well. This changes the BitTube API. Update SensorService to the new API. Also added an API to set the size of the send buffer. Bug: 10641596 Change-Id: I77c70d35e351fdba0416fae4b7ca3b1d56272251
* Sensor batching. Changes to the native code.Aravind Akella2013-09-038-96/+346
| | | | | Bug: 10109508 Change-Id: I7333f3aac76125a8226a4c99c901fb904588df04
* move services executables sources in their respective src folderMathias Agopian2013-07-222-0/+43
| | | | Change-Id: Ic65434a26c7fed1699abf0851fec6faa40e09c0c
* Fix issue #9860494: Waiting for service batteryinfo...Dianne Hackborn2013-07-151-1/+1
| | | | | | I changed the name of the service, this needs to follow. Change-Id: Id8e346cee9d75cfe142cd43f6aea43302878b6dc
* resolved conflicts for merge of 00aea5c5 to masterMathias Agopian2013-07-126-31/+38
|\ | | | | | | Change-Id: Ie1769be863ee2d411eae451907a928db57882e14
| * fix a dead-lock in sensorserviceMathias Agopian2013-07-126-31/+38
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | improve sensorservice's dumpsysMathias Agopian2013-07-085-37/+62
| | | | | | | | | | | | | | it now displays the reported trigger mode properly, as well as the number and type of the last received data Change-Id: I2ff64b32ab71f1332bc2e09671c8c02bb9550490
* | simplify some unnecessary complex codeMathias Agopian2013-07-082-16/+4
| | | | | | | | | | | | getSensorType() ran in O(n) instead of O(1). fix that. Change-Id: Idcf29e46fc34db32604a0d8e5a9156486783b74f
* | revert parts of dc5b63e40, which made gyro drift estimation unstableMathias Agopian2013-05-301-16/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | initialize the system covariance matrix with non-zero values for the gyro-bias part. this improves the initial bias estimation speed significantly. the initial covariance matrix should be small because the drift changes slowly. the real problem is that we're not starting with a good estimate of the drift, which this algorithm relies on. so with this revert, it'll take a while for the drift to be estimated but it won't be unstable. Change-Id: Id5584bc114a2390d507643b2451b2650c1b90721
* | use gyro timestamp directly in fusionMathias Agopian2013-05-302-7/+8
| | | | | | | | | | | | | | | | we used to estimate the gyro rate and deduce the period from that but it turns out this is causing problems. Bug: 5192288 Change-Id: I8ca826d0e11e488587bcaa1720de99e92b82f191
* | various fixes to the sensorserviceMathias Agopian2013-05-168-54/+61
| | | | | | | | | | | | | | | | 1) "google" sensors are now reporting AOSP as the vendor string 2) don't expose the system's sensor fusion if the HAL provides it 3) use uncalibrated gyro if availble for the system's sensor fusion Change-Id: I25140436cdb29d55e39fd6fbbf8c44a410a83d5c
* | make all libsurfaceflinger and libsensorservice symbols's visibility hiddenMathias Agopian2013-05-092-12/+10
|/ | | | | | | we only export the main entry-point. this saves about 150KB. Change-Id: I55eb2b6705386fdfa43860deb62f9cdd2a0982aa
* Fix activation issue with auto disabled sensors.Jaikumar Ganesh2013-04-175-0/+31
| | | | | | | | | | 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
* Sensor changes.Jaikumar Ganesh2013-04-125-38/+121
| | | | | | | | | | 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
* Add liblogYing Wang2013-04-091-0/+1
| | | | | Bug: 8580410 Change-Id: I2ca4fa00dde0b574df3619134836bcb9315bd506
* improve sensor battery usage trackingMathias Agopian2012-09-185-73/+207
| | | | | | | | | | | | | | | | | | | | until now we were tracking when a sensors was physically enabled or disabled and we were reporting that to the BattaryService. this wasn incorrect because we could have several different apps enabling the same sensor, so the accounting by the battery service would be incorrect in that case (depending on the order in which these apps disabled said sensor). BatteryService tracks sensors per uid, however SensorService does this per binder connection, so we could have several binder connections for the same uid, to solve this we keep a list of sensor/uid -> count, which is the bulk of this change. Bug: 6661604 Change-Id: I561c198c42ba1736a8671bdacda4c76d72b9dd6f
* track UID with connectionsMathias Agopian2012-09-182-4/+8
| | | | Change-Id: Id4865f3cd27a95acdbbfdff1f2bb4123f312a13b
* fix a typo in SensorServiceMathias Agopian2012-09-181-1/+4
| | | | | | | | It shouldn't have caused much harm though. Also log a warning when enabling a sensor for a connection that is already enabled. Change-Id: Ia4a052381e79183cd4cb1bedc7ba08e5228d7a38
* add a way to enable debugging sensors at runtimeMathias Agopian2012-06-282-7/+28
| | | | | | | | if debug.sensors is true, extra debugging sensors are enabled and HAL provided sensor fusion is disabled Change-Id: I9b093424edb8c5363d1337237cdf6abe4ab266f9
* improve sensor fusionMathias Agopian2012-06-281-2/+23
| | | | | | | we now use a better quaternion propagation equation this is especially beneficial for lower gyroscope rates Change-Id: Ifbf273c8a092a8849ca4fe4b9bca30787e924018
* add some commentsMathias Agopian2012-06-281-2/+14
| | | | Change-Id: Ia2e2c9531715fc2bd5b51c4dc58389e01abfe7e6
* small improvement to sensor fusionMathias Agopian2012-06-271-7/+33
| | | | | | | | | | | | | | 1) there was a typo when computing the system covariance a term in dT^3 was ommitted; the impact was was very limited because of how small this term is. 2) initialize the system covariance matrix with non-zero values for the gyro-bias part. this improves the initial bias estimation speed significantly. 3) added comments here and there Change-Id: I4328c9cca73e089889d5e74b9fda99d7831762dc
* fix a potential buffer overflow in sensorserviceMathias Agopian2012-06-271-1/+1
| | | | | Bug: 6580560 Change-Id: Icf6cafbca09174515a964a7cd69d8cc589ad52de
* Fix a stack corruption in sensorserviceMathias Agopian2012-06-271-5/+13
| | | | | Bug: 6576732 Change-Id: If0f2fb0d0c35b932fb77cd262e676042145b28f9
* fix a typo causing sensor event to be sorted in reverse chronological orderMathias Agopian2012-06-271-1/+1
| | | | Change-Id: I041c64616d88ed1abb5efc90ed9eb0d9baeb4832
* usea socketpair instead of a pipe in BitTubeMathias Agopian2012-06-271-7/+4
| | | | | Bug: 6252830 Change-Id: I363cc7e9f73a5b7d8bbccee312c6d8938c84e99a
* Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGESteve Block2012-06-272-8/+8
| | | | | | | See https://android-git.corp.google.com/g/#/c/157220 Bug: 5449033 Change-Id: Ic9c19d30693bd56755f55906127cd6bd7126096c
* Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGESteve Block2012-06-272-3/+3
| | | | | | | See https://android-git.corp.google.com/g/157065 Bug: 5449033 Change-Id: I00a4b904f9449e6f93b7fd35eac28640d7929e69
* Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF) DO NOT MERGESteve Block2012-06-271-1/+1
| | | | | | | See https://android-git.corp.google.com/g/156801 Bug: 5449033 Change-Id: Ib08fe86d23db91ee153e9f91a99a35c42b9208ea
* Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGESteve Block2012-06-273-12/+12
| | | | | | | See https://android-git.corp.google.com/g/156016 Bug: 5449033 Change-Id: I4c4e33bb9df3e39e11cd985e193e6fbab4635298
* handle EINTR when calling sensor HAL's poll functionMathias Agopian2012-06-272-2/+7
| | | | | | | | | | | | 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
* SensorService now always clamps the requested rateMathias Agopian2012-06-271-2/+3
| | | | | | | | | | | | 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
* fix an issue where SensorService could request an invalid sensor delayMathias Agopian2012-06-271-2/+8
| | | | | | | | | 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
* Rename SensorChannel to BitTubeMathias Agopian2012-06-272-5/+5
|
* improve sensorservice dumpsysMathias Agopian2012-06-273-29/+51
| | | | Change-Id: I8b53d5cab884c3aca16d95df5fbf288368d52e8b
* improve sensorservice_test outputMathias Agopian2012-06-271-13/+12
| | | | Change-Id: I6248b6f1f001fedec1bddcddfcd2b381d9bb4bf4
* Fix a few style issues and remove LOG spamMathias Agopian2012-06-271-22/+28
| | | | Change-Id: I6b6f75373f4ac28f98dea6a6f1c2567a6aa02243
* More error checks to avoid div by zero.Michael Johnson2012-06-272-4/+64
| | | | Change-Id: I18e5b72d02bf5420c14334d3a03f18fa40572d31
* Fix occasional fusion divergence by detecting it and resetting the fusion.Max Braun2012-06-273-13/+41
| | | | Change-Id: I51186e12fb9b2316e3671e3908174f4495df89a0