Fail the install when nothing can confirm it instead of crashing
This commit is contained in:
@@ -43,6 +43,7 @@ The format is a modified version of [Keep a Changelog](https://keepachangelog.co
|
|||||||
- Fixed tracker start date being off by a day when adding tracking to an entry with read history in some timezones ([@hazptr](https://github.com/hazptr)) ([#4049](https://github.com/mihonapp/mihon/pull/4049))
|
- Fixed tracker start date being off by a day when adding tracking to an entry with read history in some timezones ([@hazptr](https://github.com/hazptr)) ([#4049](https://github.com/mihonapp/mihon/pull/4049))
|
||||||
- Fixed the paged reader crashing when moving to another chapter after a wide page of a neighbouring chapter was split ([@AntsyLich](https://github.com/AntsyLich))
|
- Fixed the paged reader crashing when moving to another chapter after a wide page of a neighbouring chapter was split ([@AntsyLich](https://github.com/AntsyLich))
|
||||||
- Fixed a crash when opening the filters of a source with an invalid filter ([@AntsyLich](https://github.com/AntsyLich))
|
- Fixed a crash when opening the filters of a source with an invalid filter ([@AntsyLich](https://github.com/AntsyLich))
|
||||||
|
- Fixed a crash when installing an extension on a device where the system installer can't ask for confirmation ([@AntsyLich](https://github.com/AntsyLich))
|
||||||
|
|
||||||
## [v0.21.1] - 2026-10-12
|
## [v0.21.1] - 2026-10-12
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
+11
-1
@@ -3,6 +3,7 @@ package eu.kanade.tachiyomi.extension.installer
|
|||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.app.PendingIntent
|
import android.app.PendingIntent
|
||||||
import android.app.Service
|
import android.app.Service
|
||||||
|
import android.content.ActivityNotFoundException
|
||||||
import android.content.BroadcastReceiver
|
import android.content.BroadcastReceiver
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
@@ -57,7 +58,16 @@ class PackageInstallerInstaller(private val service: Service) : Installer(servic
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
userAction.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
userAction.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||||
service.startActivity(userAction)
|
try {
|
||||||
|
service.startActivity(userAction)
|
||||||
|
} catch (e: ActivityNotFoundException) {
|
||||||
|
// Some devices have the system installer's confirmation screen disabled or removed
|
||||||
|
logcat(LogPriority.WARN, e) { "Nothing can confirm the install" }
|
||||||
|
activeSession?.let { (_, sessionId) ->
|
||||||
|
runCatching { packageInstaller.abandonSession(sessionId) }
|
||||||
|
}
|
||||||
|
continueQueue(InstallStep.Error)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
PackageInstaller.STATUS_FAILURE_ABORTED -> {
|
PackageInstaller.STATUS_FAILURE_ABORTED -> {
|
||||||
continueQueue(InstallStep.Idle)
|
continueQueue(InstallStep.Idle)
|
||||||
|
|||||||
Reference in New Issue
Block a user