Only restore services when permitted

This commit is contained in:
Mygod
2021-10-29 23:13:24 -04:00
parent e48810d944
commit 1b329558dc
7 changed files with 36 additions and 21 deletions

View File

@@ -1,12 +1,14 @@
package be.mygod.vpnhotspot.util
import android.content.ComponentName
import android.content.Intent
import android.content.ServiceConnection
import android.os.Build
import android.os.IBinder
import android.service.quicksettings.Tile
import android.service.quicksettings.TileService
import androidx.annotation.RequiresApi
import be.mygod.vpnhotspot.BootReceiver
@RequiresApi(24)
abstract class KillableTileService : TileService(), ServiceConnection {
@@ -25,4 +27,6 @@ abstract class KillableTileService : TileService(), ServiceConnection {
onClick()
}
}
override fun onBind(intent: Intent?) = super.onBind(intent).also { BootReceiver.startIfEnabled() }
}