fix a couple of old/rare autobugs

This commit is contained in:
geeksville 2020-04-19 18:12:11 -07:00
parent 39eb6664da
commit 1e47895904
3 changed files with 6 additions and 4 deletions

View file

@ -93,6 +93,7 @@ class MeshService : Service(), Logging {
logAssert(
(if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
// we have some samsung devices failing with https://issuetracker.google.com/issues/76112072#comment56 not sure what the fix is yet
context.startForegroundService(intent)
} else {
context.startService(intent)
@ -1014,11 +1015,11 @@ class MeshService : Service(), Logging {
proto.packet
)
else -> TODO("Unexpected FromRadio variant")
else -> errormsg("Unexpected FromRadio variant")
}
}
else -> TODO("Unexpected radio interface broadcast")
else -> errormsg("Unexpected radio interface broadcast")
}
}
}

View file

@ -17,6 +17,7 @@ import com.geeksville.android.Logging
import com.geeksville.concurrent.DeferredExecution
import com.geeksville.mesh.IRadioInterfaceService
import com.geeksville.util.exceptionReporter
import com.geeksville.util.ignoreException
import com.geeksville.util.toRemoteExceptions
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
@ -216,7 +217,7 @@ class RadioInterfaceService : Service(), Logging {
val s = runningService
if (s != null) {
// Ignore any errors that happen while closing old device
exceptionReporter {
ignoreException {
info("shutting down old service")
s.setEnabled(false) // nasty, needed to force the next setEnabled call to reconnect
}