refactor: Update notification and service handling (#1993)

This commit is contained in:
James Rich 2025-05-31 15:02:23 -05:00 committed by GitHub
parent 34e10b0032
commit 8d231ff125
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 21 additions and 43 deletions

View file

@ -422,25 +422,6 @@ class MainActivity : AppCompatActivity(), Logging {
)
}
private fun unbindMeshService() {
// If we have received the service, and hence registered with
// it, then now is the time to unregister.
// if we never connected, do nothing
debug("Unbinding from mesh service!")
connectionJob?.let { job ->
connectionJob = null
warn("We had a pending onConnection job, so we are cancelling it")
job.cancel("unbinding")
}
mesh.close()
serviceRepository.setMeshService(null)
}
override fun onStop() {
unbindMeshService()
super.onStop()
}
override fun onStart() {
super.onStart()