android app for https://otb-tracker.outsidethebox.top tracking
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
634 B
18 lines
634 B
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) |
|
} |
|
} |
|
} |
|
}
|
|
|