From d11e7674f6a6dfa4db87b7fe3f16497fab174b63 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Thu, 4 Feb 2021 23:39:44 +0800 Subject: [PATCH] fix autobug: don't spam crashlytics when we expect position sending to fail --- app/src/main/java/com/geeksville/mesh/service/MeshService.kt | 4 +++- .../java/com/geeksville/mesh/service/RadioInterfaceService.kt | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/geeksville/mesh/service/MeshService.kt b/app/src/main/java/com/geeksville/mesh/service/MeshService.kt index 677704698..5090fe03f 100644 --- a/app/src/main/java/com/geeksville/mesh/service/MeshService.kt +++ b/app/src/main/java/com/geeksville/mesh/service/MeshService.kt @@ -73,7 +73,9 @@ class MeshService : Service(), Logging { class IdNotFoundException(id: String) : Exception("ID not found $id") class NodeNumNotFoundException(id: Int) : Exception("NodeNum not found $id") - class IsUpdatingException() : Exception("Operation prohibited during firmware update") + + /** We treat software update as similar to loss of comms to the regular bluetooth service (so things like sendPosition for background GPS ignores the problem */ + class IsUpdatingException() : RadioNotConnectedException("Operation prohibited during firmware update") /** * Talk to our running service and try to set a new device address. And then immediately diff --git a/app/src/main/java/com/geeksville/mesh/service/RadioInterfaceService.kt b/app/src/main/java/com/geeksville/mesh/service/RadioInterfaceService.kt index c24e5aa87..78890c334 100644 --- a/app/src/main/java/com/geeksville/mesh/service/RadioInterfaceService.kt +++ b/app/src/main/java/com/geeksville/mesh/service/RadioInterfaceService.kt @@ -22,7 +22,7 @@ import kotlinx.coroutines.Job import kotlinx.coroutines.cancel -class RadioNotConnectedException(message: String = "Not connected to radio") : +open class RadioNotConnectedException(message: String = "Not connected to radio") : BLEException(message)