From 837fa2c6b4e61653bd4d14a94af8c48d859a7944 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquart Date: Wed, 3 May 2023 15:40:14 +0000 Subject: 1139: FIX crash in background --- .../e/privacymodules/trackers/DNSBlockerService.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'trackers/src/main/java/foundation/e/privacymodules') 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() { -- cgit v1.2.1