mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
fix: getMslAltitudeMeters call when MSL altitude is not available
This commit is contained in:
parent
d4f4e4f14a
commit
e5396524fb
1 changed files with 3 additions and 1 deletions
|
|
@ -181,7 +181,9 @@ class MeshService : Service(), Logging {
|
|||
position {
|
||||
latitudeI = Position.degI(location.latitude)
|
||||
longitudeI = Position.degI(location.longitude)
|
||||
altitude = LocationCompat.getMslAltitudeMeters(location).toInt()
|
||||
if (LocationCompat.hasMslAltitude(location)) {
|
||||
altitude = LocationCompat.getMslAltitudeMeters(location).toInt()
|
||||
}
|
||||
altitudeHae = location.altitude.toInt()
|
||||
time = (location.time / 1000).toInt()
|
||||
groundSpeed = location.speed.toInt()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue