Update the heading, even if the sensor is unreliable.

This makes it possible to use a different indicator for the unreliable case, instead of just changing the RenderMode to NORMAL.
This commit is contained in:
Tsoi Yat Shing
2020-04-16 16:08:35 +08:00
committed by Łukasz Paczos
parent 7bcc2d3282
commit e3b2452ba2

View File

@@ -106,7 +106,9 @@ class LocationComponentCompassEngine implements CompassEngine, SensorEventListen
public void onSensorChanged(@NonNull SensorEvent event) {
if (lastAccuracySensorStatus == SensorManager.SENSOR_STATUS_UNRELIABLE) {
Logger.d(TAG, "Compass sensor is unreliable, device calibration is needed.");
return;
// Update the heading, even if the sensor is unreliable.
// This makes it possible to use a different indicator for the unreliable case, instead of just changing the RenderMode to NORMAL.
//return;
}
if (event.sensor.getType() == Sensor.TYPE_ROTATION_VECTOR) {
rotationVectorValue = getRotationVectorFromSensorEvent(event);