From 209f577890448790a366b3a5919e42d08eb63b25 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Thu, 5 May 2022 09:25:59 +0200 Subject: [PATCH] Fixed crash when device boots & start at boot setting is disabled --- app/src/main/java/org/linphone/core/BootReceiver.kt | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/app/src/main/java/org/linphone/core/BootReceiver.kt b/app/src/main/java/org/linphone/core/BootReceiver.kt index 22cad84ed..dfd765237 100644 --- a/app/src/main/java/org/linphone/core/BootReceiver.kt +++ b/app/src/main/java/org/linphone/core/BootReceiver.kt @@ -36,16 +36,12 @@ class BootReceiver : BroadcastReceiver() { Log.i("[Boot Receiver] Device is starting, autoStart is $autoStart") if (autoStart) { startService(context) - } else { - stopService() } } else if (intent.action.equals(Intent.ACTION_MY_PACKAGE_REPLACED, ignoreCase = true)) { val autoStart = corePreferences.autoStart Log.i("[Boot Receiver] App has been updated, autoStart is $autoStart") if (autoStart) { startService(context) - } else { - stopService() } } } @@ -62,10 +58,4 @@ class BootReceiver : BroadcastReceiver() { serviceIntent.putExtra("StartForeground", true) Compatibility.startForegroundService(context, serviceIntent) } - - private fun stopService() { - Log.i("[Boot Receiver] Auto start setting is disabled, stopping foreground service") - coreContext.notificationsManager.stopForegroundNotification() - coreContext.stop() - } }