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

Commit b53d92c3 authored by Ethan Chen's avatar Ethan Chen Committed by Gerrit Code Review
Browse files

sensorservice: Don't replace HAL orientation sensor

* Previously HAL orientation sensor would always be replaced if the HAL
  did not provide a rotation vector sensor as well. Practically no HAL
  does, so the virtual sensor would always replace it.
* Add the virtual sensor only if the HAL does not provide it.

Change-Id: I50ad2cd6c60b53eddc4c6854997ec2e3dbff0d1a
parent 911c7f33
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -149,10 +149,6 @@ void SensorService::onFirstRef()
                    if (orientationIndex == -1) {
                        // some sensor HALs don't provide an orientation sensor.
                        mUserSensorList.add(aSensor);
                    } else {
                        // if we are doing our own rotation-vector, also add
                        // the orientation sensor and remove the HAL provided one.
                        mUserSensorList.replaceAt(aSensor, orientationIndex);
                    }
                }