summaryrefslogtreecommitdiff
path: root/trackers/src/main
diff options
context:
space:
mode:
authorGuillaume Jacquart <guillaume.jacquart@hoodbrains.com>2023-05-03 15:40:14 +0000
committerGuillaume Jacquart <guillaume.jacquart@hoodbrains.com>2023-05-03 15:40:14 +0000
commit837fa2c6b4e61653bd4d14a94af8c48d859a7944 (patch)
treeae9d49ffcb909e685e5a21141a1facb6b45e6208 /trackers/src/main
parenta0ee04ea9dbc0802c828afdf660eb37dc6fa350f (diff)
1139: FIX crash in background
Diffstat (limited to 'trackers/src/main')
-rw-r--r--trackers/src/main/java/foundation/e/privacymodules/trackers/DNSBlockerService.kt12
1 files changed, 6 insertions, 6 deletions
diff --git a/trackers/src/main/java/foundation/e/privacymodules/trackers/DNSBlockerService.kt b/trackers/src/main/java/foundation/e/privacymodules/trackers/DNSBlockerService.kt
index 97a0fda..c2ad16b 100644
--- a/trackers/src/main/java/foundation/e/privacymodules/trackers/DNSBlockerService.kt
+++ b/trackers/src/main/java/foundation/e/privacymodules/trackers/DNSBlockerService.kt
@@ -40,15 +40,15 @@ class DNSBlockerService : Service() {
throw UnsupportedOperationException("Not yet implemented")
}
- override fun onStartCommand(intent: Intent, flags: Int, startId: Int): Int {
- if (intent.getBooleanExtra(EXTRA_ENABLE_NOTIFICATION, true)) {
- ForegroundStarter.startForeground(this)
- }
- if (ACTION_START == intent.action) {
+ override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
+ if (ACTION_START == intent?.action) {
+ if (intent.getBooleanExtra(EXTRA_ENABLE_NOTIFICATION, true)) {
+ ForegroundStarter.startForeground(this)
+ }
stop()
start()
}
- return START_STICKY
+ return START_REDELIVER_INTENT
}
private fun start() {