Huge refactor for better maintainability

This commit is contained in:
Mygod
2018-06-01 20:21:05 +08:00
parent a5bec59bbe
commit 8aa7d6d8c7
35 changed files with 1072 additions and 824 deletions

View File

@@ -6,6 +6,7 @@ import android.net.wifi.WifiManager
import android.support.annotation.RequiresApi
import android.widget.Toast
import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.manage.LocalOnlyHotspotManager
import be.mygod.vpnhotspot.net.IpNeighbourMonitor
import be.mygod.vpnhotspot.net.TetheringManager
import be.mygod.vpnhotspot.util.broadcastReceiver
@@ -18,7 +19,7 @@ class LocalOnlyHotspotService : IpNeighbourMonitoringService() {
}
inner class Binder : android.os.Binder() {
var fragment: TetheringFragment? = null
var manager: LocalOnlyHotspotManager? = null
var iface: String? = null
val configuration get() = reservation?.wifiConfiguration
@@ -48,7 +49,7 @@ class LocalOnlyHotspotService : IpNeighbourMonitoringService() {
IpNeighbourMonitor.registerCallback(this)
} else check(iface == routingManager.downstream)
}
app.handler.post { binder.fragment?.adapter?.updateLocalOnlyViewHolder() }
app.handler.post { binder.manager?.update() }
}
override val activeIfaces get() = listOfNotNull(binder.iface)