Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[hybrisadaptor] Deal with sensor type aliasing changes. JB#43020
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>
  • Loading branch information
spiiroin committed Oct 1, 2018
1 parent 49247f3 commit 2d0ed57
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/hybrisadaptor.cpp
Expand Up @@ -47,10 +47,10 @@
#define SENSOR_TYPE_ACCELEROMETER (1)
#endif
#ifndef SENSOR_TYPE_GEOMAGNETIC_FIELD
#define SENSOR_TYPE_GEOMAGNETIC_FIELD (2)
#define SENSOR_TYPE_GEOMAGNETIC_FIELD (2) // alias for SENSOR_TYPE_MAGNETIC_FIELD
#endif
#ifndef SENSOR_TYPE_MAGNETIC_FIELD
#define SENSOR_TYPE_MAGNETIC_FIELD SENSOR_TYPE_GEOMAGNETIC_FIELD
#define SENSOR_TYPE_MAGNETIC_FIELD (2) // alias for SENSOR_TYPE_GEOMAGNETIC_FIELD
#endif
#ifndef SENSOR_TYPE_ORIENTATION
#define SENSOR_TYPE_ORIENTATION (3)
Expand Down

0 comments on commit 2d0ed57

Please sign in to comment.