fix: 修复进入下载管理自动下载已暂停游戏的问题

Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
This commit is contained in:
chenjuntao
2024-07-29 17:48:41 +08:00
parent 3276fca27c
commit 79a7f994eb
3 changed files with 5 additions and 5 deletions

View File

@ -1008,7 +1008,7 @@ public class DownloadManager implements DownloadStatusListener {
}
startDownloadService();
checkAndRetryDownload();
checkAndRetryDownload(true);
}
/**
@ -1099,14 +1099,14 @@ public class DownloadManager implements DownloadStatusListener {
/**
* 检查并尝试重试下载
*/
public void checkAndRetryDownload() {
public void checkAndRetryDownload(boolean includePausedTask) {
if (!NetworkUtils.isWifiConnected(mContext)) return;
for (DownloadEntity downloadEntity : DownloadManager.getInstance().getAllDownloadEntityExcludeDoneTask()) {
if (DownloadStatus.neterror.equals(downloadEntity.getStatus())
|| DownloadStatus.timeout.equals(downloadEntity.getStatus())
|| DownloadStatus.subscribe.equals(downloadEntity.getStatus())
|| DownloadStatus.pause.equals(downloadEntity.getStatus())
|| (includePausedTask && DownloadStatus.pause.equals(downloadEntity.getStatus()))
) {
DownloadManager.getInstance().put(downloadEntity.getUrl(), System.currentTimeMillis());
Message msg = Message.obtain();