OXYGENHUB
# 1dfa631436b6 oxygenhub-android / app / src / main / java / io / oxygenhub / android / runner / RunnerResume.kt
590 B · last changed Notifications when a proposal can be landed; the runner comes back after an update or restart (closes #20, refs #8) 10 days ago source blame history raw
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
}