From 3679e0cb2310355fbcfcf99dc442ee45bfc77c6d Mon Sep 17 00:00:00 2001 From: laoyuyu <511455842@qq.com> Date: Wed, 14 Apr 2021 21:19:04 +0800 Subject: [PATCH] fix bug https://github.com/AriaLyy/Aria/issues/851 --- .../main/java/com/arialyy/aria/core/common/ProxyHelper.java | 6 +++--- .../com/arialyy/aria/core/download/DownloadReceiver.java | 1 + .../java/com/arialyy/aria/core/upload/UploadReceiver.java | 1 + build.gradle | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Aria/src/main/java/com/arialyy/aria/core/common/ProxyHelper.java b/Aria/src/main/java/com/arialyy/aria/core/common/ProxyHelper.java index 9e105dda..dbce4c5f 100644 --- a/Aria/src/main/java/com/arialyy/aria/core/common/ProxyHelper.java +++ b/Aria/src/main/java/com/arialyy/aria/core/common/ProxyHelper.java @@ -18,11 +18,10 @@ package com.arialyy.aria.core.common; import com.arialyy.annotations.TaskEnum; import com.arialyy.aria.core.download.DownloadGroupTaskListener; import com.arialyy.aria.core.download.DownloadTaskListener; -import com.arialyy.aria.core.scheduler.TaskInternalListenerInterface; import com.arialyy.aria.core.scheduler.M3U8PeerTaskListener; import com.arialyy.aria.core.scheduler.SubTaskListener; +import com.arialyy.aria.core.scheduler.TaskInternalListenerInterface; import com.arialyy.aria.core.upload.UploadTaskListener; - import java.util.HashSet; import java.util.Map; import java.util.Set; @@ -81,7 +80,8 @@ public class ProxyHelper { return result; } result = checkProxyTypeByInterface(clazz); - if (result != null) { + if (result != null && !result.isEmpty()) { + mProxyCache.put(clazz.getName(), result); return result; } result = checkProxyTypeByProxyClass(clazz); diff --git a/Aria/src/main/java/com/arialyy/aria/core/download/DownloadReceiver.java b/Aria/src/main/java/com/arialyy/aria/core/download/DownloadReceiver.java index 71dd07fe..b2e22c96 100644 --- a/Aria/src/main/java/com/arialyy/aria/core/download/DownloadReceiver.java +++ b/Aria/src/main/java/com/arialyy/aria/core/download/DownloadReceiver.java @@ -175,6 +175,7 @@ public class DownloadReceiver extends AbsReceiver { return; } if (obj instanceof TaskInternalListenerInterface){ + ProxyHelper.getInstance().checkProxyType(obj.getClass()); if (obj instanceof DownloadTaskListener){ TaskSchedulers.getInstance().register(obj, TaskEnum.DOWNLOAD); } diff --git a/Aria/src/main/java/com/arialyy/aria/core/upload/UploadReceiver.java b/Aria/src/main/java/com/arialyy/aria/core/upload/UploadReceiver.java index f4087d80..cb299fb7 100644 --- a/Aria/src/main/java/com/arialyy/aria/core/upload/UploadReceiver.java +++ b/Aria/src/main/java/com/arialyy/aria/core/upload/UploadReceiver.java @@ -272,6 +272,7 @@ public class UploadReceiver extends AbsReceiver { return; } if (obj instanceof TaskInternalListenerInterface){ + ProxyHelper.getInstance().checkProxyType(obj.getClass()); if (obj instanceof UploadTaskListener){ TaskSchedulers.getInstance().register(obj, TaskEnum.UPLOAD); } diff --git a/build.gradle b/build.gradle index 8ba4b0c8..ed3ff2e5 100644 --- a/build.gradle +++ b/build.gradle @@ -45,7 +45,7 @@ task clean(type: Delete) { ext { versionCode = 390 - versionName = '3.8.16-beta' + versionName = '3.8.16-beta-1' userOrg = 'arialyy' groupId = 'com.arialyy.aria' publishVersion = versionName