package top.outsidethebox.followme.service import android.content.BroadcastReceiver import android.content.Context import android.content.Intent import top.outsidethebox.followme.data.AppPrefs class BootReceiver : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent?) { val action = intent?.action ?: return if (action == Intent.ACTION_BOOT_COMPLETED || action == Intent.ACTION_MY_PACKAGE_REPLACED) { val prefs = AppPrefs(context.applicationContext) if (prefs.isTrackingEnabled()) { TrackingService.start(context) } } } }