override fun onReceive(context: Context?, intent: Intent?) {
Log.d("RECEIVED BROADCAST", intent.toString())
if (Intent.ACTION_BOOT_COMPLETED == intent?.action || Intent.ACTION_MY_PACKAGE_REPLACED == intent?.action) {
val doBoot = context?.getSharedPreferences("CallSensePrefs", Context.MODE_PRIVATE)?.getBoolean("boot", false)
Log.d("BOOT(Receiver)", doBoot.toString())
if (doBoot!!) {
val i = Intent(context, PocketService::class.java)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
context.startForegroundService(i)
} else {
context.startService(i)
}
}
}
[snip]
}