Fix vertical accuracy. (#116)

* Send 0 instead of null for vertical accuracy if we don't have real value.

* Remove nullable fields if they aren't nullable.
This commit is contained in:
Justin Bassett 2019-12-05 18:11:30 -05:00 committed by Paulus Schoutsen
parent 96f548a914
commit a0c9974116
3 changed files with 3 additions and 3 deletions

View file

@ -99,7 +99,7 @@ class LocationBroadcastReceiver : BroadcastReceiver() {
it.speed.toInt(),
it.altitude.toInt(),
it.bearing.toInt(),
if (Build.VERSION.SDK_INT >= 26) it.verticalAccuracyMeters.toInt() else null
if (Build.VERSION.SDK_INT >= 26) it.verticalAccuracyMeters.toInt() else 0
)
mainScope.launch {

View file

@ -8,5 +8,5 @@ data class UpdateLocationRequest(
val speed: Int,
val altitude: Int,
val course: Int,
val verticalAccuracy: Int?
val verticalAccuracy: Int
)

View file

@ -8,5 +8,5 @@ data class UpdateLocation(
val speed: Int,
val altitude: Int,
val course: Int,
val verticalAccuracy: Int?
val verticalAccuracy: Int
)