summaryrefslogtreecommitdiffstats
path: root/core/java/android/hardware/SystemSensorManager.java
Commit message (Collapse)AuthorAgeFilesLines
* Fix for ClassCastException in SystemSensorManager.Aravind Akella2013-10-231-7/+27
| | | | | Bug: 11068858 Change-Id: I074798a6978b91766b37dec32f2683d8e4adf5d3
* Fix registerListener and flush bugs.Aravind Akella2013-10-091-55/+30
| | | | | | | | | | 1) Fix registerListener to return false when called with a Trigger sensor. Correct java documentation. 2) Remove reservedFlags and FlushCompleteListener parameters from the public API. 3) Create SensorEventListener2 which extends SensorEventListener and has the onFlushCompleted callback. 3) Change flush(Sensor) API to flush(SensorEventListener). Change-Id: I56ce4e0b6e329483e129a14ad7e8a0cd35665ffe Bug: 10894703
* Sensor batching. Implementation for registerListener(with batch support) and ↵Aravind Akella2013-09-031-21/+95
| | | | | | | flush APIs. Bug: 10109508 Change-Id: I6dfdd986bd8c3368cb568fa7d90abf9c03de9aef
* Fix race condition and disable call.Jaikumar Ganesh2013-04-121-14/+28
| | | | | | | | | | | | | 1. A dispatch event can happen as soon you call enabled, and we won't be ready to receive it. Also add error checks and not crash if such a thing happens. 2. Java layer shouldn't call disable on the native layer for trigger sensors. Native layer will clean up on its own. b/8165631 Change-Id: Icbe76bd1f50632c0bcb0b3b04975b2c2f20ff36b
* Sensor values changes.Jaikumar Ganesh2013-04-111-68/+79
| | | | | | | | | | | | 1. Remove Sensor Event Pool. 2. Allocate fixed array values for each Sensor added. - Needed for backward compatibility. 3. Use SDK checks for backward compatibility for rotation vector. b/8165631 Change-Id: I2d2cf10d3460478ed7af8e6188343f4bb033503c
* Add new sensor types.Jaikumar Ganesh2013-04-111-150/+159
| | | | | | | | 1. Add uncalibrated gyros and magnetic field sensor. 2. Change max number of events from 3 to 16. 3. Add new APIs for trigger sensors. Change-Id: Ifac5c0024c8e5f88b721e5cd97ff26afaaa36717
* Revert "Add new sensor types."Jaikumar Ganesh2013-03-131-159/+150
| | | | This reverts commit bc03a348d78326dee779a8ecc325799c9fceac98.
* Revert "Add a minimum size for the event pools."Jaikumar Ganesh2013-03-131-2/+2
| | | | This reverts commit c0ce7eeb481540e24bc45f52e604df923c507043.
* Add a minimum size for the event pools.Justin Koh2013-03-121-2/+2
| | | | | | | Add a minimum size for the event pools for devices which don't have sensors. Otherwise the system server crash loops on boot. Change-Id: Ic51c6fc26c8779d9f435f358d4274148a2ddbfb3
* Add new sensor types.Jaikumar Ganesh2013-03-121-150/+159
| | | | | | | | 1. Add uncalibrated gyros and magnetic field sensor. 2. Change max number of events from 3 to 16. 3. Add new APIs for trigger sensors. Change-Id: I1957d723de2b65c31dadaee7386fd8d51ea2f7e5
* rework SystemSensorManager.javaMathias Agopian2013-02-041-301/+287
| | | | | | | | | | - it doesn't need a dedicated thread to pull events out - events are now sent directly to the proper looper by the sensorservice this simplifies things a lot. Change-Id: Ifa32fed3eff9007a2ee03aaaa837412cb4c15e52
* Sensors could be disabled by any applicationMagnus Hallqvist2012-09-111-1/+2
| | | | | | | | | | In the SensorManager API unregisterListener any application could unregister any sensor. This lets any application disable a sensor which another application is using. This fix restricts the applications to only be able to unregister a sensor it has previously registered to. Change-Id: Ief926dd29f480dd97626160810dff87a8d3ac8dc
* Move legacy sensor support to a new class.Jeff Brown2012-04-161-10/+5
| | | | | Bug: 6339552 Change-Id: I2067b754348ac76b1e1f71608031be2c80fc31d2
* Refactor SensorManager to move non-API bits into a subclass.Jeff Brown2012-04-161-0/+403
Changed the SensorManager class so that it only contains API-related bits including what's needed to support legacy sensors. Mostly just moved stuff around. Making the class abstract is safe because it does not have a visible constructor in the API. One minor change is that the cache of sensor type to sensor lists is now per instance of SensorManager instead of being static. We can fix this if desired. Another small change is that we bail out early from registerListener if the listener has already been registered for the particular sensor. This happened for both legacy and standard listeners. The problem is that the ListenerDelegate maintains two lists of sensors, one is a Map and the other is a List. Adding a sensor twice causes one entry to be added to the Map and two entries to be added to the List, but when the sensor is removed the next time, only one entry is removed from the List, leaving it in an inconsistent state. Removed Sensor.getLegacyType() since the value it provides is only needed in LegacyListener and we don't really save any significant computation by caching it. Removing the field makes support for legacy sensors a little more self-contained. Bug: 6339552 Change-Id: I50d41ac97cf535924f2bfa2026d28547a4d00286