Remove repeater from UI if it's not supported

This could happen on devices like Chrome OS and Android emulators.
This commit is contained in:
Mygod
2018-12-13 15:04:19 +08:00
parent 6002794905
commit ca1fc946ca
6 changed files with 43 additions and 21 deletions

View File

@@ -27,6 +27,8 @@ class BootReceiver : BroadcastReceiver() {
Intent.ACTION_BOOT_COMPLETED, Intent.ACTION_LOCKED_BOOT_COMPLETED -> started = true
else -> return
}
ContextCompat.startForegroundService(context, Intent(context, RepeaterService::class.java))
if (RepeaterService.supported) {
ContextCompat.startForegroundService(context, Intent(context, RepeaterService::class.java))
}
}
}