Merge pull request #778 from Bnyro/master

fix vpn
This commit is contained in:
Bnyro 2022-07-14 16:08:08 +02:00 committed by GitHub
commit ea59effff8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -170,7 +170,7 @@ class PlayerFragment : Fragment() {
autoRotationEnabled = PreferenceHelper.getBoolean( autoRotationEnabled = PreferenceHelper.getBoolean(
requireContext(), requireContext(),
"auto_fullscreen", "auto_fullscreen",
true false
) )
val mainActivity = activity as MainActivity val mainActivity = activity as MainActivity
if (autoRotationEnabled) { if (autoRotationEnabled) {

View File

@ -9,6 +9,9 @@ object ConnectionHelper {
fun isNetworkAvailable(context: Context): Boolean { fun isNetworkAvailable(context: Context): Boolean {
val connectivityManager = val connectivityManager =
context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
// this seems to not recognize vpn connections
/*
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
val nw = connectivityManager.activeNetwork ?: return false val nw = connectivityManager.activeNetwork ?: return false
val actNw = connectivityManager.getNetworkCapabilities(nw) ?: return false val actNw = connectivityManager.getNetworkCapabilities(nw) ?: return false
@ -28,5 +31,8 @@ object ConnectionHelper {
} else { } else {
return connectivityManager.activeNetworkInfo?.isConnected ?: false return connectivityManager.activeNetworkInfo?.isConnected ?: false
} }
*/
return connectivityManager.activeNetworkInfo?.isConnected ?: false
} }
} }