sanitiy check: do not add 0.0 altitudes - from locations, that do no have an altitude value - to the elevation calculation

master
y20k 2021-05-03 14:58:58 +02:00
parent 7b1b518892
commit 3c680042de
No known key found for this signature in database
GPG Key ID: 824D4259F41FAFF6
1 changed files with 2 additions and 1 deletions

View File

@ -531,7 +531,8 @@ class TrackerService: Service(), CoroutineScope, SensorEventListener {
// store previous smoothed altitude // store previous smoothed altitude
val previousAltitude: Double = altitudeValues.getAverage() val previousAltitude: Double = altitudeValues.getAverage()
// put current altitude into queue // put current altitude into queue
altitudeValues.add(currentBestLocation.altitude) val currentBestLocationAltitude: Double = currentBestLocation.altitude
if (currentBestLocationAltitude != Keys.DEFAULT_ALTITUDE) altitudeValues.add(currentBestLocationAltitude)
// TODO remove // TODO remove
// uncomment to use test altitude values - useful if testing wirth an emulator // uncomment to use test altitude values - useful if testing wirth an emulator