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
This commit is contained in:
Ethan Chen 2015-04-23 17:27:36 -07:00 committed by Gerrit Code Review
parent 911c7f3338
commit b53d92c3eb

View File

@ -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);
}
}