Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0dc923de authored by Arne Coucheron's avatar Arne Coucheron Committed by Michael Bestas
Browse files

sensorservice: Register orientation sensor if HAL doesn't provide it

 * In KitKat and on most Samsung devices, the orientation sensor is
   not getting registered, and makes the compass non-working in a lot
   of apps. This patch enables the sensor for such devices.

Change-Id: I0ebba72ec4aa2cfa02c21a6daff0c356c6793fd0
(cherry picked from commit 98fa6f11)
(cherry picked from commit 82c47260)
parent 3f96aba9
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -204,9 +204,10 @@ void SensorService::onFirstRef() {
                // available in the HAL
                bool needRotationVector =
                        (virtualSensorsNeeds & (1<<SENSOR_TYPE_ROTATION_VECTOR)) != 0;
                bool needOrientation = orientationIndex == -1;

                registerSensor(new RotationVectorSensor(), !needRotationVector, true);
                registerSensor(new OrientationSensor(), !needRotationVector, true);
                registerSensor(new OrientationSensor(), !needOrientation, true);

                bool needLinearAcceleration =
                        (virtualSensorsNeeds & (1<<SENSOR_TYPE_LINEAR_ACCELERATION)) != 0;