From 33a66810522e6768d4715ce3135adb27dd7d28b1 Mon Sep 17 00:00:00 2001 From: lucky <> Date: Thu, 17 Feb 2022 02:45:34 +0300 Subject: [PATCH] ref --- app/src/main/java/me/lucky/wasted/RestartReceiver.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/me/lucky/wasted/RestartReceiver.kt b/app/src/main/java/me/lucky/wasted/RestartReceiver.kt index 823c6c4..05c13fa 100644 --- a/app/src/main/java/me/lucky/wasted/RestartReceiver.kt +++ b/app/src/main/java/me/lucky/wasted/RestartReceiver.kt @@ -7,9 +7,9 @@ import androidx.core.content.ContextCompat class RestartReceiver : BroadcastReceiver() { override fun onReceive(context: Context?, intent: Intent?) { - if (context == null || intent == null) return - if (intent.action != Intent.ACTION_BOOT_COMPLETED && - intent.action != Intent.ACTION_MY_PACKAGE_REPLACED) return + if (context == null + || (intent?.action != Intent.ACTION_BOOT_COMPLETED + && intent?.action != Intent.ACTION_MY_PACKAGE_REPLACED)) return val prefs = Preferences(context) if (!prefs.isServiceEnabled || !prefs.isWipeOnInactivity) return ContextCompat.startForegroundService(