mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
refactor: Update notification and service handling (#1993)
This commit is contained in:
parent
34e10b0032
commit
8d231ff125
2 changed files with 21 additions and 43 deletions
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue