Fix occasional crash when mass installing/uninstalling extension using PackageManager

This commit is contained in:
AntsyLich
2026-03-23 20:12:14 +06:00
parent f8e82b9322
commit 42daa3f432
2 changed files with 8 additions and 2 deletions
+1
View File
@@ -14,6 +14,7 @@ The format is a modified version of [Keep a Changelog](https://keepachangelog.co
### Fixed ### Fixed
- Fix app crashing when trying to add extension repo with existing signature ([@AntsyLich](https://github.com/AntsyLich)) - Fix app crashing when trying to add extension repo with existing signature ([@AntsyLich](https://github.com/AntsyLich))
- Potentially fix 'database is locked' crash ([@AntsyLich](https://github.com/AntsyLich)) - Potentially fix 'database is locked' crash ([@AntsyLich](https://github.com/AntsyLich))
- Fix occasional crash when mass installing/uninstalling extension using `PackageManager` ([@AntsyLich](https://github.com/AntsyLich))
## [v0.19.5] - 2026-03-20 ## [v0.19.5] - 2026-03-20
### Changed ### Changed
@@ -106,8 +106,13 @@ class PackageInstallerInstaller(private val service: Service) : Installer(servic
override fun cancelEntry(entry: Entry): Boolean { override fun cancelEntry(entry: Entry): Boolean {
activeSession?.let { (activeEntry, sessionId) -> activeSession?.let { (activeEntry, sessionId) ->
if (activeEntry == entry) { if (activeEntry == entry) {
packageInstaller.abandonSession(sessionId) return try {
return false packageInstaller.abandonSession(sessionId)
false
} catch (_: SecurityException) {
// Highly likely the session has succeeded
true
}
} }
} }
return true return true