Skip to content
This repository has been archived by the owner on May 3, 2022. It is now read-only.

Update to 0.11.8 & fix some sensor issues. #3

Merged
merged 60 commits into from Apr 8, 2020

Conversation

MagneFire
Copy link
Member

The hybris sensor manager was refactored in upstream. That fixes some potential issues (i.e. set delay based on min/max provided by Android, deactivates all sensors by default).

Also a 200ms delay is explicitly set for the heart rate sensor and the wrist gesture sensor (See: AsteroidOS/meta-sturgeon-hybris#6 and AsteroidOS/meta-sturgeon-hybris#7). This is needed for sturgeon. But I think it shouldn't break other platforms(hopefully).

spiiroin and others added 30 commits April 7, 2020 10:55
Use variadic macros to allow calls like:
  sensordLogT("foo=%d", bar);

Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>
Whether sensors should be started or stopped depends on a number
of state variables. Using case specific conditionals at places
where state variables might change makes the code fragile and
hard to maintain.

Separate sensor hal operations more clearly from logic and forms
dictated by sensorfwd conventions.

Use m_memberName naming convention for member variables, make
all member data private and usable only via accessor functions.

Use a single sensor start/stop policy evaluation function and
call it from each place where relevant state variables might
change.

Use sensorfwd specific logging functions instead of qDebug etc.

Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>
Sensor specific adaptors derived from HybrisAdaptor class can be configured
to enable/disable sensors directly via sysfs. While doing that they also
bypass enable/disable policy that is implemented in HybrisAdaptor.

Fix each HybrisXxxAdaptor class so that common policy logic is executed
first, and direct sysfs manipulation is done based on policy decision.

Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>
It is possible that on-change type sensors are not reported by android
hal until a change is actually detected. Sensorfwd is left using zero
initialized default values like proximity=covered / light=darkness -
which in turn can cause various issues after each bootup.

As the initial state can't be queried, choose the lest harmful option
and define fallback values during sensor hal probing:
- proximity sensor = not covered
- light sensor = 400 lux

If no actual sensor data has been received in a situation where sensor
state needs to be communicated to clients, apply the fallback value.

Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>
The code can't be compiled for devices that use older android hal versions
that do not define all sensor types referred to in the code.

Provide values for all sensor types that are not defined in the android
header files.

Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>
Sensor maximum delay is available from sensors device API version 1.3
onwards. If development headers are too ancient, trying to access
maxDelay member in sensor_t structure causes compilation failures.

Use fallback value for maxDelay unless both development headers and
sensors device exposed via hal indicate that sensors device API version
1.3 features are available.

Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>
It seems that in later android header versions sensor type values
have been changed from #define constants into enumeration values.
And while previously SENSOR_TYPE_MAGNETIC_FIELD was alias for
SENSOR_TYPE_GEOMAGNETIC_FIELD, now it is the other way around. Which
then has the net effect of: Attempt to provide fallback value for
SENSOR_TYPE_MAGNETIC_FIELD with symbolic name results in compilation
failures.

Use hard-coded fallback values for both SENSOR_TYPE_GEOMAGNETIC_FIELD
and SENSOR_TYPE_MAGNETIC_FIELD to break dependency on what types android
header considers to be aliases vs not.

Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>
Sensorfwd crashes on exit in h3113 devices (Xperia XA2). This happens
because of Config class related symbol name clash between sensorfwd
and android dynamic loader / libhybris: Destructor from sensorfwd
code base ends up used for cleaning up libhybris objects - which then
leads to segfault.

As runtime loader is what it is, rename "Config" class in sensorfwd
to less generic "SensorFrameworkConfig".

Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>
… to JB#38578

Rename sensorfw-qt subpackage docs to doc and make packaging information
more consistent with other packages.

Signed-off-by: Tomi Leppänen <tomi.leppanen@jolla.com>
…es inside CompassFilter from int to qreal. Fixes MER#2016

Signed-off-by: Ivan Shchitov <ivan.shchitov@fruct.org>
Signed-off-by: Matti Kosola <matti.kosola@jolla.com>
Signed-off-by: Matti Kosola <matti.kosola@jolla.com>
Signed-off-by: Eugenio Paolantonio (g7) <me@medesimo.eu>
[iioadaptor] Allow overriding iioDevices' scaling factor. Fixes MER#2053
[packaging] Add missing debian build dependencies. Fixes MER#2060
mariogrip and others added 27 commits April 7, 2020 10:55
As we try to build the hybris package (libsensorfw-qt5-hybris) bellow,
we should also include the build dependencies that hybris requres.
…odel

Integrate patches for dbus and systemd currently applied during build in LuneOS. As well as migration to webOS OSE's LS2 ACG model.

Signed-off-by: Herman van Hazendonk <github.com@herrie.org>
This adds the missing iiosensorsadaptor plugin to the debian package
Remove not needed pro.user file. Fix a build warning.
Add missing spec files to .pro file.
…ce. Fixes JB#48890

Fixes shutdown on some devices.
…mmon policy

Sensor specific adaptors derived from HybrisAdaptor class can be configured
to enable/disable sensors directly via sysfs. While doing that they also
bypass enable/disable policy that is implemented in HybrisAdaptor.

Fix each HybrisXxxAdaptor class so that common policy logic is executed
first, and direct sysfs manipulation is done based on policy decision.

Original patch from:
https://git.sailfishos.org/mer-core/sensorfw/commit/ed38fb45ffe470dce63805909fb2ef0f38caaef6
Sensor specific adaptors derived from HybrisAdaptor class can be configured
to enable/disable sensors directly via sysfs. While doing that they also
bypass enable/disable policy that is implemented in HybrisAdaptor.

Fix each HybrisXxxAdaptor class so that common policy logic is executed
first, and direct sysfs manipulation is done based on policy decision.

Original patch from:
https://git.sailfishos.org/mer-core/sensorfw/commit/ed38fb45ffe470dce63805909fb2ef0f38caaef6
This fixes a problem on some platforms where when the wrist gesture sensor wouldn't fire when restarted.
This fixes a problem on some platforms where when the heart rate monitor wouldn't start reading when restarted.
@FlorentRevest
Copy link
Member

Yay this is great :)

@FlorentRevest FlorentRevest merged commit ffbadc0 into AsteroidOS:master Apr 8, 2020
@MagneFire MagneFire deleted the 0.11.8 branch April 18, 2020 21:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet