summaryrefslogtreecommitdiffstats
path: root/services/sensorservice/SensorService.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | am 4369a4eb: Revert "Add stringType and requiredPermission to sensors, ↵Etienne Le Grand2014-04-051-77/+18
| |\ \ \ \ | | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | effectively adding permission checking for sensors" * commit '4369a4ebd5ae7567e7075bc82830b83178099ed5': Revert "Add stringType and requiredPermission to sensors, effectively adding permission checking for sensors"
| | * | | Revert "Add stringType and requiredPermission to sensors, effectively adding ↵Etienne Le Grand2014-04-051-77/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | permission checking for sensors" This reverts commit c57a019e117117c5a76c772970b26cd0f5db8c6a. Change-Id: I3540565bc3e56a32cf3b176a29216cf68bb763b2
* | | | | Revert "Add stringType and requiredPermission to sensors, effectively adding ↵Etienne Le Grand2014-04-051-77/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | permission checking for sensors" This reverts commit c57a019e117117c5a76c772970b26cd0f5db8c6a. Change-Id: I3540565bc3e56a32cf3b176a29216cf68bb763b2 (cherry picked from commit 4369a4ebd5ae7567e7075bc82830b83178099ed5)
* | | | | am 00f4dde1: am c57a019e: Add stringType and requiredPermission to sensors, ↵Etienne Le Grand2014-04-051-18/+77
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | effectively adding permission checking for sensors * commit '00f4dde1aa88576811bca79bc8242e1fc1edb333': Add stringType and requiredPermission to sensors, effectively adding permission checking for sensors
| * | | | am c57a019e: Add stringType and requiredPermission to sensors, effectively ↵Etienne Le Grand2014-04-051-18/+77
| |\ \ \ \ | | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | adding permission checking for sensors * commit 'c57a019e117117c5a76c772970b26cd0f5db8c6a': Add stringType and requiredPermission to sensors, effectively adding permission checking for sensors
| | * | | Add stringType and requiredPermission to sensors, effectively adding ↵Etienne Le Grand2014-04-041-18/+77
| | |/ / | | | | | | | | | | | | | | | | | | | | permission checking for sensors Change-Id: If0f3dbdb5d2e9378e1fed4614baee4e750d0c850
* | | | am d4dabf87: am cdbf28b3: Merge "native frameworks: 64-bit compile issues"Mark Salyzyn2014-03-131-8/+9
|\ \ \ \ | |/ / / | | | | | | | | | | | | * commit 'd4dabf872ac0a12e12aebae9032f7d62762c2aeb': native frameworks: 64-bit compile issues
| * | | am cdbf28b3: Merge "native frameworks: 64-bit compile issues"Mark Salyzyn2014-03-131-8/+9
| |\ \ \ | | |/ / | |/| / | | |/ | | | * commit 'cdbf28b3f7f5327f4cb0eb95b8326bf4c24c87ba': native frameworks: 64-bit compile issues
| | * native frameworks: 64-bit compile issuesMark Salyzyn2014-03-121-8/+9
| | | | | | | | | | | | | | | | | | | | | - Fix format (print/scanf) - Suppress unused argument warning messages (bonus) Change-Id: I05c7724d2aba6da1e82a86000e11f3a8fef4e728
* | | am e7643e43: am 8ae7c02e: am ffac23b2: am 4b84704b: Ignore flush complete ↵Aravind Akella2014-03-061-11/+12
|\ \ \ | |/ / | | | | | | | | | | | | | | | events when recording last value for a sensor. * commit 'e7643e431abc2d1b42ab1d68913ec22d0b180554': Ignore flush complete events when recording last value for a sensor.
| * | Ignore flush complete events when recording last value for a sensor.Aravind Akella2014-03-061-11/+12
| |/ | | | | | | | | Bug: 11822806 Change-Id: I1402d6684ed71ed413aef6a7be3aad945b331ec2
* | Add uid to sensorservice's dump of active connectionsPatrick Tjin2014-02-051-2/+3
|/ | | | Change-Id: I1c365157bcd28a93635dbde4a8d91c79750e03ae
* Bug fixes for SensorServiceAravind Akella2013-10-251-1/+11
| | | | | | | | | 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-141-32/+18
| | | | | | 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-091-4/+18
| | | | | | in the given SensorEventConnection. Change-Id: I4ef2bec80406c517903ab9782dc9eaf3fa8b7f36
* Sensor Batching Bug fixes.Aravind Akella2013-09-161-11/+150
| | | | | | | | | 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-031-17/+55
| | | | | Bug: 10109508 Change-Id: I7333f3aac76125a8226a4c99c901fb904588df04
* resolved conflicts for merge of 00aea5c5 to masterMathias Agopian2013-07-121-15/+18
|\ | | | | | | Change-Id: Ie1769be863ee2d411eae451907a928db57882e14
| * fix a dead-lock in sensorserviceMathias Agopian2013-07-121-15/+18
| | | | | | | | | | | | | | | | | | | | | | | | 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-081-23/+53
| | | | | | | | | | | | | | 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-081-15/+4
| | | | | | | | | | | | getSensorType() ran in O(n) instead of O(1). fix that. Change-Id: Idcf29e46fc34db32604a0d8e5a9156486783b74f
* | various fixes to the sensorserviceMathias Agopian2013-05-161-41/+35
|/ | | | | | | | 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
* Fix activation issue with auto disabled sensors.Jaikumar Ganesh2013-04-171-0/+11
| | | | | | | | | | 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-121-38/+107
| | | | | | | | | | 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
* improve sensor battery usage trackingMathias Agopian2012-09-181-1/+6
| | | | | | | | | | | | | | | | | | | | 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-181-3/+4
| | | | 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-281-7/+27
| | | | | | | | if debug.sensors is true, extra debugging sensors are enabled and HAL provided sensor fusion is disabled Change-Id: I9b093424edb8c5363d1337237cdf6abe4ab266f9
* 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-271-4/+4
| | | | | | | 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-271-2/+2
| | | | | | | See https://android-git.corp.google.com/g/157065 Bug: 5449033 Change-Id: I00a4b904f9449e6f93b7fd35eac28640d7929e69
* Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGESteve Block2012-06-271-7/+7
| | | | | | | 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-271-1/+2
| | | | | | | | | | | | 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-271-2/+2
|
* silence sensorservice when it's dropping eventsMathias Agopian2012-06-271-3/+3
| | | | Change-Id: Ib05862e545aa780821aa605e45ab189f530494b7
* sensorservice: be more robust when there are no sensor h/wMathias Agopian2012-06-271-60/+63
| | | | | Bug: 5030108 Change-Id: I45b85b3c492b9268cb0ae44d2e5fc8c708b6e66e
* PermissionCache caches permission checksMathias Agopian2012-06-271-3/+5
| | | | | | | | | | | | | 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
* improve orientation sensor with gyro dataMathias Agopian2012-06-271-4/+19
| | | | | | | | | 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
* use quaternions instead of MRPsMathias Agopian2012-06-271-11/+32
| | | | | | | | also use correct time propagation equation disable the fused sensors when gyro is not present since they were unusable in practice. Change-Id: Iad797425784e67dc6c5690e97c71c583418cc5b5
* 9-axis sensor fusion with Kalman filterMathias Agopian2012-06-271-11/+35
| | | | | | | Add support for 9-axis gravity and linear-acceleration sensors virtual orientation sensor using 9-axis fusion Change-Id: I6717539373fce781c10e97b6fa59f68a831a592f
* Fix a few issues with sensors reference-countingMathias Agopian2012-06-271-0/+10
|
* Fix a crasher in SensorServiceMathias Agopian2012-06-271-2/+1
| | | | | | | | 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
* fix [4025681] continuous sensors should not try to send an event as soon as ↵Mathias Agopian2012-06-271-5/+8
| | | | | | | | | | 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
* fix [3421350] Killing a game that uses the accelerometer renders the device ↵Mathias Agopian2012-06-271-5/+8
| | | | | | | | | | 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