From e42e2fbd564682f05316cecc3552d7fe096ffc3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=BE=E7=A5=A5=E4=BF=8A?= Date: Fri, 2 Aug 2024 15:19:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AE=89=E8=A3=85=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E4=BC=98=E5=8C=96-=E6=82=AC=E6=B5=AE=E7=AA=97-=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../suspendwindow/NDownloadSuspendWindowController.kt | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/gh/ndownload/suspendwindow/NDownloadSuspendWindowController.kt b/app/src/main/java/com/gh/ndownload/suspendwindow/NDownloadSuspendWindowController.kt index 300557a9b1..9b78c98171 100644 --- a/app/src/main/java/com/gh/ndownload/suspendwindow/NDownloadSuspendWindowController.kt +++ b/app/src/main/java/com/gh/ndownload/suspendwindow/NDownloadSuspendWindowController.kt @@ -335,15 +335,10 @@ class NDownloadSuspendWindowController(private val application: Application) : return } - val packageName = event.packageName - val downloadEntity = DownloadManager - .getInstance() - .getDownloadEntityByPackageName(packageName) ?: return - - if (shouldSkipDownloadEntity(downloadEntity)) return + val currentDownloadEntity = this.currentDownloadEntity ?: return // 当所有任务流程都执行完成以后,则显示“完成”状态,否则显示下一个优先级最高的任务 - if (calculateDoneCount() == 1) { + if (calculateDoneCount() <= 1 && event.packageName == currentDownloadEntity.packageName) { iconWindow.setDownloadState(NDownloadState.Complete) } else if (!initCurrentDownloadEntity()) { dismiss()