Fix occasional crash when mass installing/uninstalling extension using PackageManager
(cherry picked from commit 42daa3f432292be5fdfb3ecae07592cb94324164)
This commit is contained in:
parent
768c3dcec5
commit
0b285f83b1
1 changed files with 7 additions and 2 deletions
|
|
@ -106,8 +106,13 @@ class PackageInstallerInstaller(private val service: Service) : Installer(servic
|
|||
override fun cancelEntry(entry: Entry): Boolean {
|
||||
activeSession?.let { (activeEntry, sessionId) ->
|
||||
if (activeEntry == entry) {
|
||||
return try {
|
||||
packageInstaller.abandonSession(sessionId)
|
||||
return false
|
||||
false
|
||||
} catch (_: SecurityException) {
|
||||
// Highly likely the session has succeeded
|
||||
true
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
|
|
|
|||
Loading…
Reference in a new issue