mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-17 06:27:29 +01:00
Avoid crash on Samsung devices on Android 12
Co-authored-by: Jays2Kings <Jays2Kings@users.noreply.github.com>
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
package eu.kanade.tachiyomi.util.system
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.os.Build
|
||||
import logcat.LogPriority
|
||||
import java.util.Locale
|
||||
|
||||
object MiuiUtil {
|
||||
object DeviceUtil {
|
||||
|
||||
fun isMiui(): Boolean {
|
||||
return getSystemProperty("ro.miui.ui.version.name")?.isNotEmpty() ?: false
|
||||
}
|
||||
fun isMiui() = getSystemProperty("ro.miui.ui.version.name")?.isNotEmpty() ?: false
|
||||
|
||||
@SuppressLint("PrivateApi")
|
||||
fun isMiuiOptimizationDisabled(): Boolean {
|
||||
@@ -25,6 +25,8 @@ object MiuiUtil {
|
||||
}
|
||||
}
|
||||
|
||||
fun isSamsung() = Build.MANUFACTURER.lowercase(Locale.ENGLISH) == "samsung"
|
||||
|
||||
@SuppressLint("PrivateApi")
|
||||
private fun getSystemProperty(key: String?): String? {
|
||||
return try {
|
||||
Reference in New Issue
Block a user