summaryrefslogtreecommitdiffhomepage
path: root/android/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'android/src/main')
-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
}
}