summaryrefslogtreecommitdiffhomepage
path: root/android
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2020-02-06 14:49:15 -0300
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2020-02-06 14:49:15 -0300
commit54796fa13112d2185a90edbc05d043c137c835a6 (patch)
tree6e2ff5e7d2fbc98709492c631a71b4ab119ac794 /android
parente498f07e2322d581e1e0a5b5fc0243fa919eedb3 (diff)
parent0b5705b9e7271c8d18d177e1128b96216c03e010 (diff)
downloadmullvadvpn-54796fa13112d2185a90edbc05d043c137c835a6.tar.xz
mullvadvpn-54796fa13112d2185a90edbc05d043c137c835a6.zip
Merge branch 'fix-stop-foreground-crash'
Diffstat (limited to 'android')
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/service/ForegroundNotificationManager.kt7
1 files changed, 6 insertions, 1 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/ForegroundNotificationManager.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/ForegroundNotificationManager.kt
index 0a9a48e3fa..34ccb59bfd 100644
--- a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/ForegroundNotificationManager.kt
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/ForegroundNotificationManager.kt
@@ -207,7 +207,12 @@ class ForegroundNotificationManager(val service: Service, val connectionProxy: C
service.startForeground(FOREGROUND_NOTIFICATION_ID, buildNotification())
onForeground = true
} else if (!shouldBeOnForeground) {
- service.stopForeground(Service.STOP_FOREGROUND_DETACH)
+ if (Build.VERSION.SDK_INT >= 24) {
+ service.stopForeground(Service.STOP_FOREGROUND_DETACH)
+ } else {
+ service.stopForeground(false)
+ }
+
onForeground = false
}
}