fix #123 stop service when disconnected

This commit is contained in:
geeksville
2020-09-08 12:05:03 -07:00
parent 76bbc2e4eb
commit 9cea9ce457

View File

@@ -457,7 +457,8 @@ class MeshService : Service(), Logging {
* tell android not to kill us
*/
private fun startForeground() {
val wantForeground = RadioInterfaceService.getBondedDeviceAddress(this) != null
val a = RadioInterfaceService.getBondedDeviceAddress(this)
val wantForeground = a != null && a != "n"
info("Requesting foreground service=$wantForeground")