mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
remote binding to our service now works
This commit is contained in:
parent
140c1561c3
commit
0cca88575d
2 changed files with 14 additions and 8 deletions
|
|
@ -180,13 +180,15 @@ class MainActivity : AppCompatActivity(), Logging {
|
|||
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
|
||||
|
||||
// This is the remote version that does not work! FIXME
|
||||
//val intent = Intent(IMeshService::class.java.name)
|
||||
//intent.setPackage("com.geeksville.mesh");
|
||||
// bind to our service using the same mechanism an external client would use (for testing coverage)
|
||||
val intent = Intent()
|
||||
intent.setClassName("com.geeksville.mesh", "com.geeksville.mesh.MeshService")
|
||||
|
||||
// The following would work for us, but not external users
|
||||
//val intent = Intent(this, MeshService::class.java)
|
||||
//intent.action = IMeshService::class.java.name
|
||||
|
||||
isBound = bindService(intent, serviceConnection, Context.BIND_AUTO_CREATE)
|
||||
logAssert(isBound)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue