Skip to content

Commit

Permalink
MovingWifiHelper: Fix _SNCF_WIFI_INTERCITES
Browse files Browse the repository at this point in the history
The new JSON dosen't include a "fix" field on french intercity trains anymore, but they're still in use on TGVs and OUIGO
  • Loading branch information
valerierx committed Aug 21, 2024
1 parent f263255 commit dedc463
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,9 @@ class MovingWifiHelper(private val context: Context) {

private fun parseSncf(location: Location, data: ByteArray): Location {
val json = JSONObject(data.decodeToString())
if(json.getInt("fix") == -1) throw RuntimeException("GPS not valid")
json.optInt("fix").takeIf { !it.isNaN() }?.let {

Check failure on line 250 in play-services-location/core/provider/src/main/kotlin/org/microg/gms/location/network/wifi/MovingWifiHelper.kt

View workflow job for this annotation

GitHub Actions / Gradle build

Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:

Check failure on line 250 in play-services-location/core/provider/src/main/kotlin/org/microg/gms/location/network/wifi/MovingWifiHelper.kt

View workflow job for this annotation

GitHub Actions / Gradle build

Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
if(it.toInt() == -1) throw RuntimeException("GPS not valid")
}
location.accuracy = 100f
location.latitude = json.getDouble("latitude")
location.longitude = json.getDouble("longitude")
Expand Down

0 comments on commit dedc463

Please sign in to comment.