Hopefully fix app installation progress badges not disappearing
This commit is contained in:
parent
9b4028f9f8
commit
73d65d1a30
@ -119,6 +119,13 @@ class AppRepository(
|
||||
override fun onProgressChanged(sessionId: Int, progress: Float) {
|
||||
val session = packageInstaller.getSessionInfo(sessionId) ?: return
|
||||
val pkg = session.appPackageName ?: return
|
||||
if (!installingPackages.containsKey(sessionId)) {
|
||||
val key = "app://$pkg"
|
||||
val badge = badgeProvider.getBadge(key)?.also { it.progress = null }
|
||||
?: Badge()
|
||||
badgeProvider.setBadge(key, badge)
|
||||
return
|
||||
}
|
||||
badgeProvider.updateBadge("app://$pkg", Badge(progress = progress))
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user