librootkotlinx

Fixes #14, #27, #114, #117.
This commit is contained in:
Mygod
2020-06-21 05:33:39 +08:00
parent 7b1f610f9a
commit ad218d7ec6
51 changed files with 1781 additions and 574 deletions

View File

@@ -12,6 +12,7 @@ import androidx.core.content.ContextCompat
import be.mygod.vpnhotspot.R
import be.mygod.vpnhotspot.RepeaterService
import be.mygod.vpnhotspot.util.KillableTileService
import be.mygod.vpnhotspot.util.Services
import be.mygod.vpnhotspot.util.stopAndUnbind
@RequiresApi(24)
@@ -22,13 +23,13 @@ class RepeaterTileService : KillableTileService() {
override fun onStartListening() {
super.onStartListening()
if (RepeaterService.supported) {
if (Services.p2p != null) {
bindService(Intent(this, RepeaterService::class.java), this, Context.BIND_AUTO_CREATE)
} else updateTile()
}
override fun onStopListening() {
if (RepeaterService.supported) stopAndUnbind(this)
if (Services.p2p != null) stopAndUnbind(this)
super.onStopListening()
}