Temporarily disable miui check for extensions

Moved instead to extension install failure
This commit is contained in:
Jays2Kings 2021-07-14 19:41:23 -04:00
parent 681879961b
commit 8ea2aaab7f
2 changed files with 11 additions and 8 deletions

View File

@ -6,9 +6,11 @@ import android.content.Intent
import android.content.pm.PackageInstaller import android.content.pm.PackageInstaller
import android.content.pm.PackageInstaller.SessionParams import android.content.pm.PackageInstaller.SessionParams
import android.os.Bundle import android.os.Bundle
import android.widget.Toast
import com.hippo.unifile.UniFile import com.hippo.unifile.UniFile
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.extension.ExtensionManager import eu.kanade.tachiyomi.extension.ExtensionManager
import eu.kanade.tachiyomi.util.system.MiuiUtil
import eu.kanade.tachiyomi.util.system.toast import eu.kanade.tachiyomi.util.system.toast
import uy.kohesive.injekt.injectLazy import uy.kohesive.injekt.injectLazy
@ -80,8 +82,12 @@ class ExtensionInstallActivity : Activity() {
PackageInstaller.STATUS_FAILURE, PackageInstaller.STATUS_FAILURE_ABORTED, PackageInstaller.STATUS_FAILURE_BLOCKED, PackageInstaller.STATUS_FAILURE_CONFLICT, PackageInstaller.STATUS_FAILURE_INCOMPATIBLE, PackageInstaller.STATUS_FAILURE_INVALID, PackageInstaller.STATUS_FAILURE_STORAGE -> { PackageInstaller.STATUS_FAILURE, PackageInstaller.STATUS_FAILURE_ABORTED, PackageInstaller.STATUS_FAILURE_BLOCKED, PackageInstaller.STATUS_FAILURE_CONFLICT, PackageInstaller.STATUS_FAILURE_INCOMPATIBLE, PackageInstaller.STATUS_FAILURE_INVALID, PackageInstaller.STATUS_FAILURE_STORAGE -> {
extensionManager.setInstallationResult(downloadId, false) extensionManager.setInstallationResult(downloadId, false)
if (status != PackageInstaller.STATUS_FAILURE_ABORTED) { if (status != PackageInstaller.STATUS_FAILURE_ABORTED) {
if (MiuiUtil.isMiui()) {
toast(R.string.extensions_miui_warning, Toast.LENGTH_LONG)
} else {
toast(R.string.could_not_install_extension) toast(R.string.could_not_install_extension)
} }
}
finish() finish()
} }
else -> { else -> {

View File

@ -1,7 +1,6 @@
package eu.kanade.tachiyomi.ui.extension package eu.kanade.tachiyomi.ui.extension
import android.content.pm.PackageInstaller import android.content.pm.PackageInstaller
import android.widget.Toast
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.database.DatabaseHelper import eu.kanade.tachiyomi.data.database.DatabaseHelper
import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.database.models.Manga
@ -19,9 +18,7 @@ import eu.kanade.tachiyomi.ui.migration.MangaItem
import eu.kanade.tachiyomi.ui.migration.SelectionHeader import eu.kanade.tachiyomi.ui.migration.SelectionHeader
import eu.kanade.tachiyomi.ui.migration.SourceItem import eu.kanade.tachiyomi.ui.migration.SourceItem
import eu.kanade.tachiyomi.util.system.LocaleHelper import eu.kanade.tachiyomi.util.system.LocaleHelper
import eu.kanade.tachiyomi.util.system.MiuiUtil
import eu.kanade.tachiyomi.util.system.executeOnIO import eu.kanade.tachiyomi.util.system.executeOnIO
import eu.kanade.tachiyomi.util.system.toast
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.async import kotlinx.coroutines.async
import kotlinx.coroutines.awaitAll import kotlinx.coroutines.awaitAll
@ -256,10 +253,10 @@ class ExtensionBottomPresenter(
} }
fun isNotMIUIOptimized(): Boolean { fun isNotMIUIOptimized(): Boolean {
if (MiuiUtil.isMiui() && !MiuiUtil.isMiuiOptimizationDisabled()) { // if (MiuiUtil.isMiui() && !MiuiUtil.isMiuiOptimizationDisabled()) {
preferences.context.toast(R.string.extensions_miui_warning, Toast.LENGTH_LONG) // preferences.context.toast(R.string.extensions_miui_warning, Toast.LENGTH_LONG)
return false // return false
} // }
return true return true
} }