Remove unnecessary ContextCompat call

This commit is contained in:
Mygod
2019-10-24 12:20:00 +08:00
parent e790e513e1
commit dafee90ae5

View File

@@ -7,7 +7,6 @@ import android.graphics.drawable.Icon
import android.os.IBinder import android.os.IBinder
import android.service.quicksettings.Tile import android.service.quicksettings.Tile
import androidx.annotation.RequiresApi import androidx.annotation.RequiresApi
import androidx.core.content.ContextCompat
import be.mygod.vpnhotspot.LocalOnlyHotspotService import be.mygod.vpnhotspot.LocalOnlyHotspotService
import be.mygod.vpnhotspot.R import be.mygod.vpnhotspot.R
import be.mygod.vpnhotspot.util.KillableTileService import be.mygod.vpnhotspot.util.KillableTileService
@@ -33,8 +32,7 @@ class LocalOnlyHotspotTileService : KillableTileService() {
val binder = binder val binder = binder
when { when {
binder == null -> tapPending = true binder == null -> tapPending = true
binder.iface == null -> ContextCompat.startForegroundService(this, binder.iface == null -> startForegroundService(Intent(this, LocalOnlyHotspotService::class.java))
Intent(this, LocalOnlyHotspotService::class.java))
else -> binder.stop() else -> binder.stop()
} }
} }