diff --git a/TODO.md b/TODO.md index c05937a7d..fc4a86f58 100644 --- a/TODO.md +++ b/TODO.md @@ -1,12 +1,12 @@ # Remaining tasks before declaring 1.0 -- fix release build inclusion of firmware +- feh123 problem sony +- fix release build inclusion of firmware - per https://developer.android.com/studio/build/build-variants - Android frontend should refetch the android messages from backend service on Resume - disable software update button after update finishes - first message sent is still doubled for some people - let users set arbitrary params in android -* add a low level settings screen (let user change any of the RadioConfig parameters) -- optionally include firmware files in debug builds - currently they are release only. per https://developer.android.com/studio/build/build-variants +- add a low level settings screen (let user change any of the RadioConfig parameters) Things for the betaish period. diff --git a/app/build.gradle b/app/build.gradle index 6f06e641c..66cbde0bf 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -17,8 +17,8 @@ android { applicationId "com.geeksville.mesh" minSdkVersion 21 // The oldest emulator image I have tried is 22 (though 21 probably works) targetSdkVersion 29 - versionCode 10783 // format is Mmmss (where M is 1+the numeric major number - versionName "0.7.83" + versionCode 10784 // format is Mmmss (where M is 1+the numeric major number + versionName "0.7.84" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { diff --git a/app/src/main/java/com/geeksville/mesh/service/BluetoothInterface.kt b/app/src/main/java/com/geeksville/mesh/service/BluetoothInterface.kt index 92ba0eb7e..e630c5c73 100644 --- a/app/src/main/java/com/geeksville/mesh/service/BluetoothInterface.kt +++ b/app/src/main/java/com/geeksville/mesh/service/BluetoothInterface.kt @@ -10,6 +10,7 @@ import com.geeksville.concurrent.handledLaunch import com.geeksville.util.anonymize import com.geeksville.util.exceptionReporter import com.geeksville.util.ignoreException +import kotlinx.coroutines.CancellationException import kotlinx.coroutines.Job import kotlinx.coroutines.delay import java.lang.reflect.Method @@ -319,7 +320,7 @@ class BluetoothInterface(val service: RadioInterfaceService, val address: String * Some buggy BLE stacks can fail on initial connect, with either missing services or missing characteristics. If that happens we * disconnect and try again when the device reenumerates. */ - private suspend fun retryDueToException() { + private suspend fun retryDueToException() = try { /// We gracefully handle safe being null because this can occur if someone has unpaired from our device - just abandon the reconnect attempt val s = safe if (s != null) { @@ -340,6 +341,8 @@ class BluetoothInterface(val service: RadioInterfaceService, val address: String } else { warn("Abandoning reconnect because safe==null, someone must have closed the device") } + } catch (ex: CancellationException) { + warn("retryDueToException was cancelled") } /// We only try to set MTU once, because some buggy implementations fail @@ -402,7 +405,7 @@ class BluetoothInterface(val service: RadioInterfaceService, val address: String // we begin by setting our MTU size as high as it can go (if we can) if (shouldSetMtu) - safe!!.asyncRequestMtu(512) { mtuRes -> + safe?.asyncRequestMtu(512) { mtuRes -> try { mtuRes.getOrThrow() // FIXME - why sometimes is the result Unit!?! debug("MTU change attempted") @@ -424,6 +427,9 @@ class BluetoothInterface(val service: RadioInterfaceService, val address: String override fun close() { + reconnectJob?.cancel() // Cancel any queued reconnect attempts + reconnectJob = null + if (safe != null) { info("Closing BluetoothInterface") val s = safe 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 3835ec0d6..54f49b52e 100644 --- a/app/src/main/java/com/geeksville/mesh/service/MeshService.kt +++ b/app/src/main/java/com/geeksville/mesh/service/MeshService.kt @@ -1180,7 +1180,7 @@ class MeshService : Service(), Logging { else -> errormsg("Unexpected FromRadio variant") } } catch (ex: InvalidProtocolBufferException) { - Exceptions.report(ex, "Invalid Protobuf from radio, len=${bytes.size}") + errormsg("Invalid Protobuf from radio, len=${bytes.size}", ex) } } @@ -1285,7 +1285,7 @@ class MeshService : Service(), Logging { if (configCompleteId == configNonce) { // This was our config request if (newMyNodeInfo == null || newNodes.isEmpty()) - reportError("Did not receive a valid config") + errormsg("Did not receive a valid config") else { debug("Installing new node DB") discardNodeDB() diff --git a/geeksville-androidlib b/geeksville-androidlib index 792b33a4a..9f8300676 160000 --- a/geeksville-androidlib +++ b/geeksville-androidlib @@ -1 +1 @@ -Subproject commit 792b33a4a82316d0e15be1e15fcf2d777fdc41e0 +Subproject commit 9f83006768de5ca714f4c43e723a3477a91d0713