From dafee90ae544a5bf70210abaf96ab0f4b3c656f3 Mon Sep 17 00:00:00 2001 From: Mygod Date: Thu, 24 Oct 2019 12:20:00 +0800 Subject: [PATCH] Remove unnecessary ContextCompat call --- .../be/mygod/vpnhotspot/manage/LocalOnlyHotspotTileService.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/manage/LocalOnlyHotspotTileService.kt b/mobile/src/main/java/be/mygod/vpnhotspot/manage/LocalOnlyHotspotTileService.kt index 2b25eb14..0519bdda 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/manage/LocalOnlyHotspotTileService.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/manage/LocalOnlyHotspotTileService.kt @@ -7,7 +7,6 @@ import android.graphics.drawable.Icon import android.os.IBinder import android.service.quicksettings.Tile import androidx.annotation.RequiresApi -import androidx.core.content.ContextCompat import be.mygod.vpnhotspot.LocalOnlyHotspotService import be.mygod.vpnhotspot.R import be.mygod.vpnhotspot.util.KillableTileService @@ -33,8 +32,7 @@ class LocalOnlyHotspotTileService : KillableTileService() { val binder = binder when { binder == null -> tapPending = true - binder.iface == null -> ContextCompat.startForegroundService(this, - Intent(this, LocalOnlyHotspotService::class.java)) + binder.iface == null -> startForegroundService(Intent(this, LocalOnlyHotspotService::class.java)) else -> binder.stop() } }