package invalid.lena.rsend

import android.app.Application
import android.app.NotificationChannel
import android.app.NotificationManager
import android.os.Build

// App creates the notification channel used by the foreground sync service.
class App : Application() {

    override fun onCreate() {
        super.onCreate()
        if (Build.VERSION.SDK_INT >= 26) {
            val ch = NotificationChannel(CHANNEL, "Sync", NotificationManager.IMPORTANCE_LOW)
            getSystemService(NotificationManager::class.java).createNotificationChannel(ch)
        }
    }

    companion object {
        const val CHANNEL = "sync"
    }
}
