Modern Apps git
git clone https://git.maproj.org/Modern-Apps.git
translate ▾

Modern-Apps.git / watch-wear / src / main / java / com / vayunmathur / watch / wear / platform / BootReceiver.kt

BootReceiver.kt17 lines · 570 BRaw
1package com.vayunmathur.watch.wear.platform
2
3import android.content.BroadcastReceiver
4import android.content.Context
5import android.content.Intent
6import com.vayunmathur.watch.wear.service.ConduitService
7
8/** Starts the conduit foreground service after boot or app replacement. */
9class BootReceiver : BroadcastReceiver() {
10 override fun onReceive(context: Context, intent: Intent) {
11 when (intent.action) {
12 Intent.ACTION_BOOT_COMPLETED,
13 Intent.ACTION_MY_PACKAGE_REPLACED,
14 -> ConduitService.start(context)
15 }
16 }
17}