Move source files from 'java' to 'kotlin' folder

This commit is contained in:
Niko Diamadis
2023-01-13 14:49:53 +01:00
parent 24812b6f43
commit 3321f9eee5
39 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
package com.github.gotify.init
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.os.Build
import com.github.gotify.Settings
import com.github.gotify.service.WebSocketService
internal class BootCompletedReceiver : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
val settings = Settings(context)
if (!settings.tokenExists()) {
return
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
context.startForegroundService(Intent(context, WebSocketService::class.java))
} else {
context.startService(Intent(context, WebSocketService::class.java))
}
}
}