History log of /frameworks/native/services/sensorservice/SensorService.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
b4373ac9f53e3a6edee915715101d535e1a851a1 30-Oct-2014 Aravind Akella <aakella@google.com> Add a timeout for releasing SensorService wake_lock.

If SensorService is holding a wake_lock and there are no acknowledgements
from ANY app within 5 seconds, release the wake_lock and reset the wake_lock
refcounts for all connections.

Bug: 16874240
Change-Id: I5e950dd393c20173c439cbd5a4ba614ee09d61f4
/frameworks/native/services/sensorservice/SensorService.cpp
0b6acb2231baed861488f2d181621272d0658d25 19-Oct-2014 Aravind Akella <aakella@google.com> Add version number to SensorService dump output.

Change-Id: I64f9482ade523ec3fafe14bff14db7196e32413f
/frameworks/native/services/sensorservice/SensorService.cpp
7830ef3dd0ff3749d974c2dd85a8fa59dc47aeca 07-Oct-2014 Aravind Akella <aakella@google.com> Change ordering of memory allocation and calling Thread::run().

In some cases this is causing a crash as device.poll is called with
NULL.

Bug: 17896339
Change-Id: Id431599f2c661338c355c7081b6602f8449a9198
/frameworks/native/services/sensorservice/SensorService.cpp
8a96955c8e14db40b16164236830fc9506a00872 29-Sep-2014 Aravind Akella <aakella@google.com> Fix sockfd leakage in SensorService.

i) Call removeFd() only if the fd in the BitTube has been
previously added to the Looper. Use a flag to determine whether the fd
has been previously added or not.
ii) Increment mPendingFlushEventsToSend after holding a connectionLock.
iii) Store the number of acks that are pending in SensorEventQueue
and send them all at once.

Bug: 17472228
Change-Id: I1ec834fea1112a9cfbd9cddd2198438793698502
/frameworks/native/services/sensorservice/SensorService.cpp
deb71b2812702318900c36b7bcfa9759525ea7cc 29-Sep-2014 Aravind Akella <aakella@google.com> Merge "Fix a possible SensorService deadlock." into lmp-dev
e148bc29c27ae7a346fa686fdda6425ba202d97a 25-Sep-2014 Aravind Akella <aakella@google.com> Fix a possible SensorService deadlock.

If the destructor of SensorEventConnection gets called when the main
sendEvents loop of SensorService is executing it may result in a deadlock.
The loop promotes each connection to a strong_pointer, calls sendEvents
and cleans up the connection if necessary. It is possible that the sp's
destructor may delete SensorEventConnection which will call the dtor
~SensorEventConnection(). This dtor again needs SensorService mLock to
execute which may result in a deadlock.

Bug: 17617897
Change-Id: I76c244dbe85fadb591c0bd1a9a5eb01d93f56505
/frameworks/native/services/sensorservice/SensorService.cpp
678f4fce90b5ed2794007cc8c63fce0c1b962404 27-Sep-2014 Aravind Akella <aakella@google.com> Revert "Fix sockfd leakage in SensorService. Remove sockfd from Looper when the connection is removed from mActiveConnections."

This reverts commit 5105960d49bfa86efeeea8f87c87aa96b5771c37.

Change-Id: I4d39ded2e50ef8a8e0aac27e438876203385a1f0
/frameworks/native/services/sensorservice/SensorService.cpp
5105960d49bfa86efeeea8f87c87aa96b5771c37 24-Sep-2014 Aravind Akella <aakella@google.com> Fix sockfd leakage in SensorService. Remove sockfd from Looper
when the connection is removed from mActiveConnections.

Bug: 17472228
Change-Id: Iaabe0968bd2104ef961ff5e8659bf91712e2e1db
/frameworks/native/services/sensorservice/SensorService.cpp
0ec2066e4774b851c66176b99b0a5aa5abe6ad00 15-Sep-2014 Aravind Akella <aakella@google.com> SensorService fixes.

i) Initialize sensor_event.flags to zero or wake_up flag before sending dropped flush_complete_events. This will avoid unnecessary acks.
Currently it is not set to anything which may result in garbage values for flags field.
ii) Change the dump format of SensorEventConnection.
iii) Add const to method signatures wherever applicable.

Bug id: https://b2.corp.google.com/issues/17498626

Change-Id: Ia736ffb01c366540aab73cdcf596ce852c052593
/frameworks/native/services/sensorservice/SensorService.cpp
8493b79e1cff92450076ca7450c4bf4e434a6816 09-Sep-2014 Aravind Akella <aakella@google.com> SensorService fixes

