AndroidAPS/app/src/main/java/info/nightscout/androidaps/receivers/AutoStartReceiver.kt

14 lines
499 B
Kotlin
Raw Normal View History

2020-03-31 10:18:53 +02:00
package info.nightscout.androidaps.receivers
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import info.nightscout.androidaps.plugins.general.persistentNotification.DummyService
class AutoStartReceiver : BroadcastReceiver() {
2021-01-16 18:29:18 +01:00
2020-03-31 10:18:53 +02:00
override fun onReceive(context: Context, intent: Intent) {
2021-01-16 18:29:18 +01:00
if (intent.action == Intent.ACTION_BOOT_COMPLETED)
context.startForegroundService(Intent(context, DummyService::class.java))
2020-03-31 10:18:53 +02:00
}
}