fix crashlytics autoreport: if we lose comms while sending gps pos, mark

connection closed
pull/8/head
geeksville 2020-02-24 20:08:18 -08:00
rodzic 2f50728372
commit f55f40d624
2 zmienionych plików z 33 dodań i 27 usunięć

Wyświetl plik

@ -14,7 +14,6 @@ MVP features required for first public alpha
* add screenshots and text to play store entry * add screenshots and text to play store entry
# Medium priority # Medium priority
Features for future builds Features for future builds
* describe user experience: devices always point to each other and show distance, you can send texts between nodes * describe user experience: devices always point to each other and show distance, you can send texts between nodes
@ -61,7 +60,8 @@ Do this "Signal app compatible" release relatively soon after the alpha release
Things for the betaish period. Things for the betaish period.
* let users save old channels * let users save old channels
* make sw update work while node is connected to mesh (at least shutdown the other bluetooth services) * make sw update work while node is connected to mesh - the problem is there are _two_ instances of SafeBluetooth at that moment and therefore we violate undocumented android mutex
rules at the BluetoothDevice level. Either make SafeBluetooth lock at the device level or (not as good) make SafeBluetooth a singleton.
* Use LocationRequest.setSmallestDisplacement to save battery and decrease net activity * Use LocationRequest.setSmallestDisplacement to save battery and decrease net activity
* MeshService.reinitFromRadio can take 300 ms, run it in a worker thread instead * MeshService.reinitFromRadio can take 300 ms, run it in a worker thread instead
* show user icons in chat * show user icons in chat

Wyświetl plik

@ -109,6 +109,7 @@ class MeshService : Service(), Logging {
private var lastSendMsec = 0L private var lastSendMsec = 0L
override fun onLocationResult(locationResult: LocationResult) { override fun onLocationResult(locationResult: LocationResult) {
exceptionReporter {
super.onLocationResult(locationResult) super.onLocationResult(locationResult)
var l = locationResult.lastLocation var l = locationResult.lastLocation
@ -130,14 +131,19 @@ class MeshService : Service(), Logging {
val sendLora = (now - lastSendMsec >= 30 * 1000) val sendLora = (now - lastSendMsec >= 30 * 1000)
if (sendLora) if (sendLora)
lastSendMsec = now lastSendMsec = now
try {
sendPosition( sendPosition(
l.latitude, l.longitude, l.altitude.toInt(), l.latitude, l.longitude, l.altitude.toInt(),
destNum = if (sendLora) NODENUM_BROADCAST else myNodeNum, destNum = if (sendLora) NODENUM_BROADCAST else myNodeNum,
wantResponse = sendLora wantResponse = sendLora
) )
} catch (ex: RadioNotConnectedException) {
warn("Lost connection to radio, stopping location requests")
onConnectionChanged(false)
}
}
} }
} }
} }
} }