From aa102b4d58fd8ba50fd76c68e3dbfff36d899a84 Mon Sep 17 00:00:00 2001 From: LooKeR Date: Fri, 20 Oct 2023 11:09:31 +0530 Subject: [PATCH] Fix installer not working as expected - Remove packageName from queue after removing it from state - Cleanup quicker then usual --- .../src/main/java/com/looker/installer/InstallManager.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/installer/src/main/java/com/looker/installer/InstallManager.kt b/installer/src/main/java/com/looker/installer/InstallManager.kt index 614f99f19..4bb83cb64 100644 --- a/installer/src/main/java/com/looker/installer/InstallManager.kt +++ b/installer/src/main/java/com/looker/installer/InstallManager.kt @@ -82,16 +82,16 @@ class InstallManager( } } }.consumeEach { item -> - if (state.value[item.packageName] != null) { + currentQueue.remove(item.packageName.name) + if (state.value.containsKey(item.packageName)) { updateState { put(item.packageName, InstallState.Installing) } val success = installer.install(item) + installer.cleanup() updateState { put(item.packageName, success) } - currentQueue.remove(item.packageName.name) context.notificationManager?.cancel( "download-${item.packageName.name}", Constants.NOTIFICATION_ID_DOWNLOADING ) - installer.cleanup() } } }