i) Significant Motion multiple clients fix. Make a copy of
mActiveConnections vector before cleaning up SensorEventConnections
when one-shot sensors trigger.
ii) Maintain a mapping between flush_complete_events and
SensorEventConnections to accurately map flush() API calls and
corresponding flush_complete_events
iii) Remove all references to 1_1 and 1_2 HALs.
iv) Dynamically allocate sensor_event buffers in SensorService main
threadLoop.

Bug: 17412359
Change-Id: If3c3986197660cafef2d2e0b4dc7582e229cf1c4
/frameworks/native/services/sensorservice/SensorService.cpp
9e3adfcebf28c5c76085108dffe98c74df56857d 04-Sep-2014 Aravind Akella <aakella@google.com> SensorService flush fixes.

i) Fix a possible race condition when adding a pending flush connection
to mActiveSensors data structure.
ii) Invalidate flush_complete_events as soon as they are consumed by a
connection so that they are not used by other connections which are
registered for the same sensor.

Change-Id: I1491bea8c2081c4aab1feacc60add13b7aa26bb7
/frameworks/native/services/sensorservice/SensorService.cpp
5466c3d20d03d4ae4b0fd0e0a93175091e3b0bb2 23-Aug-2014 Aravind Akella <aakella@google.com> SensorService fixes

1) Limit maxEventsToWrite depending on the size of the socket
buffer allocated (Fix for write failure on manta).
2) Do not call flush() if the sensor is not activated (OEM issue).

Change-Id: I81ea78dbdef3a3773af505ca1c9a5e39492c0b48
/frameworks/native/services/sensorservice/SensorService.cpp
e74baf6ca7d57375f38540b6b7ac5e4af019951b 21-Aug-2014 Aravind Akella <aakella@google.com> SensorService fixes.

i) Add more debug stats (acks needed, acks received)
ii) Comment out write failure message.

Change-Id: Iac892a66530849a2dd023d6f5628cd070a79537d
/frameworks/native/services/sensorservice/SensorService.cpp
6c2664ae34fd582bc174d3c83e2b18e895ca2496 13-Aug-2014 Aravind Akella <aakella@google.com> SensorService fixes.

1) Flush should only be received by the app calling flush(). Maintain
a queue of all flush() calls and send flush_complete events in that
order.
2) Log warnings for older HALs. Remove batch() calls with DRY_RUN flag.
3) Reallocate event cache when more sensors register and the desired
maxCacheSize increases. Clear NEEDS_ACK flag in the buffer whenever
there is a write() failure.
4) More dump information. Add wake-up flag, maxDelay and timestamps for
sensor events.

Bug: 16874778
Change-Id: I195646191059fd31f75f2f07886c0f98bf9b509a
/frameworks/native/services/sensorservice/SensorService.cpp
56ae42613c91f6a6fb0dc3f626daa24666fd18c2 11-Jul-2014 Aravind Akella <aakella@google.com> SensorService performance improvements.

i) Send ack for wake_up sensors on the socket connection instead of using Binder RPC.
ii) Cache events per connection in case there are write failures. Compute cache size
from FIFO counts of sensors.
iii) Send FlushCompleteEvent only for apps that explicitly called flush().

Change-Id: I018969736b7794b1b930529586f2294a03ee8667
/frameworks/native/services/sensorservice/SensorService.cpp
7869e224aaaf717b5ab86df00b60fd5be5a0996c 15-Jul-2014 Sean Wan <swan@google.com> CW on L: Fix a SIGSEGV crash in sensor service.

This is to fix b/16189080.

BUG: 16189080
Change-Id: I78d44e82f797c0808891acde609040c46745a0bb
/frameworks/native/services/sensorservice/SensorService.cpp
adb65d9add2b7350b563d4583c5efbe3f0f0aca1 13-Jun-2014 Aravind Akella <aakella@google.com> Merge "Surface reportingMode for Sensors."
0e025c5af365e45e02cb75c1d46b46c7f4cd44cb 04-Jun-2014 Aravind Akella <aakella@google.com> Surface reportingMode for Sensors.

Change-Id: Iac8dd3408c90eb7d285a2e8043131fab3a7e58fa
/frameworks/native/services/sensorservice/SensorService.cpp
c46422ed2bf2e452d878a45735f4d37917008843 12-Jun-2014 Mark Salyzyn <salyzyn@google.com> am 20914f0a: am a4e345e1: Merge "sensorservice: 64-bit compile issues"

