prevent race condition if meshservice starts running before radiointerface

This commit is contained in:
geeksville 2020-06-11 11:20:51 -07:00
parent b4687b0a2f
commit e4223d6476
3 changed files with 19 additions and 3 deletions

View file

@ -148,7 +148,12 @@ class MeshService : Service(), Logging {
private val clientPackages = mutableMapOf<String, String>()
val radio = ServiceClient {
IRadioInterfaceService.Stub.asInterface(it)
val stub = IRadioInterfaceService.Stub.asInterface(it)
// Now that we are connected to the radio service, tell it to connect to the radio
stub.connect()
stub
}
private val serviceJob = Job()