fix(android): add BootReceiver.kt (force-add past gitignore)

This commit is contained in:
ssbg04 committed 2026-08-18 13:03:02 +08:00
1 parent 1f02eb1f26
commit 4306a19d7b
1 file changed
+18
@@ -0,0 +1,18 @@
package com.teamsb.tis_rms
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import com.pravera.flutter_foreground_task.service.ForegroundService
class BootReceiver : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
val action = intent.action ?: return
if (action == Intent.ACTION_BOOT_COMPLETED ||
action == "android.intent.action.QUICKBOOT_POWERON"
) {
val serviceIntent = Intent(context, ForegroundService::class.java)
context.startForegroundService(serviceIntent)
}
}
}