* commit '20914f0ad3691d977f61f1d4b92b49535e8f6f33':
sensorservice: 64-bit compile issues
20914f0ad3691d977f61f1d4b92b49535e8f6f33 12-Jun-2014 Mark Salyzyn <salyzyn@google.com> am a4e345e1: Merge "sensorservice: 64-bit compile issues"

* commit 'a4e345e169fd9101011e358abdfb9308bc065bdb':
sensorservice: 64-bit compile issues
db45861ff4b636b9dd833d622dd64e2ad24b0645 10-Jun-2014 Mark Salyzyn <salyzyn@google.com> sensorservice: 64-bit compile issues

Change-Id: Ied7b779f39e71d041791729f7355b052b63903c5
/frameworks/native/services/sensorservice/SensorService.cpp
d9441e4c27bb7d0b1dfe2a8b5c1ee1714442648d 14-May-2014 Aravind Akella <aakella@google.com> Surface maxDelay and isWakeUpSensor flag in Sensor.java.

Change-Id: Idd1e9045190beeca87b086b272e8cbf0bed05bae
/frameworks/native/services/sensorservice/SensorService.cpp
9a844cf78f09953145200b4074d47589257a408c 12-Feb-2014 Aravind Akella <aakella@google.com> Enable wakeup sensors.

SensorService should hold a wakelock till the app reads events from a wakeup sensor. Currently drivers hold a wakelock with a
timeout while delivering events from a wake up sensor like Significant Motion. This hack can be removed now.

Bug: 9774884
Change-Id: If3b5acb99c9cf0cd29012fcfa9d6b04c74133d01
/frameworks/native/services/sensorservice/SensorService.cpp
93b84e39e6cbb9f2ba37125465c4040e03b56048 11-Apr-2014 Aravind Akella <aakella@google.com> am ef89f763: am cf818ebb: Merge "Add stringType and requiredPermission to sensors, effectively adding permission checking for sensors" into klp-modular-dev

* commit 'ef89f7638c43ce5f73e32d487bf65c3375995e3b':
Add stringType and requiredPermission to sensors, effectively adding permission checking for sensors
ef89f7638c43ce5f73e32d487bf65c3375995e3b 11-Apr-2014 Aravind Akella <aakella@google.com> am cf818ebb: Merge "Add stringType and requiredPermission to sensors, effectively adding permission checking for sensors" into klp-modular-dev

* commit 'cf818ebbf07c6a20ef48d71bf82f8d4bdf3a398c':
Add stringType and requiredPermission to sensors, effectively adding permission checking for sensors
700180487ffec09d9df1657b018a7caadac24b75 08-Apr-2014 Aravind Akella <aakella@google.com> Add stringType and requiredPermission to sensors, effectively adding permission checking for sensors

This reverts commit 4369a4ebd5ae7567e7075bc82830b83178099ed5.

Change-Id: Ifa8619cc6873470a07a987763d818d78d4232610
/frameworks/native/services/sensorservice/SensorService.cpp
75b332037f6197acb239bfbbf2ac09adb31e9971 05-Apr-2014 Etienne Le Grand <etn@google.com> am 4369a4eb: Revert "Add stringType and requiredPermission to sensors, effectively adding permission checking for sensors"

* commit '4369a4ebd5ae7567e7075bc82830b83178099ed5':
Revert "Add stringType and requiredPermission to sensors, effectively adding permission checking for sensors"
30d6fd6b28aeacfe06ddc7adaac34e8a0032df40 05-Apr-2014 Etienne Le Grand <etn@google.com> Revert "Add stringType and requiredPermission to sensors, effectively adding permission checking for sensors"

This reverts commit c57a019e117117c5a76c772970b26cd0f5db8c6a.

Change-Id: I3540565bc3e56a32cf3b176a29216cf68bb763b2
(cherry picked from commit 4369a4ebd5ae7567e7075bc82830b83178099ed5)
/frameworks/native/services/sensorservice/SensorService.cpp
4369a4ebd5ae7567e7075bc82830b83178099ed5 05-Apr-2014 Etienne Le Grand <etn@google.com> Revert "Add stringType and requiredPermission to sensors, effectively adding permission checking for sensors"

This reverts commit c57a019e117117c5a76c772970b26cd0f5db8c6a.

