mirror of
https://github.com/jellyfin/jellyfin-androidtv.git
synced 2024-11-28 00:20:46 +00:00
Fix ChannelManager crash on older API levels
This commit is contained in:
parent
bf79e8c337
commit
e5771f4c95
@ -1,6 +1,8 @@
|
||||
[*]
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
|
||||
[{*.kts, *.kt}]
|
||||
charset = utf-8
|
||||
end_of_line = crlf
|
||||
insert_final_newline = true
|
||||
indent_style = tab
|
||||
tab_width = 4
|
||||
|
@ -2,6 +2,7 @@ package org.jellyfin.androidtv.channels
|
||||
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import androidx.tvprovider.media.tv.TvContractCompat.WatchNextPrograms
|
||||
import androidx.tvprovider.media.tv.WatchNextProgram
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
@ -33,9 +34,10 @@ class ChannelManager {
|
||||
private val application = TvApp.getApplication()
|
||||
|
||||
/**
|
||||
* Check if the app can use Leanback features
|
||||
* Check if the app can use Leanback features and is API level 26 or higher
|
||||
*/
|
||||
private val isSupported = application.packageManager.hasSystemFeature("android.software.leanback")
|
||||
private val isSupported = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O
|
||||
&& application.packageManager.hasSystemFeature("android.software.leanback")
|
||||
|
||||
/**
|
||||
* Update all channels for the currently authenticated user
|
||||
|
Loading…
Reference in New Issue
Block a user