Coverage / app/src/main/java/io/oxygenhub/android/runner/RunnerResume.kt 0.0%
0 of 4 lines run, 0 of 2 functions, 0 of 4 branches · run #1632 on main · run missed
| 1 | package io.oxygenhub.android.runner | |
| 2 | ||
| 3 | import android.content.BroadcastReceiver | |
| 4 | import android.content.Context | |
| 5 | import android.content.Intent | |
| 6 | ||
| 7 | /** | |
| 8 | * Offers the phone as a runner again after it restarts or the app is | |
| 9 | * updated, if its owner had it offered: an update stops the app, and with | |
| 10 | * it the runner. | |
| 11 | */ | |
| 12 | class RunnerResume : BroadcastReceiver() { | |
| 13 | override fun onReceive(context: Context, intent: Intent) { | |
| 14 | if (intent.action == Intent.ACTION_BOOT_COMPLETED || intent.action == Intent.ACTION_MY_PACKAGE_REPLACED) { | |
| 15 | PhoneRunner.resume(context) | |
| 16 | } | |
| 17 | } | |
| 18 | } |