Change-Id: I3540565bc3e56a32cf3b176a29216cf68bb763b2
/frameworks/native/services/sensorservice/SensorService.cpp
33458f72e17be8e71f50e1f8843f7821d90934f5 05-Apr-2014 Etienne Le Grand <etn@google.com> am 00f4dde1: am c57a019e: Add stringType and requiredPermission to sensors, effectively adding permission checking for sensors

* commit '00f4dde1aa88576811bca79bc8242e1fc1edb333':
Add stringType and requiredPermission to sensors, effectively adding permission checking for sensors
00f4dde1aa88576811bca79bc8242e1fc1edb333 05-Apr-2014 Etienne Le Grand <etn@google.com> am c57a019e: Add stringType and requiredPermission to sensors, effectively adding permission checking for sensors

* commit 'c57a019e117117c5a76c772970b26cd0f5db8c6a':
Add stringType and requiredPermission to sensors, effectively adding permission checking for sensors
c57a019e117117c5a76c772970b26cd0f5db8c6a 25-Mar-2014 Etienne Le Grand <etn@google.com> Add stringType and requiredPermission to sensors, effectively adding permission checking for sensors

Change-Id: If0f3dbdb5d2e9378e1fed4614baee4e750d0c850
/frameworks/native/services/sensorservice/SensorService.cpp
c45011f27209d5d548be3f96f2a23f7ff7f48c4c 14-Mar-2014 Mark Salyzyn <salyzyn@google.com> am cdbf28b3: Merge "native frameworks: 64-bit compile issues"

* commit 'cdbf28b3f7f5327f4cb0eb95b8326bf4c24c87ba':
native frameworks: 64-bit compile issues
993146092f8205d9747f082ccd63c09b536caa4e 14-Mar-2014 Mark Salyzyn <salyzyn@google.com> am d4dabf87: am cdbf28b3: Merge "native frameworks: 64-bit compile issues"

* commit 'd4dabf872ac0a12e12aebae9032f7d62762c2aeb':
native frameworks: 64-bit compile issues
d4dabf872ac0a12e12aebae9032f7d62762c2aeb 13-Mar-2014 Mark Salyzyn <salyzyn@google.com> am cdbf28b3: Merge "native frameworks: 64-bit compile issues"

* commit 'cdbf28b3f7f5327f4cb0eb95b8326bf4c24c87ba':
native frameworks: 64-bit compile issues
92dc3fc52cf097bd105460cf377779bdcf146d62 12-Mar-2014 Mark Salyzyn <salyzyn@google.com> native frameworks: 64-bit compile issues

- Fix format (print/scanf)
- Suppress unused argument warning messages (bonus)

Change-Id: I05c7724d2aba6da1e82a86000e11f3a8fef4e728
/frameworks/native/services/sensorservice/SensorService.cpp
35348dc712f096a5b8be60d72a3d8f19a4985840 06-Mar-2014 Aravind Akella <aakella@google.com> am e7643e43: am 8ae7c02e: am ffac23b2: am 4b84704b: Ignore flush complete events when recording last value for a sensor.

* commit 'e7643e431abc2d1b42ab1d68913ec22d0b180554':
Ignore flush complete events when recording last value for a sensor.
4b84704b97300eff3ebfab85652e64d54149d205 04-Mar-2014 Aravind Akella <aakella@google.com> Ignore flush complete events when recording last value for a sensor.

Bug: 11822806
Change-Id: I1402d6684ed71ed413aef6a7be3aad945b331ec2
/frameworks/native/services/sensorservice/SensorService.cpp
eefced119bc568d773b86c34cd8bc9d9574638f6 06-Feb-2014 Patrick Tjin <pattjin@google.com> Add uid to sensorservice's dump of active connections

Change-Id: I1c365157bcd28a93635dbde4a8d91c79750e03ae
/frameworks/native/services/sensorservice/SensorService.cpp
b4099e77ec2bf8e9d4259ff30f0cb1d621deed91 16-Oct-2013 Aravind Akella <aakella@google.com> Bug fixes for SensorService

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
/frameworks/native/services/sensorservice/SensorService.cpp
c551eac5b16a53f872cbb692d3a0c81e39329725 15-Oct-2013 Aravind Akella <aakella@google.com> SensorService Flush API bug fix.

SensorService is dead locking itself when flush is called on older devices which don't support batching. mConnectionLock is acquired twice.

