mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
work around for software update vs scan race condition
This commit is contained in:
parent
d536900808
commit
dcd1fd3b55
3 changed files with 123 additions and 94 deletions
|
|
@ -155,12 +155,16 @@ class MainActivity : AppCompatActivity(), Logging {
|
|||
}
|
||||
|
||||
private fun bindMeshService() {
|
||||
info("Binding to mesh service!")
|
||||
debug("Binding to mesh service!")
|
||||
// we bind using the well known name, to make sure 3rd party apps could also
|
||||
logAssert(meshService == null)
|
||||
// FIXME - finding by string does work
|
||||
val intent = Intent(this, MeshService::class.java)
|
||||
intent.action = IMeshService::class.java.name
|
||||
intent.setPackage("com.geeksville.mesh");
|
||||
|
||||
// This is the remote version that does not work! FIXME
|
||||
//val intent = Intent(IMeshService::class.java.name)
|
||||
//intent.setPackage("com.geeksville.mesh");
|
||||
isBound = bindService(intent, serviceConnection, Context.BIND_AUTO_CREATE)
|
||||
logAssert(isBound)
|
||||
}
|
||||
|
|
@ -170,7 +174,7 @@ class MainActivity : AppCompatActivity(), Logging {
|
|||
// it, then now is the time to unregister.
|
||||
// if we never connected, do nothing
|
||||
if(isBound) {
|
||||
info("Unbinding from mesh service!")
|
||||
debug("Unbinding from mesh service!")
|
||||
unbindService(serviceConnection)
|
||||
meshService = null
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue