summaryrefslogtreecommitdiffhomepage
path: root/android
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2020-05-04 18:20:10 +0000
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2020-05-04 19:47:47 +0000
commite2319852b2efd54a437b12d517af70825f7e080c (patch)
treeee1a68319523d29bfc67dc3797e3144e33a5d522 /android
parentce064344367900134c9d14a6f96ac5ebdd30a790 (diff)
downloadmullvadvpn-e2319852b2efd54a437b12d517af70825f7e080c.tar.xz
mullvadvpn-e2319852b2efd54a437b12d517af70825f7e080c.zip
Promise service is foreground in quick-settings
Diffstat (limited to 'android')
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/service/MullvadTileService.kt7
1 files changed, 6 insertions, 1 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/MullvadTileService.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/MullvadTileService.kt
index 296b324332..4a9562c6ec 100644
--- a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/MullvadTileService.kt
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/MullvadTileService.kt
@@ -2,6 +2,7 @@ package net.mullvad.mullvadvpn.service
import android.content.Intent
import android.graphics.drawable.Icon
+import android.os.Build
import android.service.quicksettings.Tile
import android.service.quicksettings.TileService
import net.mullvad.mullvadvpn.R
@@ -61,7 +62,11 @@ class MullvadTileService : TileService() {
intent.action = KEY_CONNECT_ACTION
}
- startService(intent)
+ if (Build.VERSION.SDK_INT >= 26) {
+ startForegroundService(intent)
+ } else {
+ startService(intent)
+ }
}
override fun onStopListening() {