Change-Id: I5c25585bfb2b396df4b05826a9cba1da7997a3ee
/frameworks/native/services/sensorservice/SensorService.cpp
701166d9f60a6e1149ff568aec0e03f3f3925292 08-Oct-2013 Aravind Akella <aakella@google.com> Change API from flush(handle) to flush(). Call flush on all active sensors in the given SensorEventConnection.

Change-Id: I4ef2bec80406c517903ab9782dc9eaf3fa8b7f36
/frameworks/native/services/sensorservice/SensorService.cpp
4c8b951f8d6a121e758bd3905fa8987c77863790 06-Sep-2013 Aravind Akella <aakella@google.com> Sensor Batching Bug fixes.

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
/frameworks/native/services/sensorservice/SensorService.cpp
90ed3e8d7883d9c80fb8bf11b1c593bd8b2b39d0 10-Sep-2013 Mathias Agopian <mathias@google.com> fix a few problems with BitTube

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
/frameworks/native/services/sensorservice/SensorService.cpp
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/SensorService.cpp
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/SensorService.cpp
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/SensorService.cpp
7438fd1a0132bc6de101e2a5f75040a119b6f29b 08-Jul-2013 Mathias Agopian <mathias@google.com> simplify some unnecessary complex code

getSensorType() ran in O(n) instead of O(1). fix that.

Change-Id: Idcf29e46fc34db32604a0d8e5a9156486783b74f
/frameworks/native/services/sensorservice/SensorService.cpp
0319306670b0344da99efa606b6f172dde575a39 11-May-2013 Mathias Agopian <mathias@google.com> various fixes to the sensorservice

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
/frameworks/native/services/sensorservice/SensorService.cpp
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/SensorService.cpp
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/SensorService.cpp
787ac1b388f144f5e6dd38f8b807866a5256dafc 19-Sep-2012 Mathias Agopian <mathias@google.com> improve sensor battery usage tracking

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
/frameworks/native/services/sensorservice/SensorService.cpp
5307d17fe33fc26eeeacd6339a9fbfe96cf56873 19-Sep-2012 Mathias Agopian <mathias@google.com> track UID with connections

Change-Id: Id4865f3cd27a95acdbbfdff1f2bb4123f312a13b
/frameworks/native/services/sensorservice/SensorService.cpp
a5b8e8bfa9f3416ce61ee08162fb139afde60488 19-Sep-2012 Mathias Agopian <mathias@google.com> fix a typo in SensorService

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
/frameworks/native/services/sensorservice/SensorService.cpp
33264868ba0aaccb9d4b5e5a067a79a43633f6ec 29-Jun-2012 Mathias Agopian <mathias@google.com> add a way to enable debugging sensors at runtime

if debug.sensors is true, extra debugging
sensors are enabled and HAL provided sensor fusion
is disabled

Change-Id: I9b093424edb8c5363d1337237cdf6abe4ab266f9
/frameworks/native/services/sensorservice/SensorService.cpp
8dd4fe8dd37b740282b48b7867eec26fcf95e027 31-May-2012 Mathias Agopian <mathias@google.com> fix a potential buffer overflow in sensorservice

Bug: 6580560
Change-Id: Icf6cafbca09174515a964a7cd69d8cc589ad52de
/frameworks/native/services/sensorservice/SensorService.cpp
d1920ffede9e9bc107104ad94c291ca0f0f18bc3 30-May-2012 Mathias Agopian <mathias@google.com> Fix a stack corruption in sensorservice

Bug: 6576732
Change-Id: If0f2fb0d0c35b932fb77cd262e676042145b28f9
/frameworks/native/services/sensorservice/SensorService.cpp
a5c106a4f0afcf061728a1cb7c8c3b908728575d 20-Apr-2012 Mathias Agopian <mathias@google.com> fix a typo causing sensor event to be sorted in reverse chronological order

Change-Id: I041c64616d88ed1abb5efc90ed9eb0d9baeb4832
/frameworks/native/services/sensorservice/SensorService.cpp
907103bf186cfdd2ed9eb3b6c36de53ade7b16f6 03-Apr-2012 Mathias Agopian <mathias@google.com> usea socketpair instead of a pipe in BitTube

Bug: 6252830
Change-Id: I363cc7e9f73a5b7d8bbccee312c6d8938c84e99a
/frameworks/native/services/sensorservice/SensorService.cpp
f5a1230d322c14c42331d0a1536b50c87742973b 06-Jan-2012 Steve Block <steveblock@google.com> Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/#/c/157220

