This commit is contained in:
lucky 2022-02-17 02:45:34 +03:00
parent a173ffd83c
commit 33a6681052
1 changed files with 3 additions and 3 deletions

View File

@ -7,9 +7,9 @@ import androidx.core.content.ContextCompat
class RestartReceiver : BroadcastReceiver() { class RestartReceiver : BroadcastReceiver() {
override fun onReceive(context: Context?, intent: Intent?) { override fun onReceive(context: Context?, intent: Intent?) {
if (context == null || intent == null) return if (context == null
if (intent.action != Intent.ACTION_BOOT_COMPLETED && || (intent?.action != Intent.ACTION_BOOT_COMPLETED
intent.action != Intent.ACTION_MY_PACKAGE_REPLACED) return && intent?.action != Intent.ACTION_MY_PACKAGE_REPLACED)) return
val prefs = Preferences(context) val prefs = Preferences(context)
if (!prefs.isServiceEnabled || !prefs.isWipeOnInactivity) return if (!prefs.isServiceEnabled || !prefs.isWipeOnInactivity) return
ContextCompat.startForegroundService( ContextCompat.startForegroundService(