| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some ICS apps (namely, Google Maps) expects a rotation vector to be
available. Newer devices, this is provided by either Android's
sensor fusion (requires Gyro) or by hardware sensor fusion (MPL).
Older devices will lack this virtual sensor and compass in Google
Maps will not work. To fix this, we can provide our own rotation
vector sensor by converting the values from the orientation sensor.
(They are basically the same information in different formats.)
Thanks to Unhelpful for the help with related math.
Change-Id: I596f5dc44f8797bc280ae5d1e110bb92387c79d1
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
https://android.googlesource.com/platform/frameworks/base into aosp
Conflicts:
core/res/res/values/strings.xml
policy/src/com/android/internal/policy/impl/GlobalActions.java
services/java/com/android/server/WifiService.java
services/sensorservice/SensorDevice.cpp
telephony/java/com/android/internal/telephony/RIL.java
Change-Id: I89ec56d5ff282a2eb879ca40fb6d74ebcf752837
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Enable with TARGET_USES_OLD_LIBSENSORS_HAL:=true
Change-Id: Ib430d8305148f337dd111c80be60ddd151ea5926
sensors: Improve support for old libsensors HAL
Some devices (harmony, at least) claim to support the nuSensors
SENSORS_HARDWARE_POLL, which was breaking the compatibility
check. This removes that check from runtime and makes it
exclusively a compile-time option..
Change-Id: Ide4262e5dec296d96aa896d676a06985fe09aef1
sensors: Fix sensorId/sensorType logic in back-compat layer
As it was, the code was only working on devices where the ID matched
the the sensorType. This isn't necessarily true on every device (and
definititely isn't on some)
Change-Id: I70a5d827c5a6406b5edacc334705edb43e6f5638
sensors: Simplify the data translation in the back-compat hook
Since the sensor data comes in a union, we don't need to do a copy
for every possible entry, we just need one per type. This cuts us
down from 6 data copies on every poll to just 2.
Change-Id: I755f3018ad38be1b7fa04528143507204b4df605
sensors: More compatibility fixes
Some of the old HAL "magic values" aren't magic anymore, so discard
them instead of trying to react like the pre-2.3 implementation.
This had the potential of causing infinite loops on some libsensors (it
was doing it on yamaha's)
Change-Id: Id792faa6a454428040ae2973e386f3a25c904c8e
sensors: Add handle-to-type mapping in back-compat layer
The result of the old API data_poll is an int, which should represent
a handle to the actualy sensor. That handle must be mapped to the sensor
type, which is required by the new API.
I was wrongly assuming the handle and the type were the same, and that
isn't necessarily true; the only reason this was working is because the
java client API appears to be still doing its own handle-to-type mapping
and mostly ignoring the type value set at the native layer
Change-Id: Ibe6209b91cf96aa885a05d6091155ee7ef929211
sensors: Add workaround for Foxconn's broken sensor data
FIH has a tendency to add in-kernel "shortcuts" for stuff that's usually
controlled in userspace, and disabling the screen+backlight on proximity
was one of those. That implementation is, however, buggy, and on top of that
it's colliding with the standard userspace implementation.
This should be corrected at the sensors HAL, but reimplementing that
has been a work-in-progress for quite some time now and still isn't functional.
So, for now, toggle a workaround with TARGET_HAS_FOXCONN_SENSORS, and
convert the data into the kind of values the framework expects.
Change-Id: Ib974af729ce0511668c835b9078831330b874a1f
Add TARGET_SENSORS_NO_OPEN_CHECK for betelgeuse (Folio100) support
sensors.tegra.so on betelgeuse return -22 on both sensors_control_open,
sensors_data_open, but sensors are OK after those two calls.
Change-Id: Iabe14f9ed26ff182041f447cf278408ada62ef81
sensors: Fix ALS and PS lag on back-compat layer
These 2 sensors only report values on change,
instead of continuously generating samples at 'setDelay'
intervals like most others. If only these 2 (or any one of
them is enabled), we can't wait for the usual 64 samples
to be taken before reporting them to the framework, since
that'll make them visibly laggy.
This patch causes any sample from these sensors to trigger
an immediate report to the client.
Change-Id: Id5932376858c30323bff07ac4b38856dc200d074
sensors: Add dummy light sensor for p990/p999
This is necessary for the rest of userspace to recognize its existence
and toggle it for auto-brightness. It doesn't generate actual light
values, though; all backlight adjustments are made in-kernel.
Change-Id: I0e546b4740720bd34d1e1d85a96b295fcc697106
sensors: Allow target to override max range of proximity sensor
If a proximity sensor rarely or never reaches its maxRange, the
device will frequently lock up after the sensor is triggered (by
a call, for example), since it'll get stuck in the "active" state.
Set TARGET_PROXIMITY_SENSOR_LIMIT := <value> with the distance
from which the sensor will turn off to override those cases
Change-Id: I31fa2e5b9bd40ed6d80a1d5b0c147ed265f94c3a
Change-Id: Ib430d8305148f337dd111c80be60ddd151ea5926a
|
|
|
|
| |
Change-Id: I8b53d5cab884c3aca16d95df5fbf288368d52e8b
|
|
|
|
| |
Change-Id: I6248b6f1f001fedec1bddcddfcd2b381d9bb4bf4
|
|
|
|
| |
Change-Id: I6b6f75373f4ac28f98dea6a6f1c2567a6aa02243
|
|
|
|
| |
Change-Id: I18e5b72d02bf5420c14334d3a03f18fa40572d31
|
|
|
|
| |
Change-Id: I51186e12fb9b2316e3671e3908174f4495df89a0
|
|
|
|
| |
Change-Id: I89d63122574c3f8790f00512c76d59b463acf18f
|
|
|
|
| |
Change-Id: Ib05862e545aa780821aa605e45ab189f530494b7
|
|
|
|
|
| |
Bug: 5030108
Change-Id: I45b85b3c492b9268cb0ae44d2e5fc8c708b6e66e
|
|
|
|
|
|
| |
Bug: 5010576
Change-Id: I04d722f258951a3078fe07899f5bbe8aac02a8e8
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Change-Id: Iedcae7164af8f7ea0e048ea7c72d0f35d16d739f
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
also use correct time propagation equation
disable the fused sensors when gyro is not present since
they were unusable in practice.
Change-Id: Iad797425784e67dc6c5690e97c71c583418cc5b5
|
|
|
|
|
|
|
| |
Add support for 9-axis gravity and linear-acceleration sensors
virtual orientation sensor using 9-axis fusion
Change-Id: I6717539373fce781c10e97b6fa59f68a831a592f
|
| |
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
Change-Id: I54dd62ebef47e7690afa5a858f3cad941b135481
Signed-off-by: Iliyan Malchev <malchev@google.com>
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
running slowly
The cut-off frequency of the lowpass filter was too high
for the sampling rate used by DELAY_NORMAL.
Now we use the same filters used for the gravity vector
(cascaded biquad at 1.5 Hz)
Change-Id: I319dc4f449a3abd553d61b196a9ddcf7782f912d
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- upadte documentation for rotation vector
- update method dealing with rotation vector to deal with 4 components
- virtual rotation-vector sensor reports all four components
- improve SensorManager documentation layout
Whent he 4-th component of the rotation-vector is present, we can save
a square-root when computing the quaternion or rotation matrix from it.
Change-Id: Ia84d278dd5f0909fab1c5ba050f8df2679e2c7c8
|
|/
|
|
|
|
|
|
| |
Most accelerometers have 8-bits accuracy so we beed to
reject 48dB in thestop-band, which requires a 4-th order
filter at the cut-off frequency we're using.
Change-Id: Ic00421d38d751641f86b1f3ad7663e6b44a91198
|
|
|
|
|
|
|
|
|
|
|
| |
indeed, by construction of the rotation matrix, it is
guaranteed to have a length of 1.
moreover, the normalization code was missing a square-root,
fortunatelly, since the length is 1, this didn't cause any
damage (since sqrt(1) = 1).
Change-Id: I9facd668caaf5bb3bfccb139ab872f2bb2066365
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
the increased maximum rate is needed for proper gyro integration, current gyro
parts can sample at up to 800Hz
Change-Id: Ide75f6d5bc7a0fdafeb2dafd72db39e7afb9e794
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Change-Id: I9b83aa709887aa658bc474391573f2d45b6c4eb2
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
we now don't send events down to a connection that has not
registered for this event.
Change-Id: I3fe507974d3e99293749bfec2ef871e8a0ee9600
|
|
|
|
| |
Change-Id: I1abe4c0fcce423caab79208353fded4d57398227
|
|
|
|
| |
Change-Id: I32e67d30e4295285a6827956cc8161b2025d70bc
|
|
|
|
| |
Change-Id: I83700b1a1b43390f5830e1056572bfb16e58e8e4
|
|
|
|
| |
Change-Id: Iae65a8547ee5815cc4c3b74d2c9ef17bed7f565d
|
|
|
|
| |
Change-Id: I2af319d89e49b0f2349ec9d8b0fccac80e9bc047
|
|
remove old sensor service and implement SensorManager
on top of the new (native) SensorManger API.
Change-Id: Iddb77d498755da3e11646473a44d651f12f40281
|