Bug: 5449033
Change-Id: Ic9c19d30693bd56755f55906127cd6bd7126096c
/frameworks/native/services/sensorservice/SensorService.cpp
3c20fbed7f3a916ced10f2ed5a272271b7d81ede 06-Jan-2012 Steve Block <steveblock@google.com> Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/157065

Bug: 5449033
Change-Id: I00a4b904f9449e6f93b7fd35eac28640d7929e69
/frameworks/native/services/sensorservice/SensorService.cpp
a551237de142549fb8a6608ee9d2fbf4b7ca2ebf 20-Dec-2011 Steve Block <steveblock@google.com> Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/156016

Bug: 5449033
Change-Id: I4c4e33bb9df3e39e11cd985e193e6fbab4635298
/frameworks/native/services/sensorservice/SensorService.cpp
1a62301fc58cd2af18239b0415813461bf5fc41b 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/native/services/sensorservice/SensorService.cpp
62569ecf526c7c01cb68ea461c6bbd3cb26057d2 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/native/services/sensorservice/SensorService.cpp
ae09d65f5b35cb51da2e1386a6dd7a52085f1325 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/native/services/sensorservice/SensorService.cpp
b3989276d17f2b083bec67b695d1078fb86c6c53 21-Oct-2011 Mathias Agopian <mathias@google.com> Rename SensorChannel to BitTube
/frameworks/native/services/sensorservice/SensorService.cpp
16c3e4ae72e543f53a82f393dd287c11db8a7a80 21-Jul-2011 Mathias Agopian <mathias@google.com> silence sensorservice when it's dropping events

Change-Id: Ib05862e545aa780821aa605e45ab189f530494b7
/frameworks/native/services/sensorservice/SensorService.cpp
7b2b32f2e761a919deb6f82d978b379429f77b05 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/native/services/sensorservice/SensorService.cpp
1cb13461a8cf62e3ba634e5965332f2d284f6d42 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/native/services/sensorservice/SensorService.cpp
010e42230135815907e76e5d7e5f30edf9e1799d 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/native/services/sensorservice/SensorService.cpp
3301542828febc768e1df42892cfac4992c35474 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/native/services/sensorservice/SensorService.cpp
984826cc158193e61e3a00359ef4f6699c7d748a 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/native/services/sensorservice/SensorService.cpp
a1b7db95b6ccf5be9d8dfaac1b8f45494813edc0 28-May-2011 Mathias Agopian <mathias@google.com> Fix a few issues with sensors reference-counting
/frameworks/native/services/sensorservice/SensorService.cpp
e04a63b3053270d64890f156869e7cf75c436fbb 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/native/services/sensorservice/SensorService.cpp
3f2f8916112126fb1a93e4a4b4e2d4e01570aeee 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/native/services/sensorservice/SensorService.cpp
db5b4bce9e65ec9c2c7762b601297e4abadbc22a 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/native/services/sensorservice/SensorService.cpp
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/SensorService.cpp
71d7a5c289c6ef6b5fc86dd4784a075ca6470e38 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/native/services/sensorservice/SensorService.cpp
94e8f6813f3fb2beaa9bcbfb1ad9b4ae2eb46949 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/native/services/sensorservice/SensorService.cpp
24d72350f321c17b0bfe1ef3fd52d4070a1c02c3 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/native/services/sensorservice/SensorService.cpp
1e0b1e8491e5f6dc59faabe70cbfa942853150e0 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/native/services/sensorservice/SensorService.cpp
c4a930d1d5a432a1f302763ac55460d6e83fe7e0 23-Jul-2010 Mathias Agopian <mathias@google.com> Report sensor events to BatteryStats service

Change-Id: I9b83aa709887aa658bc474391573f2d45b6c4eb2
/frameworks/native/services/sensorservice/SensorService.cpp
3560fb24b668675627934356f210d84d19bf4e56 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/native/services/sensorservice/SensorService.cpp
cf51001dbf28e9885fcacd4048902f1c75768fe9 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/native/services/sensorservice/SensorService.cpp
7c1c531872a95051cb11ec829e3daf890d9bb58a 22-Jul-2010 Mathias Agopian <mathias@google.com> propagate sensor event rate properly to the sensor HAL

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

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

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

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

Change-Id: I2af319d89e49b0f2349ec9d8b0fccac80e9bc047
/frameworks/native/services/sensorservice/SensorService.cpp
fc32881fcc68640d008c7515cdd1bcd866f72cd5 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/native/services/sensorservice/SensorService.cpp