Fix onServiceDisconnected not called

This commit is contained in:
Mygod
2018-05-09 18:10:22 -07:00
parent dad9bc19e3
commit efa387fd7a
7 changed files with 19 additions and 23 deletions

View File

@@ -42,4 +42,4 @@ abstract class Client {
return true
}
override fun hashCode() = Objects.hash(iface, mac, ip)
}
}

View File

@@ -10,6 +10,7 @@ import be.mygod.vpnhotspot.net.IpNeighbourMonitor
import be.mygod.vpnhotspot.net.TetheringManager
import be.mygod.vpnhotspot.util.StickyEvent1
import be.mygod.vpnhotspot.util.broadcastReceiver
import be.mygod.vpnhotspot.util.stopAndUnbind
class ClientMonitorService : Service(), ServiceConnection, IpNeighbourMonitor.Callback {
inner class Binder : android.os.Binder() {
@@ -70,7 +71,7 @@ class ClientMonitorService : Service(), ServiceConnection, IpNeighbourMonitor.Ca
override fun onDestroy() {
unregisterReceiver(receiver)
IpNeighbourMonitor.unregisterCallback(this)
unbindService(this)
stopAndUnbind(this)
super.onDestroy()
}